Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'incoming')
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/.classpath8
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/.project28
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/META-INF/MANIFEST.MF58
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/about.html28
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/build.properties15
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/ComponentDiagramEditorFactory.java38
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/CreateComponentDiagramCommand.java63
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/UmlComponentDiagramForMultiEditor.java150
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/actions/ManageProvidedInterfacesHandler.java128
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/actions/ShowHideRelatedContentsAction.java95
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/actions/ShowHideRelatedContentsHandler.java35
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/command/CreateViewCommand.java32
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/helpers/ComponentLinkMappingHelper.java98
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/AbstractCustomLabelEditPolicy.java137
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/CustomDiagramDragDropEditPolicy.java614
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java69
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/GraphicalNodeEditPolicy.java153
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/PortItemSemanticEditPolicy.java51
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/PortLayoutEditPolicy.java61
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/PropertyLabelEditPolicy.java300
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/RemoveOrphanViewPolicy.java47
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/figure/edges/UsageDecoration.java59
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/figure/nodes/CompositeFigure.java74
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/figure/nodes/PortFigure.java22
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/locators/PortPositionLocator.java220
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/log/Log.java44
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/messages/Messages.java82
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/messages/messages.properties26
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/preferences/IPapyrusPropertyPreferencesConstant.java34
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/preferences/PropertyPreferencePage.java252
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/providers/ActionStateSourceProvider.java91
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/providers/CustomEditPolicyProvider.java80
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/ui/CreateUmlElementDialog.java438
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/ui/InterfaceManagerDialog.java1053
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/ui/NewElementRepresentation.java172
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/preferences/CommentAnnotatedElementPreferencePage.java59
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/preferences/ConstraintConstrainedElementPreferencePage.java59
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/incomingLinksNavigatorGroup.gifbin709 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/linkSourceNavigatorGroup.gifbin709 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/linkTargetNavigatorGroup.gifbin709 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/linksNavigatorGroup.gifbin709 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Abstraction.gifbin96 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ArtifactIcon.gifbin865 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Comment.gifbin324 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Component.gifbin123 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ComponentDiagram.gifbin110 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ComponentIcon.gifbin881 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ComponentRealization.gifbin219 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Constraint.gifbin101 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Dependency.gifbin131 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Generalization.gifbin1022 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/InterfaceAsCercle.gifbin599 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/InterfaceRealization.gifbin121 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Link.gifbin944 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Manifestation.gifbin95 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Nodes.gifbin144 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Operation.gifbin573 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Package.gifbin396 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Port.gifbin368 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Realization.gifbin134 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Substitution.gifbin94 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/UMLDiagramFile.gifbin339 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Usage.gifbin166 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/outgoingLinksNavigatorGroup.gifbin709 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/icons/wizban/NewUMLWizard.gifbin2466 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/messages.properties244
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/model/ComponentDiagram.gmfgen2040
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/plugin.properties1110
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/plugin.xml1178
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/AbstractionCreateCommand.java157
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/AbstractionReorientCommand.java165
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentAnnotatedElementCreateCommand.java96
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentAnnotatedElementReorientCommand.java148
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentCreateCommand.java128
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentCreateCommandPCN.java125
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentCreateCommand.java127
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentCreateCommandCN.java125
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentCreateCommandPCN.java125
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentRealizationCreateCommand.java157
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentRealizationReorientCommand.java165
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintConstrainedElementCreateCommand.java96
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintConstrainedElementReorientCommand.java148
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintCreateCommand.java128
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintCreateCommandPCN.java125
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/DependencyCreateCommand.java157
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/DependencyReorientCommand.java165
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/GeneralizationCreateCommand.java154
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/GeneralizationReorientCommand.java156
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceCreateCommand.java127
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceCreateCommandPCN.java125
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceRealizationCreateCommand.java157
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceRealizationReorientCommand.java165
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ManifestationCreateCommand.java157
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ManifestationReorientCommand.java165
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/PackageCreateCommand.java126
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/PortCreateCommand.java125
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/SubstitutionCreateCommand.java157
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/SubstitutionReorientCommand.java165
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/UsageCreateCommand.java157
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/UsageReorientCommand.java165
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/AbstractionEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/CommentEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ComponentEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ComponentRealizationEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ConstraintEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/DependencyEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/GeneralizationEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/InterfaceEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/InterfaceRealizationEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ManifestationEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ModelEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/PackageEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/PortEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/SubstitutionEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/UMLBaseEditHelper.java86
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/UsageEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/AbstractionAppliedStereotypeEditPart.java723
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/AbstractionEditPart.java113
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/AbstractionNameEditPart.java723
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentAnnotatedElementEditPart.java87
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentBodyEditPart.java768
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentBodyEditPartPCN.java768
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentEditPart.java417
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentEditPartPCN.java419
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentCompositeCompartmentEditPart.java127
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentCompositeCompartmentEditPartCN.java127
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentCompositeCompartmentEditPartPCN.java127
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentDiagramEditPart.java199
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentEditPart.java799
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentEditPartCN.java799
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentEditPartPCN.java799
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentNameEditPart.java786
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentNameEditPartCN.java786
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentNameEditPartPCN.java767
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentRealizationAppliedStereotypeEditPart.java715
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentRealizationEditPart.java112
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentRealizationNameEditPart.java723
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintConstrainedElementEditPart.java87
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintEditPart.java767
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintEditPartPCN.java769
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintNameEditPart.java786
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintNameEditPartPCN.java786
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintSpecificationEditPart.java787
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintSpecificationEditPartPCN.java787
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/DependencyAppliedStereotypeEditPart.java715
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/DependencyEditPart.java112
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/DependencyNameEditPart.java723
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/GeneralizationAppliedStereotypeEditPart.java715
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/GeneralizationEditPart.java105
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceEditPart.java739
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceEditPartPCN.java741
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceNameEditPart.java774
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceNameEditPartPCN.java774
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceRealizationEditPart.java87
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/LinkDescriptorEditPart.java90
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ManifestationAppliedStereotypeEditPart.java723
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ManifestationEditPart.java113
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ManifestationNameEditPart.java723
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PackageEditPart.java720
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PackageNameEditPart.java786
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PackagePackageableElementCompartmentEditPart.java122
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PortAppliedStereotypeEditPart.java746
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PortEditPart.java707
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PortNameEditPart.java752
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/SubstitutionAppliedStereotypeEditPart.java723
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/SubstitutionEditPart.java113
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/SubstitutionNameEditPart.java723
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/UMLEditPartFactory.java353
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/UsageEditPart.java61
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/AbstractionItemSemanticEditPolicy.java190
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java27
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/CommentItemSemanticEditPolicy.java104
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/CommentItemSemanticEditPolicyPCN.java104
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCanonicalEditPolicy.java146
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCanonicalEditPolicyCN.java146
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCanonicalEditPolicyPCN.java146
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentCanonicalEditPolicy.java146
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentCanonicalEditPolicyCN.java146
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentCanonicalEditPolicyPCN.java146
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentItemSemanticEditPolicy.java31
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentItemSemanticEditPolicyCN.java31
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentItemSemanticEditPolicyPCN.java31
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentDiagramItemSemanticEditPolicy.java83
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentItemSemanticEditPolicy.java211
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentItemSemanticEditPolicyCN.java211
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentItemSemanticEditPolicyPCN.java211
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentRealizationItemSemanticEditPolicy.java190
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ConstraintConstrainedElementItemSemanticEditPolicy.java27
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ConstraintItemSemanticEditPolicy.java190
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ConstraintItemSemanticEditPolicyPCN.java190
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/DependencyItemSemanticEditPolicy.java192
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/GeneralizationItemSemanticEditPolicy.java104
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/InterfaceItemSemanticEditPolicy.java199
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/InterfaceItemSemanticEditPolicyPCN.java199
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/InterfaceRealizationItemSemanticEditPolicy.java190
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ManifestationItemSemanticEditPolicy.java190
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ModelCanonicalEditPolicy.java504
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PackageItemSemanticEditPolicy.java190
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PackagePackageableElementCompartmentCanonicalEditPolicy.java170
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PackagePackageableElementCompartmentItemSemanticEditPolicy.java43
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PortItemSemanticEditPolicy.java190
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/SubstitutionItemSemanticEditPolicy.java192
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UMLBaseItemSemanticEditPolicy.java564
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UMLTextNonResizableEditPolicy.java224
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UMLTextSelectionEditPolicy.java208
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UsageItemSemanticEditPolicy.java190
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/expressions/UMLAbstractExpression.java151
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/expressions/UMLOCLFactory.java158
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/parsers/AbstractParser.java418
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/parsers/MessageFormatParser.java192
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/DeleteElementAction.java2
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/DiagramEditorContextMenuProvider.java49
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/LoadResourceAction.java30
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/Messages.java473
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/ModelElementSelectionPage.java140
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLCreationWizard.java154
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLCreationWizardPage.java83
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramActionBarContributor.java38
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramEditor.java493
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramEditorPlugin.java319
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramEditorUtil.java376
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramUpdateCommand.java78
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramUpdater.java2323
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDocumentProvider.java974
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLInitDiagramFileAction.java86
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLLinkDescriptor.java92
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLMatchingStrategy.java34
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLNewDiagramFileWizard.java161
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLNodeDescriptor.java42
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLPaletteFactory.java348
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLVisualIDRegistry.java703
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/AbstractionPreferencePage.java36
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/CommentPreferencePage.java55
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ComponentPreferencePage.java72
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ComponentRealizationPreferencePage.java36
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ConstraintPreferencePage.java55
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DependencyPreferencePage.java36
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramAppearancePreferencePage.java18
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramConnectionsPreferencePage.java18
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramGeneralPreferencePage.java20
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramPreferenceInitializer.java77
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramPrintingPreferencePage.java18
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramRulersAndGridPreferencePage.java18
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/GeneralizationPreferencePage.java36
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/InterfacePreferencePage.java55
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/InterfaceRealizationPreferencePage.java36
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ManifestationPreferencePage.java36
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/PackagePreferencePage.java72
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/PortPreferencePage.java55
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/SubstitutionPreferencePage.java36
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/UsagePreferencePage.java36
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/ElementInitializers.java351
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLEditPartProvider.java141
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLElementTypes.java452
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLIconProvider.java31
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLModelingAssistantProvider.java372
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLParserProvider.java590
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLViewProvider.java1206
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/sheet/UMLPropertySection.java116
-rw-r--r--incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/sheet/UMLSheetLabelProvider.java79
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/.classpath8
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/.options7
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/.project28
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/META-INF/MANIFEST.MF56
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/about.html28
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/build.properties15
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/CreateDeploymentDiagramCommand.java72
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/DeploymentDiagramEditorFactory.java35
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/UmlDeploymentDiagramForMultiEditor.java151
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/actions/ShowHideRelatedContentsAction.java95
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/actions/ShowHideRelatedContentsHandler.java35
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/command/CreateViewCommand.java32
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/helpers/DeploymentLinkMappingHelper.java79
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/policies/CustomDiagramDragDropEditPolicy.java425
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/policies/RemoveOrphanViewPolicy.java47
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/ArtifactFigure.java74
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/DeviceFigure.java45
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/ExecutionEnvironmentFigure.java44
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/NodeFigure.java73
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/messages/Messages.java52
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/messages/messages.properties21
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/providers/ActionStateSourceProvider.java91
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/providers/CustomEditPolicyProvider.java80
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/preferences/CommentAnnotatedElementPreferencePage.java60
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/preferences/ConstraintConstrainedElementPreferencePage.java60
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/incomingLinksNavigatorGroup.gifbin709 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/linkSourceNavigatorGroup.gifbin709 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/linkTargetNavigatorGroup.gifbin709 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/linksNavigatorGroup.gifbin709 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Artifact.gifbin371 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/ArtifactIcon.gifbin874 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Comment.gifbin324 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Constraint.gifbin101 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Dependency.gifbin131 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Deployment.gifbin330 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/DeploymentDiagram.gifbin603 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Device.gifbin349 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/ExecutionEnvironment.gifbin351 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Generalization.gifbin1022 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Link.gifbin944 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Manifestation.gifbin95 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Node.gifbin144 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/UMLDiagramFile.gifbin339 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/outgoingLinksNavigatorGroup.gifbin709 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/icons/wizban/NewUMLWizard.gifbin2466 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/messages.properties314
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/model/DeploymentDiagram.gmfgen1783
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/plugin.properties1140
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/plugin.xml949
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ArtifactCreateCommand.java127
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ArtifactCreateCommandACN.java124
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ArtifactCreateCommandCN.java125
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/CommentAnnotatedElementCreateCommand.java96
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/CommentAnnotatedElementReorientCommand.java148
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/CommentCreateCommand.java128
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ConstraintConstrainedElementCreateCommand.java96
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ConstraintConstrainedElementReorientCommand.java148
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ConstraintCreateCommand.java128
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DependencyCreateCommand.java157
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DependencyReorientCommand.java165
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeploymentCreateCommand.java157
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeploymentReorientCommand.java165
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeviceCreateCommand.java127
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeviceCreateCommandCN.java125
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ExecutionEnvironmentCreateCommand.java127
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ExecutionEnvironmentCreateCommandCN.java125
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/GeneralizationCreateCommand.java154
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/GeneralizationReorientCommand.java156
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ManifestationCreateCommand.java157
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ManifestationReorientCommand.java165
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/NodeCreateCommand.java127
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/NodeCreateCommandCN.java124
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ArtifactEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/CommentEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ConstraintEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/DependencyEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/DeploymentEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/DeviceEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ExecutionEnvironmentEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/GeneralizationEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ManifestationEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ModelEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/NodeEditHelper.java9
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/UMLBaseEditHelper.java86
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPart.java127
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartACN.java127
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartCN.java127
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactEditPart.java592
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactEditPartACN.java592
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactEditPartCN.java592
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactNameEditPart.java767
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactNameEditPartACN.java767
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactNameEditPartCN.java767
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/CommentAnnotatedElementEditPart.java88
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/CommentBodyEditPart.java768
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/CommentEditPart.java413
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintConstrainedElementEditPart.java88
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintEditPart.java582
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintNameEditPart.java767
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintSpecificationEditPart.java768
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DependencyAppliedStereotypeEditPart.java723
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DependencyEditPart.java112
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DependencyNameEditPart.java723
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentAppliedStereotypeEditPart.java723
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentDiagramEditPart.java199
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentEditPart.java113
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentNameEditPart.java723
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPart.java125
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPartCN.java127
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceEditPart.java585
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceEditPartCN.java589
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceNameEditPart.java767
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceNameEditPartCN.java767
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPart.java125
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPartCN.java127
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentEditPart.java585
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentEditPartCN.java589
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentNameEditPart.java767
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentNameEditPartCN.java767
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/GeneralizationAppliedStereotypeEditPart.java715
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/GeneralizationEditPart.java105
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/LinkDescriptorEditPart.java90
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ManifestationAppliedStereotypeEditPart.java723
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ManifestationEditPart.java113
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ManifestationNameEditPart.java723
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeCompositeCompartmentEditPart.java125
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeCompositeCompartmentEditPartCN.java127
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeEditPart.java584
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeEditPartCN.java588
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeNameEditPart.java767
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeNameEditPartCN.java767
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/UMLEditPartFactory.java334
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentCanonicalEditPolicy.java146
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentCanonicalEditPolicyACN.java146
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentCanonicalEditPolicyCN.java146
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentItemSemanticEditPolicy.java31
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentItemSemanticEditPolicyACN.java31
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentItemSemanticEditPolicyCN.java31
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactItemSemanticEditPolicy.java163
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactItemSemanticEditPolicyACN.java246
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactItemSemanticEditPolicyCN.java246
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java27
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/CommentItemSemanticEditPolicy.java104
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ConstraintConstrainedElementItemSemanticEditPolicy.java27
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ConstraintItemSemanticEditPolicy.java154
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DependencyItemSemanticEditPolicy.java156
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeploymentDiagramItemSemanticEditPolicy.java87
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeploymentItemSemanticEditPolicy.java156
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentCanonicalEditPolicy.java146
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentCanonicalEditPolicyCN.java146
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentItemSemanticEditPolicy.java31
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentItemSemanticEditPolicyCN.java31
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceItemSemanticEditPolicy.java163
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceItemSemanticEditPolicyCN.java246
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentCanonicalEditPolicy.java160
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentCanonicalEditPolicyCN.java160
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicy.java35
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicyCN.java35
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentItemSemanticEditPolicy.java163
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentItemSemanticEditPolicyCN.java287
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/GeneralizationItemSemanticEditPolicy.java102
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ManifestationItemSemanticEditPolicy.java156
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ModelCanonicalEditPolicy.java461
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentCanonicalEditPolicy.java169
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentCanonicalEditPolicyCN.java169
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentItemSemanticEditPolicy.java43
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentItemSemanticEditPolicyCN.java43
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeItemSemanticEditPolicy.java163
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeItemSemanticEditPolicyCN.java369
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/UMLBaseItemSemanticEditPolicy.java451
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/UMLTextNonResizableEditPolicy.java224
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/UMLTextSelectionEditPolicy.java208
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/expressions/UMLAbstractExpression.java151
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/expressions/UMLOCLFactory.java150
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/parsers/AbstractParser.java418
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/parsers/MessageFormatParser.java192
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/DeleteElementAction.java2
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/DiagramEditorContextMenuProvider.java49
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/LoadResourceAction.java30
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/Messages.java458
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/ModelElementSelectionPage.java140
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLCreationWizard.java154
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLCreationWizardPage.java83
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramActionBarContributor.java38
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramEditor.java493
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramEditorPlugin.java319
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramEditorUtil.java376
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramUpdateCommand.java78
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramUpdater.java1642
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDocumentProvider.java974
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLInitDiagramFileAction.java86
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLLinkDescriptor.java92
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLMatchingStrategy.java34
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLNewDiagramFileWizard.java161
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLNodeDescriptor.java42
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLPaletteFactory.java272
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLVisualIDRegistry.java723
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ArtifactPreferencePage.java72
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/CommentPreferencePage.java55
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ConstraintPreferencePage.java55
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DependencyPreferencePage.java36
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DeploymentPreferencePage.java36
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DevicePreferencePage.java72
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramAppearancePreferencePage.java18
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramConnectionsPreferencePage.java18
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramGeneralPreferencePage.java20
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramPreferenceInitializer.java65
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramPrintingPreferencePage.java18
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramRulersAndGridPreferencePage.java18
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ExecutionEnvironmentPreferencePage.java72
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/GeneralizationPreferencePage.java36
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ManifestationPreferencePage.java36
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/NodePreferencePage.java72
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/ElementInitializers.java325
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLEditPartProvider.java141
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLElementTypes.java404
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLIconProvider.java31
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLModelingAssistantProvider.java393
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLParserProvider.java474
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLViewProvider.java991
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/sheet/UMLPropertySection.java116
-rw-r--r--incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/sheet/UMLSheetLabelProvider.java79
482 files changed, 0 insertions, 110161 deletions
diff --git a/incoming/org.eclipse.papyrus.diagram.component/.classpath b/incoming/org.eclipse.papyrus.diagram.component/.classpath
deleted file mode 100644
index b2164fd1b7f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="custom-src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/incoming/org.eclipse.papyrus.diagram.component/.project b/incoming/org.eclipse.papyrus.diagram.component/.project
deleted file mode 100644
index d4e3b51bcd8..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.diagram.component</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/incoming/org.eclipse.papyrus.diagram.component/META-INF/MANIFEST.MF b/incoming/org.eclipse.papyrus.diagram.component/META-INF/MANIFEST.MF
deleted file mode 100644
index f5b1ea69cd3..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,58 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.papyrus.diagram.component; singleton:=true
-Bundle-Version: 0.8.0.qualifier
-Bundle-Vendor: %providerName
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.eclipse.core.expressions,
- org.eclipse.jface,
- org.eclipse.ui.ide,
- org.eclipse.ui.views,
- org.eclipse.ui.navigator,
- org.eclipse.ui.navigator.resources,
- org.eclipse.emf.ecore,
- org.eclipse.emf.ecore.xmi,
- org.eclipse.emf.edit.ui,
- org.eclipse.gmf.runtime.emf.core,
- org.eclipse.gmf.runtime.emf.commands.core,
- org.eclipse.gmf.runtime.emf.ui.properties,
- org.eclipse.gmf.runtime.diagram.ui,
- org.eclipse.gmf.runtime.diagram.ui.properties,
- org.eclipse.gmf.runtime.diagram.ui.providers,
- org.eclipse.gmf.runtime.diagram.ui.providers.ide,
- org.eclipse.gmf.runtime.diagram.ui.render,
- org.eclipse.gmf.runtime.diagram.ui.resources.editor,
- org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide,
- org.eclipse.draw2d;visibility:=reexport,
- org.eclipse.gmf.runtime.draw2d.ui;visibility:=reexport,
- org.eclipse.uml2.uml;visibility:=reexport,
- org.eclipse.uml2.uml.edit;visibility:=reexport,
- org.eclipse.emf.ecore;visibility:=reexport,
- org.eclipse.emf.ecore.edit;visibility:=reexport,
- org.eclipse.ocl.ecore;visibility:=reexport,
- org.eclipse.gef;visibility:=reexport,
- org.eclipse.papyrus.diagram.common,
- org.eclipse.papyrus.preferences,
- org.eclipse.papyrus.extensionpoints.editors,
- org.eclipse.papyrus.editor,
- org.eclipse.papyrus.service.edit,
- org.eclipse.papyrus.widgets
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Activator: org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin
-Bundle-Localization: plugin
-Export-Package: org.eclipse.papyrus.diagram.component.edit.parts,
- org.eclipse.papyrus.diagram.component.part,
- org.eclipse.papyrus.diagram.component.providers
-Import-Package: org.eclipse.papyrus.core.adaptor.gmf,
- org.eclipse.papyrus.diagram.common.figure.node,
- org.eclipse.papyrus.diagram.component.part,
- org.eclipse.papyrus.editor,
- org.eclipse.papyrus.service.edit.service,
- org.eclipse.papyrus.uml.service.types.element,
- org.eclipse.papyrus.widgets.editors
-Eclipse-LazyStart: true
diff --git a/incoming/org.eclipse.papyrus.diagram.component/about.html b/incoming/org.eclipse.papyrus.diagram.component/about.html
deleted file mode 100644
index 82d49bf5f81..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
diff --git a/incoming/org.eclipse.papyrus.diagram.component/build.properties b/incoming/org.eclipse.papyrus.diagram.component/build.properties
deleted file mode 100644
index cf473991117..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-bin.includes = .,\
- icons/,\
- META-INF/,\
- plugin.xml,\
- plugin.properties,\
- messages.properties,\
- about.html
-jars.compile.order = .
-source.. = src/,\
- custom-src/
-output.. = bin/
-src.includes = about.html,\
- model/,\
- icons/,\
- messages.properties
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/ComponentDiagramEditorFactory.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/ComponentDiagramEditorFactory.java
deleted file mode 100644
index ce81095816b..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/ComponentDiagramEditorFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component;
-
-import org.eclipse.papyrus.core.adaptor.gmf.GmfEditorFactory;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-
-
-
-
-
-// TODO: Auto-generated Javadoc
-/**
- * A factory for creating ComponentDiagramEditor objects.
- */
-public class ComponentDiagramEditorFactory extends GmfEditorFactory {
-
-
- /**
- * Instantiates a new component diagram editor factory.
- */
- public ComponentDiagramEditorFactory() {
- super(UmlComponentDiagramForMultiEditor.class, ComponentDiagramEditPart.MODEL_ID);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/CreateComponentDiagramCommand.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/CreateComponentDiagramCommand.java
deleted file mode 100644
index c4de1da28a6..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/CreateComponentDiagramCommand.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component;
-
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.papyrus.core.adaptor.gmf.AbstractPapyrusGmfCreateDiagramCommandHandler;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class CreateComponentDiagramCommand.
- */
-public class CreateComponentDiagramCommand extends AbstractPapyrusGmfCreateDiagramCommandHandler {
-
- /**
- * Gets the default diagram name.
- *
- * @return the default diagram name
- * @see org.eclipse.papyrus.core.adaptor.gmf.AbstractPapyrusGmfCreateDiagramCommandHandler#getDefaultDiagramName()
- */
-
- @Override
- protected String getDefaultDiagramName() {
- return "NewComponentDiagram";
- }
-
-
- /**
- * Gets the diagram notation id.
- *
- * @return the diagram notation id
- * @see org.eclipse.papyrus.core.adaptor.gmf.AbstractPapyrusGmfCreateDiagramCommandHandler#getDiagramNotationID()
- */
-
- @Override
- protected String getDiagramNotationID() {
- return ComponentDiagramEditPart.MODEL_ID;
- }
-
- /**
- * Gets the preference hint.
- *
- * @return the preference hint
- * @see org.eclipse.papyrus.core.adaptor.gmf.AbstractPapyrusGmfCreateDiagramCommandHandler#getPreferenceHint()
- */
-
- @Override
- protected PreferencesHint getPreferenceHint() {
- return org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/UmlComponentDiagramForMultiEditor.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/UmlComponentDiagramForMultiEditor.java
deleted file mode 100644
index 196d388c594..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/UmlComponentDiagramForMultiEditor.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.core.editor.BackboneException;
-import org.eclipse.papyrus.core.services.ServiceException;
-import org.eclipse.papyrus.core.services.ServicesRegistry;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditor;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PartInitException;
-
-
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class UmlComponentDiagramForMultiEditor.
- */
-public class UmlComponentDiagramForMultiEditor extends UMLDiagramEditor {
-
- /** The location of diagram icon in the plug-in. */
- private static final String DIAG_IMG_PATH = "icons/obj16/ComponentDiagram.gif";
-
- /** The image descriptor of the diagram icon. */
- private static final ImageDescriptor DIAG_IMG_DESC = UMLDiagramEditorPlugin.getBundledImageDescriptor(UmlComponentDiagramForMultiEditor.DIAG_IMG_PATH);
-
- /** The editor splitter. */
- private Composite splitter;
-
- /**
- * Constructor for SashSystem v2. Context and required objects are retrieved from the
- * ServiceRegistry.
- *
- * @param servicesRegistry
- * the services registry
- * @param diagram
- * the diagram
- * @throws BackboneException
- * the backbone exception
- * @throws ServiceException
- * the service exception
- */
- public UmlComponentDiagramForMultiEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws BackboneException, ServiceException {
- super(servicesRegistry, diagram);
- }
-
-
- /**
- * Inits the.
- *
- * @param site
- * the site
- * @param input
- * the input
- * @throws PartInitException
- * the part init exception
- * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor#init(org.eclipse.ui.IEditorSite,
- * org.eclipse.ui.IEditorInput)
- */
-
- @Override
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- super.init(site, input);
- setPartName(getDiagram().getName());
- setTitleImage(DIAG_IMG_DESC.createImage());
- }
-
-
- /**
- * Sets the input.
- *
- * @param input
- * the new input
- * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor#setInput(org.eclipse.ui.IEditorInput)
- */
-
- @Override
- public void setInput(IEditorInput input) {
- try {
- // Provide an URI with fragment in order to reuse the same Resource
- // and set the diagram to the fragment.
- URIEditorInput uriInput = new URIEditorInput(EcoreUtil.getURI(getDiagram()));
- doSetInput(uriInput, true);
- } catch (CoreException x) {
- String title = "Problem opening";
- String msg = "Cannot open input element:";
- Shell shell = getSite().getShell();
- ErrorDialog.openError(shell, title, msg, x.getStatus());
- }
- }
-
-
- /**
- * Creates the graphical viewer.
- *
- * @param parent
- * the parent
- * @see org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor#createGraphicalViewer(org.eclipse.swt.widgets.Composite)
- */
-
- @Override
- protected void createGraphicalViewer(Composite parent) {
- splitter = parent;
- super.createGraphicalViewer(parent);
- }
-
-
- /**
- * Sets the focus.
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette#setFocus()
- */
-
- @Override
- public void setFocus() {
- splitter.setFocus();
- super.setFocus();
- }
-
- /**
- * Gets the editing domain id.
- *
- * @return the editing domain id
- * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor#getEditingDomainID()
- */
-
- @Override
- public String getEditingDomainID() {
- return "org.eclipse.papyrus.diagram.component.EditingDomain";
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/actions/ManageProvidedInterfacesHandler.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/actions/ManageProvidedInterfacesHandler.java
deleted file mode 100644
index 4ce15784852..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/actions/ManageProvidedInterfacesHandler.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.actions;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.ui.util.DisplayUtils;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.papyrus.diagram.common.handlers.GraphicalCommandHandler;
-import org.eclipse.papyrus.diagram.component.custom.messages.Messages;
-import org.eclipse.papyrus.diagram.component.custom.ui.InterfaceManagerDialog;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Type;
-
-/**
- * This handler provides the action to manage the provided and required {@link Interface} for a {@link Port}
- *
- *
- *
- */
-public class ManageProvidedInterfacesHandler extends GraphicalCommandHandler {
-
- /**
- *
- * @see org.eclipse.papyrus.diagram.common.handlers.GraphicalCommandHandler#getCommand()
- *
- * @return
- * @throws ExecutionException
- */
- @Override
- protected Command getCommand() throws ExecutionException {
- List<IGraphicalEditPart> selection = getSelectedElements();
- if(selection.size() != 1) {
- return UnexecutableCommand.INSTANCE;
- }
- if(!(selection.get(0) instanceof PortEditPart)) {
- return UnexecutableCommand.INSTANCE;
- }
- ManageProvidedInterfaceAction action = new ManageProvidedInterfaceAction(selection.get(0));
- return action.getCommand();
- }
-
- /**
- *
- * This class provides the action to manage the provided and required interfaces
- *
- *
- */
- public class ManageProvidedInterfaceAction {
-
- /** the {@link Port} */
- private Port port;
-
- /** the {@link Type} of the port */
- private Type type;
-
- /**
- *
- * Constructor.
- *
- * @param editpart
- * the editpart of the port
- */
- public ManageProvidedInterfaceAction(IGraphicalEditPart editpart) {
- Object obj = ((View)editpart.getModel()).getElement();
- Assert.isTrue(obj instanceof Port);
- this.port = (Port)obj;
- this.type = port.getType();
- }
-
- /**
- * Returns the command to add/remove provided/required interfaces
- *
- * @return
- * the command to add/remove provided/required interfaces
- */
- public Command getCommand() {
- if(type != null && !(type instanceof Classifier)) {
- return UnexecutableCommand.INSTANCE;
- } else if(type == null) {
- MessageDialog dialog = new MessageDialog(DisplayUtils.getDefaultShell(), Messages.InterfaceManagerDialog_Title, null, Messages.ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined, MessageDialog.WARNING, new String[]{ Messages.ManageProvidedInterfacesHandler_OK }, 0);
- dialog.open();
- } else {
- InterfaceManagerDialog dialog = new InterfaceManagerDialog(DisplayUtils.getDefaultShell(), this.port);
- if(dialog.open() == Dialog.OK) {
- return dialog.getCommand();
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
- }
-
- /**
- *
- * @see org.eclipse.papyrus.diagram.common.handlers.GraphicalCommandHandler#isEnabled()
- *
- * @return
- */
- @Override
- public boolean isEnabled() {
- if(getSelectedElements().size() == 1) {
- Object obj = ((View)getSelectedElements().get(0).getModel()).getElement();
- return obj instanceof Port;
- }
- return false;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/actions/ShowHideRelatedContentsAction.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/actions/ShowHideRelatedContentsAction.java
deleted file mode 100644
index d07c6226b60..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/actions/ShowHideRelatedContentsAction.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.actions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.actions.AbstractShowHideAction;
-import org.eclipse.papyrus.diagram.common.actions.ShowHideContentsAction;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideRelatedContentsEditPolicy;
-import org.eclipse.papyrus.diagram.common.providers.EditorLabelProvider;
-import org.eclipse.papyrus.diagram.component.custom.messages.Messages;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Type;
-
-public class ShowHideRelatedContentsAction extends ShowHideContentsAction {
-
- /**
- *
- * Constructor.
- *
- */
- public ShowHideRelatedContentsAction() {
- super(Messages.ShowHideRelatedContentsAction_Title, Messages.ShowHideRelatedContentsAction_Message, ShowHideRelatedContentsEditPolicy.SHOW_HIDE_RELATED_CONTENTS_POLICY);
- }
-
- /**
- *
- * @see org.eclipse.papyrus.diagram.common.actions.AbstractShowHideAction#initAction()
- *
- */
- @Override
- protected void initAction() {
- super.initAction();
- setEditorLabelProvider(new EditorLabelProvider());
- this.representations = new ArrayList<AbstractShowHideAction.EditPartRepresentation>();
-
- for(EditPart current : this.selectedElements) {
- //the selected elements which aren't Classifier are ignored
- EObject element = ((View)current.getModel()).getElement();
- if(element instanceof Property) {
- Type type = ((Property)element).getType();
- if(type instanceof Classifier) {
- this.representations.add(new CustomEditPartRepresentation(current, (Classifier)type));
- }
- }
- }
- this.setEditorLabelProvider(new CustomEditorLabelProvider());
- this.setContentProvider(new CustomContentProvider());
-
- }
-
- protected class CustomContentProvider extends ShowHideContentsAction.ContentProvider {
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public Object getParent(Object element) {
- if(!(element instanceof EditPartRepresentation)) {
- EditPartRepresentation rep = findEditPartRepresentation(element);
- if(rep != null) {
- //element can be owned by the class (rep), or by a superclass (ClassifierRepresentation)
- List<ClassifierRepresentation> classes = ((CustomEditPartRepresentation)rep).getSuperClasses();
- for(ClassifierRepresentation classifierRepresentation : classes) {
- if(classifierRepresentation.getRepresentedClassifier().getOwnedMembers().contains(element)) {
- return classifierRepresentation;
- }
- }
- }
- return rep;
- }
- return null;
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/actions/ShowHideRelatedContentsHandler.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/actions/ShowHideRelatedContentsHandler.java
deleted file mode 100644
index dca7384b78f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/actions/ShowHideRelatedContentsHandler.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.actions;
-
-import org.eclipse.papyrus.diagram.common.actions.handlers.AbstractShowHideHandler;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideRelatedContentsEditPolicy;
-
-
-/**
- *
- * Handler for the {@link ShowHideRelatedContentsAction}
- *
- */
-public class ShowHideRelatedContentsHandler extends AbstractShowHideHandler {
-
- /**
- *
- * Constructor.
- *
- */
- public ShowHideRelatedContentsHandler() {
- super(new ShowHideRelatedContentsAction(), ShowHideRelatedContentsEditPolicy.SHOW_HIDE_RELATED_CONTENTS_POLICY);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/command/CreateViewCommand.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/command/CreateViewCommand.java
deleted file mode 100644
index 5ec5b620e49..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/command/CreateViewCommand.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.diagram.component.custom.edit.command;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.notation.View;
-
-public class CreateViewCommand extends CreateCommand {
-
- @Override
- public boolean canExecute() {
- return true;
- }
-
- public CreateViewCommand(TransactionalEditingDomain editingDomain, ViewDescriptor viewDescriptor, View containerView) {
- super(editingDomain, viewDescriptor, containerView);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/helpers/ComponentLinkMappingHelper.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/helpers/ComponentLinkMappingHelper.java
deleted file mode 100644
index 4dfc8d52d68..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/helpers/ComponentLinkMappingHelper.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.edit.helpers;
-
-import java.util.Collection;
-
-import org.eclipse.papyrus.diagram.common.helper.ILinkMappingHelper;
-import org.eclipse.papyrus.diagram.common.helper.LinkMappingHelper;
-import org.eclipse.papyrus.diagram.common.helper.LinkMappingHelper.CommonSourceUMLSwitch;
-import org.eclipse.papyrus.diagram.common.helper.LinkMappingHelper.CommonTargetUMLSwitch;
-import org.eclipse.uml2.uml.Element;
-
-// TODO: Auto-generated Javadoc
-/**
- * This helper is used to retrieve Link ends for use in drag and drop behavior.
- */
-public class ComponentLinkMappingHelper implements ILinkMappingHelper {
-
- /**
- * Singleton management.
- */
- private static class SingletonHolder {
-
- /** Singleton instance. */
- private final static ComponentLinkMappingHelper instance = new ComponentLinkMappingHelper();
- }
-
- /**
- * Get singleton instance.
- *
- * @return the instance
- */
- public static ComponentLinkMappingHelper getInstance() {
- return SingletonHolder.instance;
- }
-
- /**
- * private constructor.
- */
- private ComponentLinkMappingHelper() {
- // do nothing
- }
-
- /**
- * Gets the source.
- *
- * @param link the link
- * @return the source
- * {@inheritDoc}
- */
- public Collection<?> getSource(Element link) {
- return LinkMappingHelper.getSource(link, new CommonSourceUMLSwitch() {
-
- @Override
- public java.util.Collection<?> caseDependency(org.eclipse.uml2.uml.Dependency object) {
- return object.getSources();
- };
-
- @Override
- public java.util.Collection<?> caseConnector(org.eclipse.uml2.uml.Connector object) {
- return object.getEnds();
- };
- });
- }
-
- /**
- * Gets the target.
- *
- * @param link the link
- * @return the target
- * {@inheritDoc}
- */
- public Collection<?> getTarget(Element link) {
- return LinkMappingHelper.getTarget(link, new CommonTargetUMLSwitch() {
-
- @Override
- public java.util.Collection<?> caseDependency(org.eclipse.uml2.uml.Dependency object) {
- return object.getTargets();
- };
-
- @Override
- public java.util.Collection<?> caseConnector(org.eclipse.uml2.uml.Connector object) {
- return object.getEnds();
- };
- });
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/AbstractCustomLabelEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/AbstractCustomLabelEditPolicy.java
deleted file mode 100644
index 5daf1f130d2..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/AbstractCustomLabelEditPolicy.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *****************************************************************************/
-
-package org.eclipse.papyrus.diagram.component.custom.edit.policies;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.core.listenerservice.IPapyrusListener;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * Edit policy for specific Label
- */
-public abstract class AbstractCustomLabelEditPolicy extends GraphicalEditPolicy implements IPapyrusListener, NotificationListener {
-
- /** constant for this edit policy role */
- public final static String SPECIFIC_NAME_LABEL_POLICY = "SpecificNameLabelEditPolicy"; //$NON-NLS-1$
-
- /**
- * Creates a new Specific Name display edit policy
- */
- public AbstractCustomLabelEditPolicy() {
- super();
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void activate() {
- // retrieve the view and the element managed by the edit part
- View view = getView();
- if(view == null) {
- return;
- }
- Element element = getUMLElement();
- if(getUMLElement() != null) {
- // adds a listener on the view and the element controlled by the editpart
- getDiagramEventBroker().addNotificationListener(view, this);
- getDiagramEventBroker().addNotificationListener(element, this);
-
- addAdditionalListeners();
-
- refreshDisplay();
- }
- }
-
- /**
- * Adds more listeners upon activation
- */
- protected void addAdditionalListeners() {
- // default implementation does nothing
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void deactivate() {
- // retrieve the view and the element managed by the edit part
- View view = getView();
- if(view == null) {
- return;
- }
- Element element = (Element)getUMLElement();
-
- // remove notification on element and view
- getDiagramEventBroker().removeNotificationListener(view, this);
-
- if(element == null) {
- return;
- }
- getDiagramEventBroker().removeNotificationListener(element, this);
-
- removeAdditionalListeners();
-
- }
-
- /**
- * Remove the others listeners
- *
- */
- protected void removeAdditionalListeners() {
- // default implementation does nothing
- }
-
- /**
- * Gets the diagram event broker from the editing domain.
- *
- * @return the diagram event broker
- */
- protected DiagramEventBroker getDiagramEventBroker() {
- TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(theEditingDomain != null) {
- return DiagramEventBroker.getInstance(theEditingDomain);
- }
- return null;
- }
-
- /**
- * Returns the uml element controlled by the host edit part
- *
- * @return the uml element controlled by the host edit part
- */
- protected Element getUMLElement() {
- return (Element)getView().getElement();
- }
-
- /**
- * Returns the view controlled by the host edit part
- *
- * @return the view controlled by the host edit part
- */
- protected View getView() {
- return (View)getHost().getModel();
- }
-
- /**
- * Refreshes the display for the element controlled by the edit part with this edit policies
- */
- public abstract void refreshDisplay();
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/CustomDiagramDragDropEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/CustomDiagramDragDropEditPolicy.java
deleted file mode 100644
index ccd9d2cf6df..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/CustomDiagramDragDropEditPolicy.java
+++ /dev/null
@@ -1,614 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.edit.policies;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.OldCommonDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.component.custom.edit.command.CreateViewCommand;
-import org.eclipse.papyrus.diagram.component.custom.edit.helpers.ComponentLinkMappingHelper;
-import org.eclipse.papyrus.diagram.component.custom.locators.PortPositionLocator;
-import org.eclipse.papyrus.diagram.component.custom.log.Log;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.PackageEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.uml2.uml.Behavior;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Collaboration;
-import org.eclipse.uml2.uml.CollaborationUse;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.EncapsulatedClassifier;
-import org.eclipse.uml2.uml.Parameter;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.StructuredClassifier;
-import org.eclipse.uml2.uml.Type;
-import org.eclipse.uml2.uml.TypedElement;
-
-// TODO: Auto-generated Javadoc
-/**
- * This class provides an implementation for specific behavior of Drag and Drop
- * in the Composite Diagram.
- */
-public class CustomDiagramDragDropEditPolicy extends OldCommonDiagramDragDropEditPolicy {
-
- /**
- * Default constructor.
- */
- public CustomDiagramDragDropEditPolicy() {
- super(ComponentLinkMappingHelper.getInstance());
- }
-
- /**
- * Gets the droppable element visual id.
- *
- * @return the droppable element visual id
- * {@inheritDoc}
- */
- @Override
- protected Set<Integer> getDroppableElementVisualId() {
- // TopLevelNodes
- Set<Integer> droppableElementsVisualId = new HashSet<Integer>();
- droppableElementsVisualId.add(PackageEditPart.VISUAL_ID);
- droppableElementsVisualId.add(ComponentEditPart.VISUAL_ID);
- droppableElementsVisualId.add(InterfaceEditPart.VISUAL_ID);
- droppableElementsVisualId.add(CommentEditPart.VISUAL_ID);
- droppableElementsVisualId.add(ConstraintEditPart.VISUAL_ID);
- droppableElementsVisualId.add(PortEditPart.VISUAL_ID);
-
- // Class CN
- droppableElementsVisualId.add(ComponentEditPartCN.VISUAL_ID);
- droppableElementsVisualId.add(ComponentEditPartPCN.VISUAL_ID);
- droppableElementsVisualId.add(InterfaceEditPartPCN.VISUAL_ID);
- droppableElementsVisualId.add(CommentEditPartPCN.VISUAL_ID);
- droppableElementsVisualId.add(ConstraintEditPartPCN.VISUAL_ID);
-
- return droppableElementsVisualId;
- }
-
- /**
- * Gets the uML element type.
- *
- * @param elementID the element id
- * @return the uML element type
- * {@inheritDoc}
- */
- @Override
- public IElementType getUMLElementType(int elementID) {
- return UMLElementTypes.getElementType(elementID);
- }
-
- /**
- * Gets the node visual id.
- *
- * @param containerView the container view
- * @param domainElement the domain element
- * @return the node visual id
- * {@inheritDoc}
- */
- @Override
- public int getNodeVisualID(View containerView, EObject domainElement) {
- return UMLVisualIDRegistry.getNodeVisualID(containerView, domainElement);
- }
-
- /**
- * Gets the link with class visual id.
- *
- * @param domainElement the domain element
- * @return the link with class visual id
- * {@inheritDoc}
- */
- @Override
- public int getLinkWithClassVisualID(EObject domainElement) {
- return UMLVisualIDRegistry.getLinkWithClassVisualID(domainElement);
- }
-
- /**
- * Gets the specific drop command.
- *
- * @param dropRequest the drop request
- * @param semanticElement the semantic element
- * @param nodeVISUALID the node visualid
- * @param linkVISUALID the link visualid
- * @return the specific drop command
- * {@inheritDoc}
- */
- @Override
- protected Command getSpecificDropCommand(DropObjectsRequest dropRequest, Element semanticElement, int nodeVISUALID, int linkVISUALID) {
-
- // Switch test over linkVisualID
- switch(linkVISUALID) {
- case DependencyEditPart.VISUAL_ID:
- return dropDependency(dropRequest, semanticElement, linkVISUALID);
- default:
- // Switch test over nodeVISUALID
- switch(nodeVISUALID) {
- // Test TopLevelNode... Start
- case PackageEditPart.VISUAL_ID:
- case ComponentEditPart.VISUAL_ID:
- case InterfaceEditPart.VISUAL_ID:
-
- return dropTopLevelNode(dropRequest, semanticElement, nodeVISUALID, linkVISUALID);
- // Test TopLevelNode... End
- case PortEditPart.VISUAL_ID:
- return dropAffixedNode(dropRequest, semanticElement, nodeVISUALID);
- case CommentEditPart.VISUAL_ID:
- case CommentEditPartPCN.VISUAL_ID:
- return dropComment(dropRequest, semanticElement, nodeVISUALID);
-
- case ConstraintEditPart.VISUAL_ID:
- case ConstraintEditPartPCN.VISUAL_ID:
- return dropConstraint(dropRequest, semanticElement, nodeVISUALID);
- default:
- return super.getSpecificDropCommand(dropRequest, semanticElement, nodeVISUALID, linkVISUALID);
- }
- }
- }
-
- /**
- * Returns the command to drop the Comment + the link to attach it to its annotated elements.
- *
- * @param dropRequest the drop request
- * @param semanticLink the semantic link
- * @param nodeVISUALID the node visual id
- * @return the command
- */
- protected Command dropComment(DropObjectsRequest dropRequest, Element semanticLink, int nodeVISUALID) {
- GraphicalEditPart graphicalParentEditPart = (GraphicalEditPart)getHost();
- EObject graphicalParentObject = graphicalParentEditPart.resolveSemanticElement();
- // if(!(graphicalParentObject instanceof Package) && !(graphicalParentObject instanceof Class) && !(graphicalParentObject instanceof Property) && !(graphicalParentObject instanceof Interaction) && !(graphicalParentObject instanceof StateMachine) && !(graphicalParentObject instanceof Collaboration) && !(graphicalParentObject instanceof FunctionBehavior) && !(graphicalParentObject instanceof ProtocolStateMachine) && !(graphicalParentObject instanceof ExecutionEnvironment) && !(graphicalParentObject instanceof Device)) {
- // return UnexecutableCommand.INSTANCE;
- // }
- if(nodeVISUALID == CommentEditPart.VISUAL_ID) {
- return getDropCommentCommand((Comment)semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart)getHost()).getNotationView(), (IHintedType)UMLElementTypes.Comment_3201, (IHintedType)UMLElementTypes.CommentAnnotatedElement_4015);
- } else if(nodeVISUALID == CommentEditPartPCN.VISUAL_ID) {
- return getDropCommentCommand((Comment)semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart)getHost()).getNotationView(), (IHintedType)UMLElementTypes.Comment_3074, (IHintedType)UMLElementTypes.CommentAnnotatedElement_4015);
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Returns the command to drop the Constraint + the link to attach it to its contrainted elements.
- *
- * @param dropRequest the drop request
- * @param semanticLink the semantic link
- * @param nodeVISUALID the node visual id
- * @return the command
- */
- protected Command dropConstraint(DropObjectsRequest dropRequest, Element semanticLink, int nodeVISUALID) {
- GraphicalEditPart graphicalParentEditPart = (GraphicalEditPart)getHost();
- EObject graphicalParentObject = graphicalParentEditPart.resolveSemanticElement();
- // if(!(graphicalParentObject instanceof Package) && !(graphicalParentObject instanceof Class) && !(graphicalParentObject instanceof Interaction) && !(graphicalParentObject instanceof StateMachine) && !(graphicalParentObject instanceof Collaboration) && !(graphicalParentObject instanceof FunctionBehavior) && !(graphicalParentObject instanceof ProtocolStateMachine) && !(graphicalParentObject instanceof ExecutionEnvironment) && !(graphicalParentObject instanceof Device)) {
- // return UnexecutableCommand.INSTANCE;
- // }
-
- if(nodeVISUALID == ConstraintEditPart.VISUAL_ID) {
- return getDropConstraintCommand((Constraint)semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart)getHost()).getNotationView(), (IHintedType)UMLElementTypes.Constraint_3199, (IHintedType)UMLElementTypes.ConstraintConstrainedElement_4009);
- } else if(nodeVISUALID == ConstraintEditPartPCN.VISUAL_ID) {
- return getDropConstraintCommand((Constraint)semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart)getHost()).getNotationView(), (IHintedType)UMLElementTypes.Constraint_3075, (IHintedType)UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * Returns the drop command for Dependency links.
- *
- * @param dropRequest
- * the drop request
- * @param semanticLink
- * the element to drop
- * @param linkVISUALID
- * the visual identifier of the EditPart of the dropped element
- * @return the drop command
- */
- protected Command dropDependency(DropObjectsRequest dropRequest, Element semanticLink, int linkVISUALID) {
- Collection<?> sourceEnds = ComponentLinkMappingHelper.getInstance().getSource(semanticLink);
- Collection<?> targetEnds = ComponentLinkMappingHelper.getInstance().getTarget(semanticLink);
-
- // Dependency with Unary ends
- if((sourceEnds != null) && (targetEnds != null) && (sourceEnds.size() == 1) && (targetEnds.size() == 1)) {
-
- Element source = (Element)sourceEnds.toArray()[0];
- Element target = (Element)targetEnds.toArray()[0];
- return new ICommandProxy(dropBinaryLink(new CompositeCommand("drop Dependency"), source, target, //$NON-NLS-1$
- linkVISUALID, dropRequest.getLocation(), semanticLink));
- } else {
- return UnexecutableCommand.INSTANCE;
- }
- }
-
- /**
- * Returns the drop command for RoleBinding links.
- *
- * @param dropRequest
- * the drop request
- * @param semanticLink
- * the element to drop
- * @param linkVISUALID
- * the visual identifier of the EditPart of the dropped element
- * @return the drop command
- */
- protected Command dropRoleBinding(DropObjectsRequest dropRequest, Element semanticLink, int linkVISUALID) {
- Collection<?> sourceEnds = ComponentLinkMappingHelper.getInstance().getSource(semanticLink);
- Collection<?> targetEnds = ComponentLinkMappingHelper.getInstance().getTarget(semanticLink);
-
- // Dependency with Unary ends
- if((sourceEnds != null) && (targetEnds != null) && (sourceEnds.size() == 1) && (targetEnds.size() == 1)) {
-
- Element source = semanticLink.getOwner();
- Element target = (Element)targetEnds.toArray()[0];
- return new ICommandProxy(dropBinaryLink(new CompositeCommand("drop RoleBinding"), source, target, //$NON-NLS-1$
- linkVISUALID, dropRequest.getLocation(), semanticLink));
- } else {
- return UnexecutableCommand.INSTANCE;
- }
- }
-
-
- /**
- * Returns the drop command for Property nodes.
- *
- * @param dropRequest the drop request
- * @param droppedElement the element to drop
- * @param nodeVISUALID the visual identifier of the EditPart of the dropped element
- * @return the drop command
- */
- protected Command dropProperty(DropObjectsRequest dropRequest, Property droppedElement, int nodeVISUALID) {
-
- GraphicalEditPart graphicalParentEditPart = (GraphicalEditPart)getHost();
- EObject graphicalParentObject = graphicalParentEditPart.resolveSemanticElement();
-
- // Default drop location
- Point location = dropRequest.getLocation().getCopy();
-
- // Port inherits from Property this case should be excluded and treated
- // separately
- if(!(droppedElement instanceof Port)) {
-
- if((graphicalParentObject instanceof Classifier) && (((Classifier)graphicalParentObject).getAllAttributes().contains(droppedElement))) {
- // The graphical parent is the real owner of the dropped
- // property.
- // The dropped property may also be an inherited attribute of
- // the graphical parent.
- return new ICommandProxy(getDefaultDropNodeCommand(nodeVISUALID, location, droppedElement));
-
- } else if(graphicalParentObject instanceof ConnectableElement) {
- Type type = ((ConnectableElement)graphicalParentObject).getType();
- if((type != null) && (type instanceof Classifier) && (((Classifier)type).getAllAttributes().contains(droppedElement))) {
- // The graphical parent is a Property typed by a Classifier
- // that owns or inherits the
- // dropped property.
- return new ICommandProxy(getDefaultDropNodeCommand(nodeVISUALID, location, droppedElement));
- }
- }
- }
-
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * <pre>
- * Returns the drop command for Affixed nodes (Parameter, Port).
- * This method uses PortPositionLocator used by both Port and Parameter.
- * If the dropped element is a Port, the graphical parent can be :
- * - a Class that owns or inherits the Port
- * - a Property which type owns or inherits the Port
- * </pre>
- *
- * @param dropRequest the drop request
- * @param droppedElement the element to drop
- * @param nodeVISUALID the visual identifier of the EditPart of the dropped element
- * @return the drop command
- */
- protected Command dropAffixedNode(DropObjectsRequest dropRequest, Element droppedElement, int nodeVISUALID) {
-
- // The dropped element must be a Port or Parameter
- if(!((droppedElement instanceof Port) || (droppedElement instanceof Parameter))) {
- Log.getInstance().error(new Exception("Incorrect parameter type (droppedElement should be a Port or Parameter)"));
- return UnexecutableCommand.INSTANCE;
- }
-
- // Manage Element drop in compartment
- Boolean isCompartmentTarget = false; // True if the target is a
- // ShapeCompartmentEditPart
- GraphicalEditPart graphicalParentEditPart = (GraphicalEditPart)getHost();
-
- // Default drop location
- Point dropLocation = dropRequest.getLocation().getCopy();
-
- // Detect if the drop target is a compartment
- if(graphicalParentEditPart instanceof ShapeCompartmentEditPart) {
- isCompartmentTarget = true;
-
- // Replace compartment edit part by its parent EditPart
- graphicalParentEditPart = (GraphicalEditPart)graphicalParentEditPart.getParent();
-
- // Translate Port expected location according to the compartment
- // location
- Point targetLocation = graphicalParentEditPart.getContentPane().getBounds().getLocation();
- ShapeCompartmentFigure compartmentFigure = (ShapeCompartmentFigure)getHostFigure();
-
- // Retrieve ViewPort location = the area where compartment children
- // are located
- // Retrieve ViewPort view location = the relative location of the
- // viewed compartment
- // depending on the current scroll bar state
- Viewport compartmentViewPort = compartmentFigure.getScrollPane().getViewport();
- Point compartmentViewPortLocation = compartmentViewPort.getLocation();
- Point compartmentViewPortViewLocation = compartmentViewPort.getViewLocation();
-
- // Calculate the delta between the targeted element position for
- // drop (the Composite figure)
- // and the View location with eventual scroll bar.
- Point delta = compartmentViewPortLocation.translate(targetLocation.negate());
- delta = delta.translate(compartmentViewPortViewLocation.negate());
-
- // Translate the requested drop location (relative to parent)
- dropLocation = dropRequest.getLocation().getTranslated(delta);
- }
- // Manage Element drop in compartment
-
- // Create proposed creation bounds and use the locator to find the
- // expected position
- Point parentLoc = graphicalParentEditPart.getFigure().getBounds().getLocation().getCopy();
- PortPositionLocator locator = new PortPositionLocator(graphicalParentEditPart.getFigure(), PositionConstants.NONE);
-
- Rectangle proposedBounds = new Rectangle(dropLocation, new Dimension(20, 20));
- proposedBounds = proposedBounds.getTranslated(parentLoc);
- Rectangle preferredBounds = locator.getPreferredLocation(proposedBounds);
-
- // Convert the calculated preferred bounds as relative to parent
- // location
- Rectangle creationBounds = preferredBounds.getTranslated(parentLoc.getNegated());
- dropLocation = creationBounds.getLocation();
-
- EObject graphicalParentObject = graphicalParentEditPart.resolveSemanticElement();
-
- if((graphicalParentObject instanceof EncapsulatedClassifier) && (((EncapsulatedClassifier)graphicalParentObject).getAllAttributes().contains(droppedElement))) {
- // Drop Port on StructuredClassifier
- if(isCompartmentTarget) {
- return getDropAffixedNodeInCompartmentCommand(nodeVISUALID, dropLocation, droppedElement);
- }
- return new ICommandProxy(getDefaultDropNodeCommand(nodeVISUALID, dropLocation, droppedElement));
-
- } else if(graphicalParentObject instanceof ConnectableElement) {
- // Drop Port on Part
- Type type = ((ConnectableElement)graphicalParentObject).getType();
-
- if((type != null) && (type instanceof EncapsulatedClassifier) && (((EncapsulatedClassifier)type).getAllAttributes().contains(droppedElement))) {
- if(isCompartmentTarget) {
- return getDropAffixedNodeInCompartmentCommand(nodeVISUALID, dropLocation, droppedElement);
- }
- return new ICommandProxy(getDefaultDropNodeCommand(nodeVISUALID, dropLocation, droppedElement));
- }
-
- } else if((graphicalParentObject instanceof Behavior) && (((Behavior)graphicalParentObject).getOwnedParameters().contains(droppedElement))) {
- // Drop Parameter on Behavior
- if(isCompartmentTarget) {
- return getDropAffixedNodeInCompartmentCommand(nodeVISUALID, dropLocation, droppedElement);
- }
- return new ICommandProxy(getDefaultDropNodeCommand(nodeVISUALID, dropLocation, droppedElement));
- }
-
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * <pre>
- * This method return a drop command for TopLevelNode.
- * It returns an {@link org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand} in
- * case the element is dropped on a canvas referencing a domain element that is not a Package.
- * </pre>
- *
- * @param dropRequest
- * the drop request
- * @param semanticElement
- * the semantic element
- * @param nodeVISUALID
- * the visual identifier of the EditPart of the dropped element
- * @param linkVISUALID
- * the visual identifier of the EditPart of the dropped element
- * @return the drop command
- */
- protected Command dropTopLevelNode(DropObjectsRequest dropRequest, Element semanticElement, int nodeVISUALID, int linkVISUALID) {
-
- GraphicalEditPart graphicalParentEditPart = (GraphicalEditPart)getHost();
- EObject graphicalParentObject = graphicalParentEditPart.resolveSemanticElement();
- if(graphicalParentObject instanceof org.eclipse.uml2.uml.Package) {
- return new ICommandProxy(getDefaultDropNodeCommand(nodeVISUALID, dropRequest.getLocation(), semanticElement));
- }
-
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * <pre>
- * This method returns the drop command for AffixedNode (Port, Parameter)
- * in case the node is dropped on a ShapeCompartmentEditPart.
- * </pre>
- *
- * @param nodeVISUALID
- * the node visual identifier
- * @param location
- * the drop location
- * @param droppedObject
- * the object to drop
- * @return a CompositeCommand for Drop
- */
- protected CompoundCommand getDropAffixedNodeInCompartmentCommand(int nodeVISUALID, Point location, EObject droppedObject) {
- CompoundCommand cc = new CompoundCommand("Drop");
- IAdaptable elementAdapter = new EObjectAdapter(droppedObject);
-
- ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, ((IHintedType)getUMLElementType(nodeVISUALID)).getSemanticHint(), ViewUtil.APPEND, false, getDiagramPreferencesHint());
- // Create the command targeting host parent (owner of the
- // ShapeCompartmentEditPart)
- CreateViewCommand createCommand = new CreateViewCommand(getEditingDomain(), descriptor, ((View)(getHost().getParent().getModel())));
- cc.add(new ICommandProxy(createCommand));
-
- SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), "move", (IAdaptable)createCommand.getCommandResult().getReturnValue(), location);
- cc.add(new ICommandProxy(setBoundsCommand));
-
- return cc;
- }
-
-
- /**
- * Avoid dropped element to get orphaned for DND action resulting in a
- * specific action (not a move).
- *
- * @param request the request
- * @return the drag command
- */
- @Override
- protected Command getDragCommand(ChangeBoundsRequest request) {
-
- Boolean isSpecificDrag = false;
-
- Iterator<?> iter = request.getEditParts().iterator();
- EObject graphicalParentObject = ((GraphicalEditPart)getHost()).resolveSemanticElement();
- while((graphicalParentObject != null) && (iter.hasNext())) {
-
- EObject droppedObject = null;
- EditPart droppedEditPart = (EditPart)iter.next();
- if(droppedEditPart instanceof GraphicalEditPart) {
- droppedObject = ((GraphicalEditPart)droppedEditPart).resolveSemanticElement();
- }
-
- isSpecificDrag = isSpecificDropActionExpected((GraphicalEditPart)getHost(), droppedObject);
- }
-
- if(isSpecificDrag) {
- return null;
- }
-
- return super.getDragCommand(request);
- }
-
- /**
- * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.DiagramDragDropEditPolicy#getDropCommand(org.eclipse.gef.requests.ChangeBoundsRequest)
- *
- * @param request
- * @return
- */
-
- @Override
- protected Command getDropCommand(ChangeBoundsRequest request) {
- Boolean isSpecificDrop = false;
-
- Iterator<?> iter = request.getEditParts().iterator();
- EObject graphicalParentObject = ((GraphicalEditPart)getHost()).resolveSemanticElement();
- while((graphicalParentObject != null) && (iter.hasNext())) {
- EObject droppedObject = null;
- EditPart droppedEditPart = (EditPart)iter.next();
- if(droppedEditPart instanceof GraphicalEditPart) {
- droppedObject = ((GraphicalEditPart)droppedEditPart).resolveSemanticElement();
- }
-
- isSpecificDrop = isSpecificDropActionExpected((GraphicalEditPart)getHost(), droppedObject);
- }
-
- if(isSpecificDrop) {
- return getDropObjectsCommand(castToDropObjectsRequest(request));
- }
-
- return super.getDropCommand(request);
- }
-
- /**
- * Test if a specific drop action shall is expected.
- *
- * @param graphicalParent the graphical parent
- * @param droppedObject the dropped object
- * @return true, if is specific drop action expected
- */
- protected boolean isSpecificDropActionExpected(GraphicalEditPart graphicalParent, EObject droppedObject) {
- boolean isSpecificDropActionExpected = false;
-
- EObject graphicalParentObject = graphicalParent.resolveSemanticElement();
- if(graphicalParentObject != null) {
-
- if(graphicalParentObject instanceof Collaboration) {
-
- if((droppedObject instanceof Collaboration) || (droppedObject instanceof Class)) {
- isSpecificDropActionExpected = true;
- }
-
- } else if(graphicalParentObject instanceof StructuredClassifier) {
-
- if((droppedObject instanceof Collaboration) || (droppedObject instanceof Class)) {
- isSpecificDropActionExpected = true;
- }
-
- } else if(graphicalParentObject instanceof TypedElement) {
-
- if(droppedObject instanceof Type) {
- isSpecificDropActionExpected = true;
- }
-
- } else if(graphicalParentObject instanceof CollaborationUse) {
-
- if(droppedObject instanceof Collaboration) {
- isSpecificDropActionExpected = true;
- }
- }
- }
-
- return isSpecificDropActionExpected;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java
deleted file mode 100644
index 60a2979a92b..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.edit.policies;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * This policy provides the selection handles, feedback and move command for
- * external node label.
- * The expected behavior is to provide an external label that can freely move and with a link feedback
- * towards its parent figure during the move.
- */
-public class ExternalLabelPrimaryDragRoleEditPolicy extends NonResizableLabelEditPolicy {
-
- @Override
- protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
-
- @Override
- protected Command getMoveCommand(ChangeBoundsRequest request) {
- LabelEditPart editPart = (LabelEditPart)getHost();
-
- // FeedBack - Port + Delta
- Rectangle updatedRect = new Rectangle();
- PrecisionRectangle initialRect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
- updatedRect = initialRect.getTranslated(getHostFigure().getParent().getBounds().getLocation().getNegated());
- updatedRect = updatedRect.getTranslated(request.getMoveDelta());
-
- // translate the feedback figure
- PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
- getHostFigure().translateToAbsolute(rect);
- rect.translate(request.getMoveDelta());
- rect.resize(request.getSizeDelta());
- getHostFigure().translateToRelative(rect);
-
- ICommand moveCommand = new SetBoundsCommand(editPart.getEditingDomain(), DiagramUIMessages.MoveLabelCommand_Label_Location, new EObjectAdapter((View)editPart.getModel()), updatedRect);
- return new ICommandProxy(moveCommand);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/GraphicalNodeEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/GraphicalNodeEditPolicy.java
deleted file mode 100644
index 31e1274b54f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/GraphicalNodeEditPolicy.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- * Vincent Lorenzo(CEA LIST) vincent.lorenzo@cea.fr
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SemanticCreateCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.INodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-
-
-/**
- * <pre>
- * This class provides a custom edit policy used to replace the GRAPHICAL_NODE_ROLE
- * for the Port and Property elements (when used in CompositeStructure Diagram).
- *
- * The reason for this is that the creation of Connector requires not only to know
- * the ConnectableElement(s) on both end (given in CreateRelationshipRequest
- * Source and Target), but also the Property graphically owning the Port used at
- * ConnectorEnd.
- * </pre>
- */
-public class GraphicalNodeEditPolicy extends org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy {
-
- /**
- * The ID for the additional parameter SOURCE_PARENT used in creation request
- */
- public static final String CONNECTOR_CREATE_REQUEST_SOURCE_PARENT = "SOURCE_PARENT"; //$NON-NLS-1$
-
- /**
- * The ID for the additional parameter TARGET_PARENT used in creation request
- */
- public static final String CONNECTOR_CREATE_REQUEST_TARGET_PARENT = "TARGET_PARENT"; //$NON-NLS-1$
-
- /**
- * The ID for the additional parameter SOURCE_GRAPHICAL used in creation request
- */
- public static final String CONNECTOR_CREATE_REQUEST_SOURCE_GRAPHICAL = "SOURCE_GRAPHICAL"; //$NON-NLS-1$
-
- /**
- * The ID for the additional parameter TARGET_GRAPHICAL used in creation request
- */
- public static final String CONNECTOR_CREATE_REQUEST_TARGET_GRAPHICAL = "TARGET_GRAPHICAL"; //$NON-NLS-1$
-
- /**
- * <pre>
- * This method is overridden in order to add information (graphical parent of Port)
- * in the CreationRelationshipRequest.
- *
- * These information is stored in the request as Parameters under the following keys:
- * - &quot;SOURCE_PARENT&quot; : UML Element used as Graphical parent of the source Port (end of Connector)
- * - &quot;TARGET_PARENT&quot; : UML Element used as Graphical parent of the target Port (end of Connector)
- * - &quot;SOURCE_GRAPHICAL&quot; : GraphicalEditPart of the source
- * - &quot;TARGET_GRAPHICAL&quot; : GraphicalEditPart of the target
- *
- * This method is used too to call the custom command for InformationFlow creation.
- *
- * {@inheritDoc}
- * </pre>
- */
- @Override
- protected Command getConnectionAndRelationshipCompleteCommand(CreateConnectionViewAndElementRequest request) {
- // return super.getConnectionAndRelationshipCompleteCommand(request);
-
- // get the element descriptor
- CreateElementRequestAdapter requestAdapter = request.getConnectionViewAndElementDescriptor().getCreateElementRequestAdapter();
- // get the semantic request
- CreateRelationshipRequest createElementRequest = (CreateRelationshipRequest)requestAdapter.getAdapter(CreateRelationshipRequest.class);
-
- createElementRequest.setPrompt(!request.isUISupressed());
-
- // complete the semantic request by filling in the source and
- // destination
- INodeEditPart targetEP = getConnectionCompleteEditPart(request);
- View sourceView = (View)request.getSourceEditPart().getModel();
- View targetView = (View)targetEP.getModel();
-
- // resolve the source
- EObject source = ViewUtil.resolveSemanticElement(sourceView);
- if(source == null) {
- source = sourceView;
- }
-
- // resolve the source parent (meaning graphical parent here)
- View sourceParentView = (View)request.getSourceEditPart().getParent().getModel();
- EObject sourceParent = ViewUtil.resolveSemanticElement(sourceParentView);
- if(sourceParent == null) {
- sourceParent = sourceParentView;
- }
-
- createElementRequest.setParameter(CONNECTOR_CREATE_REQUEST_SOURCE_PARENT, sourceParent);
- createElementRequest.setParameter(CONNECTOR_CREATE_REQUEST_SOURCE_GRAPHICAL, request.getSourceEditPart());
- createElementRequest.setSource(source);
-
- // resolve the target
- EObject target = ViewUtil.resolveSemanticElement(targetView);
- if(target == null) {
- target = targetView;
- }
-
- // resolve the source parent (meaning graphical parent here)
- View targetParentView = (View)request.getTargetEditPart().getParent().getModel();
- EObject targetParent = ViewUtil.resolveSemanticElement(targetParentView);
- if(targetParent == null) {
- targetParent = targetParentView;
- }
-
- createElementRequest.setParameter(CONNECTOR_CREATE_REQUEST_TARGET_PARENT, targetParent);
- createElementRequest.setParameter(CONNECTOR_CREATE_REQUEST_TARGET_GRAPHICAL, request.getTargetEditPart());
- createElementRequest.setTarget(target);
-
- Command createElementCommand = null;
-
- // get the create element request based on the elementdescriptor's
- // request
- createElementCommand = targetEP.getCommand(new EditCommandRequestWrapper((CreateRelationshipRequest)requestAdapter.getAdapter(CreateRelationshipRequest.class), request.getExtendedData()));
-
- // create the create semantic element wrapper command
- if(null == createElementCommand)
- return null;
-
- SemanticCreateCommand semanticCommand = new SemanticCreateCommand(requestAdapter, createElementCommand);
- // get the view command
- Command viewCommand = getConnectionCompleteCommand(request);
- if(null == viewCommand)
- return null;
- // form the compound command and return
- CompositeCommand cc = new CompositeCommand(semanticCommand.getLabel());
- cc.compose(semanticCommand);
- cc.compose(new CommandProxy(viewCommand));
- return new ICommandProxy(cc);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/PortItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/PortItemSemanticEditPolicy.java
deleted file mode 100644
index 6a4436cd3c6..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/PortItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-
-/**
- * <pre>
- * This class provides a custom edit policy used to replace the SEMANTIC_ROLE
- * generated for the Port element (when used in CompositeStructure Diagram)
- * </pre>
- */
-public class PortItemSemanticEditPolicy extends org.eclipse.papyrus.diagram.component.edit.policies.PortItemSemanticEditPolicy {
-
- /**
- * <pre>
- * Forbid direct destruction of Port in case the graphical parent is not
- * the semantic parent.
- *
- * {@inheritDoc}
- * </pre>
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
-
- EObject graphicalParent = ((GraphicalEditPart)getHost().getParent()).resolveSemanticElement();
- EObject semanticParent = req.getElementToDestroy().eContainer();
-
- if(graphicalParent != semanticParent) {
- return UnexecutableCommand.INSTANCE;
- }
-
- return super.getDestroyElementCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/PortLayoutEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/PortLayoutEditPolicy.java
deleted file mode 100644
index d1d23717842..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/PortLayoutEditPolicy.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.edit.policies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortNameEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-
-/**
- * This edit policy replaces the GMF generated edit policy for Port.
- * In particular it installs {@link ExternalLabelPrimaryDragRoleEditPolicy} on
- * children that are external label.
- * The code generated by GMF can be found in {@link PortEditPart#createLayoutEditPolicy()}.
- */
-public class PortLayoutEditPolicy extends LayoutEditPolicy {
-
- @Override
- protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
- case PortNameEditPart.VISUAL_ID:
- case PortAppliedStereotypeEditPart.VISUAL_ID:
- return new ExternalLabelPrimaryDragRoleEditPolicy();
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- @Override
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- @Override
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/PropertyLabelEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/PropertyLabelEditPolicy.java
deleted file mode 100644
index 9a56de7a1a0..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/PropertyLabelEditPolicy.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 - 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.edit.policies;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.common.editpolicies.AbstractMaskManagedEditPolicy;
-import org.eclipse.papyrus.diagram.common.helper.PropertyLabelHelper;
-import org.eclipse.papyrus.diagram.component.custom.preferences.IPapyrusPropertyPreferencesConstant;
-import org.eclipse.papyrus.diagram.component.custom.preferences.PropertyPreferencePage;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.umlutils.ICustomAppearence;
-import org.eclipse.papyrus.umlutils.ui.VisualInformationPapyrusConstant;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Type;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Specific edit policy for label displaying stereotypes and their properties for edges representing
- * UML elements.
- */
-public class PropertyLabelEditPolicy extends AbstractMaskManagedEditPolicy {
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void addAdditionalListeners() {
- super.addAdditionalListeners();
- Property property = getUMLElement();
- // check host semantic element is not null
- if(property == null) {
- return;
- }
-
- // adds a listener to the element itself, and to linked elements, like Type
- if(property.getType() != null) {
- getDiagramEventBroker().addNotificationListener(property.getType(), this);
-
- }
- getDiagramEventBroker().addNotificationListener(property.getUpperValue(), this);
- getDiagramEventBroker().addNotificationListener(property.getLowerValue(), this);
- }
-
- /**
- * {@inheritDoc}
- */
- public int getCurrentDisplayValue() {
- EAnnotation propertyDisplay = ((View)getHost().getModel()).getEAnnotation(VisualInformationPapyrusConstant.CUSTOM_APPEARENCE_ANNOTATION);
- int displayValue = getDefaultDisplayValue();
- if(propertyDisplay != null) {
- displayValue = Integer.parseInt(propertyDisplay.getDetails().get(VisualInformationPapyrusConstant.CUSTOM_APPEARANCE_MASK_VALUE));
- } else {
- // no specific information => look in preferences
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- int displayValueTemp = store.getInt(IPapyrusPropertyPreferencesConstant.LABEL_DISPLAY_PREFERENCE);
- if(displayValueTemp != 0) {
- displayValue = displayValueTemp;
- }
- }
- return displayValue;
- }
-
- /**
- * {@inheritDoc}
- */
- public int getDefaultDisplayValue() {
- return ICustomAppearence.DEFAULT_UML_PROPERTY;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getMaskLabel(int value) {
- return PropertyLabelHelper.getInstance().getMaskLabel(value);
- }
-
- /**
- * {@inheritDoc}
- */
- public Collection<String> getMaskLabels() {
- return PropertyLabelHelper.getInstance().getMaskLabels();
- }
-
- /**
- * {@inheritDoc}
- */
- public Map<Integer, String> getMasks() {
- return PropertyLabelHelper.getInstance().getMasks();
- }
-
- /**
- * {@inheritDoc}
- */
- public Collection<Integer> getMaskValues() {
- return PropertyLabelHelper.getInstance().getMaskValues();
- }
-
- public String getPreferencePageID() {
- return PropertyPreferencePage.ID;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Property getUMLElement() {
- return (Property)super.getUMLElement();
- }
-
- /**
- * {@inheritedDoc}
- */
- @Override
- public void notifyChanged(Notification notification) {
- super.notifyChanged(notification);
- // change the label of the figure managed by the host edit part (managed by the parent edit
- // part in general...)
- // it must be changed only if:
- // - the annotation corresponding to the display of the stereotype changes
- // - the stereotype application list has changed
- Object object = notification.getNotifier();
- Property property = (Property)hostSemanticElement;
-
- if((object == null) || (hostSemanticElement == null)) {
- return;
- }
-
- if(notification.getFeature().equals(UMLPackage.eINSTANCE.getLiteralInteger_Value())) {
- refreshDisplay();
- } else if(notification.getFeature().equals(UMLPackage.eINSTANCE.getLiteralUnlimitedNatural_Value())) {
- refreshDisplay();
- }
-
- if(object.equals(property)) {
- notifyPropertyChanged(property, notification);
- } else if(object.equals(property.getType())) {
- notifyPropertyTypeChanged(property.getType(), notification);
- }
-
- if(isMaskManagedAnnotation(object)) {
- refreshDisplay();
- }
-
- if(isRemovedMaskManagedLabelAnnotation(object, notification)) {
- refreshDisplay();
- }
-
- }
-
- /**
- * notifies that the the property has changed.
- *
- * @param property
- * the property that has changed
- * @param notification
- * the notification send when the element has been changed
- */
- protected void notifyPropertyChanged(Property property, Notification notification) {
- switch(notification.getFeatureID(Property.class)) {
- case UMLPackage.PROPERTY__NAME:
- case UMLPackage.PROPERTY__VISIBILITY:
- case UMLPackage.PROPERTY__IS_DERIVED:
- case UMLPackage.PROPERTY__DEFAULT_VALUE:
- case UMLPackage.PROPERTY__SUBSETTED_PROPERTY:
- case UMLPackage.PROPERTY__REDEFINED_PROPERTY:
- case UMLPackage.PROPERTY__IS_ORDERED:
- case UMLPackage.PROPERTY__IS_UNIQUE:
- case UMLPackage.PROPERTY__IS_READ_ONLY:
- refreshDisplay();
- break;
- case UMLPackage.PROPERTY__TYPE:
- case UMLPackage.PROPERTY__LOWER:
- case UMLPackage.PROPERTY__LOWER_VALUE:
- case UMLPackage.PROPERTY__UPPER:
- case UMLPackage.PROPERTY__UPPER_VALUE:
-
- switch(notification.getEventType()) {
- // if it is added => adds listener to the type element
- case Notification.ADD:
- getDiagramEventBroker().addNotificationListener((EObject)notification.getNewValue(), this);
- refreshDisplay();
- // if it is removed => removes listener from the type element
- break;
- case Notification.ADD_MANY: // should never happen
- if(notification.getNewValue() instanceof List<?>) {
- List<?> addedElements = (List<?>)notification.getNewValue();
- for(Object addedElement : addedElements) {
- if(addedElement instanceof EObject) {
- getDiagramEventBroker().addNotificationListener((EObject)addedElement, this);
- }
- }
- }
- refreshDisplay();
- break;
- case Notification.REMOVE:
- getDiagramEventBroker().removeNotificationListener((EObject)notification.getOldValue(), this);
- refreshDisplay();
- break;
- case Notification.REMOVE_MANY: // should never happen
- if(notification.getOldValue() instanceof List<?>) {
- List<?> removedElements = (List<?>)notification.getOldValue();
- for(Object removedElement : removedElements) {
- if(removedElement instanceof EObject) {
- getDiagramEventBroker().removeNotificationListener((EObject)removedElement, this);
- }
- }
- }
- refreshDisplay();
- break;
- // if it is set, remove the old one and adds the new one. this is the method use when
- // the type is set or removed...
- case Notification.SET:
- if(notification.getOldValue() != null) {
- getDiagramEventBroker().removeNotificationListener((EObject)notification.getOldValue(), this);
- }
- if(notification.getNewValue() != null) {
- getDiagramEventBroker().addNotificationListener((EObject)notification.getNewValue(), this);
- }
- refreshDisplay();
-
- default:
- break;
-
- }
-
- break;
- default:
- // does nothing in other cases
- break;
- }
- }
-
- /**
- * notifies that the type of the property has changed.
- *
- * @param type
- * the type of the property that has changed
- * @param notification
- * the notification send when the element has been changed
- */
- protected void notifyPropertyTypeChanged(Type type, Notification notification) {
- switch(notification.getFeatureID(Property.class)) {
- case UMLPackage.TYPE__NAME:
- refreshDisplay(); // type name has changed => refresh the property display
- break;
- default:
- // does nothing by default
- break;
- }
- }
-
- /**
- * Refreshes the display of the edit part
- */
- @Override
- public void refreshDisplay() {
- // calls the helper for this edit Part
- PropertyLabelHelper.getInstance().refreshEditPartDisplay((GraphicalEditPart)getHost());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void removeAdditionalListeners() {
- super.removeAdditionalListeners();
- Property property = getUMLElement();
- if(property == null) {
- // check semantic element is not null and this is really an instance of Property
- return;
- }
-
- if(property.getType() != null) {
- getDiagramEventBroker().removeNotificationListener(property.getType(), this);
- }
-
- getDiagramEventBroker().removeNotificationListener(property.getUpperValue(), this);
- getDiagramEventBroker().removeNotificationListener(property.getLowerValue(), this);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/RemoveOrphanViewPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/RemoveOrphanViewPolicy.java
deleted file mode 100644
index 2805ccc2a2d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/edit/policies/RemoveOrphanViewPolicy.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.Tessier@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Adaptation for Composite Diagram
-
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.edit.policies;
-
-import org.eclipse.gmf.runtime.notation.BasicCompartment;
-import org.eclipse.gmf.runtime.notation.DecorationNode;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.OrphanViewPolicy;
-
-/**
- * <pre>
- * This policy is used to suppress orphan node view in GMF view.
- * The policy to remove orphan connection is more complex.
- *
- * See RemoveOrphanViewPolicy in Class Diagram
- * </pre>
- */
-public class RemoveOrphanViewPolicy extends OrphanViewPolicy {
-
- /**
- *
- * @see org.eclipse.papyrus.diagram.common.editpolicies.OrphanViewPolicy#isOrphaned(org.eclipse.gmf.runtime.notation.View)
- *
- * @param view
- * @return true is the view is Orphaned
- */
- protected boolean isOrphaned(View view) {
- // Always treat Compartment and Decoration as not orphaned nodes
- if((view instanceof BasicCompartment) || (view instanceof DecorationNode)) {
- return false;
- }
- return !view.isSetElement();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/figure/edges/UsageDecoration.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/figure/edges/UsageDecoration.java
deleted file mode 100644
index a2bbd86836e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/figure/edges/UsageDecoration.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.figure.edges;
-
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class UsageDecoration.
- */
-public class UsageDecoration extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {
-
-
- /**
- * Instantiates a new usage decoration.
- */
- public UsageDecoration() {
- this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
- setTargetDecoration(createTargetDecoration());
- }
-
-
- /**
- * Creates the target decoration.
- *
- * @return the org.eclipse.draw2d. rotatable decoration
- */
- private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {
-
- org.eclipse.draw2d.PolylineDecoration df = new org.eclipse.draw2d.PolylineDecoration();
- df.setFill(false);
- org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();
-
- pl.addPoint(2, 3);
- pl.addPoint(1, 3);
- pl.addPoint(0, 1);
- pl.addPoint(0, 0);
- pl.addPoint(0, -1);
- pl.addPoint(1, -3);
- pl.addPoint(2, -3);
- df.setTemplate(pl);
- df.setScale(7, 3);
-
- return df;
- }
-
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/figure/nodes/CompositeFigure.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/figure/nodes/CompositeFigure.java
deleted file mode 100644
index 5aad7280399..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/figure/nodes/CompositeFigure.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr - Customization & Adaptation
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.figure.nodes;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.papyrus.diagram.common.Activator;
-import org.eclipse.papyrus.diagram.common.figure.node.CompartmentFigure;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.swt.graphics.Image;
-
-// TODO: Auto-generated Javadoc
-/**
- * Figure for Composite representation of Class.
- */
-public class CompositeFigure extends CompartmentFigure {
-
- /** The Internal Structure Compartment. */
- private final static String COMPOSITE_COMPARTMENT = "compositeCompartment";
-
- /** The List of Compartment. */
- private final static List<String> COMPARTMENT = new ArrayList<String>() {
-
- private static final long serialVersionUID = 1L;
- {
- add(COMPOSITE_COMPARTMENT);
- }
- };
-
- /**
- * Default Constructor.
- */
- public CompositeFigure() {
- super(COMPARTMENT, "component");
- Image img = Activator.getPluginIconImage(UMLDiagramEditorPlugin.ID, "icons/obj16/ComponentIcon.gif");
- setAppliedStereotypeIcon(img, PositionConstants.RIGHT);
- }
-
- /**
- * Create a new Classifier figure with the given tag.
- *
- * @param tagLabel
- * a String that will be displayed at the top of the figure
- */
- public CompositeFigure(String tagLabel) {
- super(COMPARTMENT, tagLabel);
- }
-
- /**
- * Get the attribute's compartment figure.
- *
- * @return the composite compartment figure
- */
- public IFigure getCompositeCompartmentFigure() {
- return getCompartment(COMPOSITE_COMPARTMENT);
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/figure/nodes/PortFigure.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/figure/nodes/PortFigure.java
deleted file mode 100644
index b71c192542b..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/figure/nodes/PortFigure.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.figure.nodes;
-
-import org.eclipse.papyrus.diagram.common.figure.node.AffixedNamedElementFigure;
-
-/**
- * The Class PortFigure.
- */
-public class PortFigure extends AffixedNamedElementFigure {
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/locators/PortPositionLocator.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/locators/PortPositionLocator.java
deleted file mode 100644
index e5f67c309a9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/locators/PortPositionLocator.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- * Vincent Lorenzo(CEA-List) vincent.lorenzo@cea.fr - getCurrentSideOfParent()
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.locators;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-
-/**
- * This class is used to constrain the position of Port when they are added on a Property or a
- * StructuredClassifier
- *
- * <pre>
- * +-------------------+
- * | [Class] |
- * +-------------------+
- * | |
- * | |
- * | +-+ - Expected position of Port
- * | +-+
- * | |
- * +-------------------+
- *
- * </pre>
- *
- * <pre>
- * TODO : The port is not re-sizable
- * </pre>
- */
-public class PortPositionLocator implements IBorderItemLocator {
-
- /** the figure around which this border item appears */
- protected IFigure parentFigure = null;
-
- /** the width of the area surrounding the parent figure where border item can be put */
- protected int borderItemOffset = 10;
-
- /**
- * get the parent figure
- *
- * @return the parent figure
- */
- public IFigure getParentFigure() {
- return parentFigure;
- }
-
- /** the position constraint */
- protected Rectangle constraint = new Rectangle(0, 0, 0, 0);
-
- /** Constructor **/
- public PortPositionLocator(IFigure parentFigure, int preferredSide) {
- // The preferredSide parameter is not used, just kept here to ensure compatibility
- // with GMF generated code.
- this.parentFigure = parentFigure;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#getValidLocation(org.eclipse.draw2d.geometry.Rectangle,
- * org.eclipse.draw2d.IFigure)
- *
- * @param proposedLocation
- * @param borderItem
- * @return a valid location
- */
- public Rectangle getValidLocation(Rectangle proposedLocation, IFigure borderItem) {
- return getPreferredLocation(proposedLocation);
- }
-
- /**
- *
- * @param proposedLocation
- * the proposed location
- * @return a possible location on parent figure border
- */
- public Rectangle getPreferredLocation(Rectangle proposedLocation) {
-
- // Initialize port location with proposed location
- // and resolve the bounds of it graphical parent
- Rectangle realLocation = new Rectangle(proposedLocation);
-
- Rectangle parentRec = getParentFigure().getBounds().getCopy();
-
- // Calculate Max position around the graphical parent (1/2 size or the port around
- // the graphical parent bounds.
- int xMin = parentRec.x - borderItemOffset;
- int xMax = parentRec.x - borderItemOffset + parentRec.width;
- int yMin = parentRec.y - borderItemOffset;
- int yMax = parentRec.y - borderItemOffset + parentRec.height;
-
- // Modify Port location if MAX X or Y are exceeded
- if(realLocation.x < xMin) {
- realLocation.x = xMin;
- }
-
- if(realLocation.x > xMax) {
- realLocation.x = xMax;
- }
-
- if(realLocation.y < yMin) {
- realLocation.y = yMin;
- }
-
- if(realLocation.y > yMax) {
- realLocation.y = yMax;
- }
-
- // Ensure the port is positioned on its parent borders and not in the middle.
- // Modify position if needed.
- if((realLocation.y != yMin) && (realLocation.y != yMax)) {
- if((realLocation.x != xMin) && (realLocation.x != xMax)) {
-
- if(realLocation.x <= (xMin + (parentRec.width / 2))) {
- realLocation.x = xMin;
- } else {
- realLocation.x = xMax;
- }
- }
- }
-
- // Return constrained location
- return realLocation;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#getCurrentSideOfParent()
- *
- * @return
- * the position of the port around its parent. This position can be
- * <ul>
- * <li>{@linkplain PositionConstants#NORTH}</li>
- * <li> {@linkplain PositionConstants#SOUTH}</li>
- * <li> {@linkplain PositionConstants#EAST}</li>
- * <li> {@linkplain PositionConstants#WEST}</li>
- * <li> {@linkplain PositionConstants#NORTH_EAST}</li>
- * <li> {@linkplain PositionConstants#NORTH_WEST}</li>
- * <li> {@linkplain PositionConstants#SOUTH_EAST}</li>
- * <li> {@linkplain PositionConstants#SOUTH_WEST}</li>
- * </ul>
- */
- public int getCurrentSideOfParent() {
- int position = PositionConstants.NONE;
-
- //we are not on EAST, not on WEST, but we are on the NORTH
- if((constraint.x != parentFigure.getBounds().width - borderItemOffset) && (constraint.x != -this.borderItemOffset) && (constraint.y == -this.borderItemOffset)) {
- position = PositionConstants.NORTH;
-
- //we are not on the EAST and not on the WEST, but we are on the SOUTH
- } else if((constraint.x != parentFigure.getBounds().width - borderItemOffset) && (constraint.x != -this.borderItemOffset) && (constraint.y == parentFigure.getBounds().height - borderItemOffset)) {
- position = PositionConstants.SOUTH;
-
- //we are on the EAST, but we are not on the NORTH and not on the SOUTH
- } else if((constraint.x == parentFigure.getBounds().width - borderItemOffset) && (constraint.y != -this.borderItemOffset) && (constraint.y != parentFigure.getBounds().height - borderItemOffset)) {
- position = PositionConstants.EAST;
-
- //we are on the WEST, but we are not on the on the NORTH and not on the SOUTH
- } else if((constraint.x == -this.borderItemOffset) && (constraint.y != -this.borderItemOffset) && (constraint.y != parentFigure.getBounds().height - borderItemOffset)) {
- position = PositionConstants.WEST;
-
- //we are on the NORTH and on the EAST
- } else if((constraint.x == parentFigure.getBounds().width - borderItemOffset) && (constraint.y == -this.borderItemOffset)) {
- position = PositionConstants.NORTH_EAST;
-
- //we are on the NORTH and on the WEST
- } else if((constraint.x == -this.borderItemOffset) && (constraint.y == -this.borderItemOffset)) {
- position = PositionConstants.NORTH_WEST;
-
- //we are on the EAST and on the SOUTH
- } else if((constraint.x == parentFigure.getBounds().width - borderItemOffset) && (constraint.y == parentFigure.getBounds().height - borderItemOffset)) {
- position = PositionConstants.SOUTH_EAST;
-
- //we are on the WEST and on the SOUTH
- } else if((constraint.x == -this.borderItemOffset) && (constraint.y == parentFigure.getBounds().height - borderItemOffset)) {
- position = PositionConstants.SOUTH_WEST;
- }
-
- return position;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#setConstraint(org.eclipse.draw2d.geometry.Rectangle)
- *
- * @param constraint
- */
- public void setConstraint(Rectangle constraint) {
- this.constraint = constraint;
-
- }
-
- /**
- *
- * @see org.eclipse.draw2d.Locator#relocate(org.eclipse.draw2d.IFigure)
- *
- * @param target
- */
- public void relocate(IFigure target) {
-
- Rectangle proposedLocation = constraint.getCopy();
- proposedLocation.setLocation(constraint.getLocation().translate(parentFigure.getBounds().getTopLeft()));
-
- Point validLocation = getValidLocation(proposedLocation, target).getLocation();
-
- target.setBounds(new Rectangle(validLocation, target.getPreferredSize()));
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/log/Log.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/log/Log.java
deleted file mode 100644
index 4045cc0b0c1..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/log/Log.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.log;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.log.LogHelper;
-
-/** Log singleton class for CSD */
-public class Log extends LogHelper {
-
- /** Singleton instance */
- private static Log instance;
-
- /** Access restriction on constructors */
- private Log(Plugin activator) {
- super(activator);
- }
-
- /** Access restriction on constructors */
- private Log() {
- super(UMLDiagramEditorPlugin.getInstance());
- }
-
- /** Singleton access */
- public static synchronized Log getInstance() {
-
- if(instance == null) {
- instance = new Log();
- }
- return instance;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/messages/Messages.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/messages/Messages.java
deleted file mode 100644
index 0cb5aa45518..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/messages/Messages.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.messages;
-
-import org.eclipse.osgi.util.NLS;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class Messages.
- */
-public class Messages extends NLS {
-
- /** The Constant BUNDLE_NAME. */
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.diagram.component.custom.messages.messages"; //$NON-NLS-1$
-
-
- /** The Create uml element dialog_ new_ element_ name. */
- public static String CreateUmlElementDialog_New_Element_Name;
-
- /** The Selection validated. */
- public static String SelectionValidated;
-
- /** The Show hide related contents action_ message. */
- public static String ShowHideRelatedContentsAction_Message;
-
- /** The Show hide related contents action_ title. */
- public static String ShowHideRelatedContentsAction_Title;
-
- /** The Interface manager dialog_ create a new interface. */
- public static String InterfaceManagerDialog_CreateANewInterface;
-
- /** The Interface manager dialog_ create new interface. */
- public static String InterfaceManagerDialog_CreateNewInterface;
-
- /** The Interface manager dialog_ selected the provided interfaces. */
- public static String InterfaceManagerDialog_SelectedTheProvidedInterfaces;
-
- /** The Interface manager dialog_ selection has to be a package or a classifier. */
- public static String InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier;
-
- /** The Interface manager dialog_ select the parent of this new interface. */
- public static String InterfaceManagerDialog_SelectTheParentOfThisNewInterface;
-
- /** The Interface manager dialog_ select the required interfaces. */
- public static String InterfaceManagerDialog_SelectTheRequiredInterfaces;
-
- /** The Interface manager dialog_ the port is typed with an interface warning message. */
- public static String InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage;
-
- /** The Interface manager dialog_ title. */
- public static String InterfaceManagerDialog_Title;
-
- /** The Manage provided interfaces handler_ ok. */
- public static String ManageProvidedInterfacesHandler_OK;
-
- /** The Manage provided interfaces handler_ the type of the port is not defined. */
- public static String ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined;
-
- /** The No selection found. */
- public static String NoSelectionFound;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- /**
- * Instantiates a new messages.
- */
- private Messages() {
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/messages/messages.properties b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/messages/messages.properties
deleted file mode 100644
index 9f50199d04c..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/messages/messages.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 CEA LIST.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
-###############################################################################
-CreateUmlElementDialog_New_Element_Name=New Element Name
-SelectionValidated=Selection validated.
-ShowHideRelatedContentsAction_Message=Choose the elements to show
-ShowHideRelatedContentsAction_Title=Show/Hide Related Contents
-InterfaceManagerDialog_CreateANewInterface=Create a new Interface
-InterfaceManagerDialog_CreateNewInterface=Create new Interface
-InterfaceManagerDialog_SelectedTheProvidedInterfaces=Select the provided Interfaces
-InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier=Selection has to be a Package or a Classifier
-InterfaceManagerDialog_SelectTheParentOfThisNewInterface=Select the parent of this new Interface
-InterfaceManagerDialog_SelectTheRequiredInterfaces=Select the required Interfaces
-InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage=\nThe managed port is typed with an Interface, so this interface is not available as a provided Interface.\n
-InterfaceManagerDialog_Title=Select the provided and the required Interfaces
-ManageProvidedInterfacesHandler_OK=OK
-ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined=The type of the Port is not defined. You need to define it before managing its Interfaces.
-NoSelectionFound=No selection found. \ No newline at end of file
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/preferences/IPapyrusPropertyPreferencesConstant.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/preferences/IPapyrusPropertyPreferencesConstant.java
deleted file mode 100644
index b00bf258668..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/preferences/IPapyrusPropertyPreferencesConstant.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.preferences;
-
-import org.eclipse.uml2.uml.Property;
-
-/**
- * Constants for {@link Property} preferences.
- */
-public interface IPapyrusPropertyPreferencesConstant {
-
- /** Preference id for {@link Property} display label */
- public String LABEL_DISPLAY_PREFERENCE = "Property.label.display"; //$NON-NLS-1$
-
- /** Preference id for {@link Property} display label */
- public String PREF_FONT = "Property.font"; //$NON-NLS-1$
-
- /** Preference id for {@link Property} display label */
- public String PREF_FONT_COLOR = "Property.font.color"; //$NON-NLS-1$
-
- /** Preference id for {@link Property} display label */
- public String PREF_LINE_COLOR = "Property.line.color"; //$NON-NLS-1$
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/preferences/PropertyPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/preferences/PropertyPreferencePage.java
deleted file mode 100644
index a6b2c3c2640..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/preferences/PropertyPreferencePage.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusElementPreferencePage;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.papyrus.umlutils.ICustomAppearence;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * Specific {@link Property} preference page
- */
-public class PropertyPreferencePage extends AbstractPapyrusElementPreferencePage {
-
- /** Preference page identifier */
- public static final String ID = "org.eclipse.papyrus.diagram.composite.custom.preferences.PropertyPreferencePage"; //$NON-NLS-1$
-
- /**
- * Listeners for the check buttons that select the display of the {@link Property}
- */
- private class AppearenceSelectionListener implements SelectionListener {
-
- /** the constant which refers the element to display or not */
- final private int style;
-
- /**
- * Default Constructor.
- *
- * @param style
- */
- public AppearenceSelectionListener(int style) {
- this.style = style;
- }
-
- /**
- * {@inheritDoc}
- */
- public void widgetDefaultSelected(SelectionEvent e) {
-
- }
-
- /**
- * {@inheritDoc}
- */
- public void widgetSelected(SelectionEvent e) {
- // add or remove the flag to the display property value (invert the current value)
- propertyValue = propertyValue ^ style;
-
- // refresh buttons at the end
- refreshButtons();
- }
- }
-
- /**
- * Initialize preferences.
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String elementName = "Property";
- PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(177, 207, 229));
-
- // Set the default for the gradient
- store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.GRADIENT_POLICY), false);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(new org.eclipse.swt.graphics.RGB(255, 255, 255), new org.eclipse.swt.graphics.RGB(177, 207, 229), 0, 0);
- store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- // custom code
- store.setDefault(IPapyrusPropertyPreferencesConstant.LABEL_DISPLAY_PREFERENCE, ICustomAppearence.DEFAULT_UML_PROPERTY);
-
- }
-
- /** buttons to select the display kind for the label of the {@link Property} */
- protected Button displVisibility, displDerive, displName, displType, displMutliplicity, displDfltValue, displModifiers;
-
- /** current property display style */
- private int propertyValue = getPreferenceStore().getInt(IPapyrusPropertyPreferencesConstant.LABEL_DISPLAY_PREFERENCE);
-
- /**
- * Creates a button with the {@link SWT#CHECK} style.
- *
- * @param parent
- * the parent of the button
- * @param label
- * the label of the button
- * @param mask
- * the value controlled by the button
- * @return the button created
- */
- protected Button createCheckButton(Composite parent, String label, int mask) {
- Button button = new Button(parent, SWT.CHECK);
- button.setText(label);
- button.addSelectionListener(new AppearenceSelectionListener(mask));
- return button;
- }
-
- /**
- * Creates the group and check boxes to choose the kind of display
- *
- * @param parent
- * the parent composite that holds the group
- */
- protected void createLabelPreferencesButtons(Composite parent) {
- // create group that host the buttons
- Group group = new Group(parent, SWT.SHADOW_NONE);
- group.setText("Label Display");
- group.setLayout(new FormLayout());
-
- FormData data;
-
- displVisibility = createCheckButton(group, "Visibility", ICustomAppearence.DISP_VISIBILITY);
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- displVisibility.setLayoutData(data);
-
- displDerive = createCheckButton(group, "Derived", ICustomAppearence.DISP_DERIVE);
- data = new FormData();
- data.left = new FormAttachment(displVisibility, 85);
- data.top = new FormAttachment(0, 0);
- displDerive.setLayoutData(data);
-
- displName = createCheckButton(group, "Name", ICustomAppearence.DISP_NAME);
- data = new FormData();
- data.left = new FormAttachment(displDerive, 85);
- data.top = new FormAttachment(0, 0);
- displName.setLayoutData(data);
-
- displType = createCheckButton(group, "Type", ICustomAppearence.DISP_TYPE);
- data = new FormData();
- data.left = new FormAttachment(displName, 85);
- data.top = new FormAttachment(0, 0);
- displType.setLayoutData(data);
-
- displMutliplicity = createCheckButton(group, "Multiplicity", ICustomAppearence.DISP_MULTIPLICITY);
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(displVisibility, ITabbedPropertyConstants.HSPACE);
- displMutliplicity.setLayoutData(data);
-
- displDfltValue = createCheckButton(group, "Default Value", ICustomAppearence.DISP_DFLT_VALUE);
- data = new FormData();
- data.left = new FormAttachment(displVisibility, 85);
- data.top = new FormAttachment(displVisibility, ITabbedPropertyConstants.HSPACE);
- displDfltValue.setLayoutData(data);
-
- displModifiers = createCheckButton(group, "Modifiers", ICustomAppearence.DISP_MOFIFIERS);
- data = new FormData();
- data.left = new FormAttachment(displDerive, 85);
- data.top = new FormAttachment(displVisibility, ITabbedPropertyConstants.HSPACE);
- displModifiers.setLayoutData(data);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createPageContents(Composite parent) {
- super.createPageContents(parent);
-
- // adds the label preferences checkboxes
- createLabelPreferencesButtons(parent);
-
- refreshButtons();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * Load the default preferences of the fields contained in this page
- */
- protected void loadDefaultPreferences() {
- propertyValue = getPreferenceStore().getInt(IPapyrusPropertyPreferencesConstant.LABEL_DISPLAY_PREFERENCE);
- refreshButtons();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void performDefaults() {
- loadDefaultPreferences();
- super.performDefaults();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean performOk() {
- storePreferences();
- return super.performOk();
- }
-
- /**
- * Refresh the buttons that manages the display.
- */
- protected void refreshButtons() {
-
- displVisibility.setSelection((propertyValue & ICustomAppearence.DISP_VISIBILITY) == ICustomAppearence.DISP_VISIBILITY);
- displDerive.setSelection((propertyValue & ICustomAppearence.DISP_DERIVE) == ICustomAppearence.DISP_DERIVE);
- displName.setSelection((propertyValue & ICustomAppearence.DISP_NAME) == ICustomAppearence.DISP_NAME);
- displType.setSelection((propertyValue & ICustomAppearence.DISP_TYPE) == ICustomAppearence.DISP_TYPE);
- displMutliplicity.setSelection((propertyValue & ICustomAppearence.DISP_MULTIPLICITY) == ICustomAppearence.DISP_MULTIPLICITY);
- displDfltValue.setSelection((propertyValue & ICustomAppearence.DISP_DFLT_VALUE) == ICustomAppearence.DISP_DFLT_VALUE);
- displModifiers.setSelection((propertyValue & ICustomAppearence.DISP_MOFIFIERS) == ICustomAppearence.DISP_MOFIFIERS);
- }
-
- /**
- * Stores the values of the fields contained in this page into the preference store.
- */
- @Override
- protected void storePreferences() {
- IPreferenceStore store = getPreferenceStore();
- // checks the stored value and the actual one, so does not refresh diagram if it is not
- // needed
- if(propertyValue != store.getInt(IPapyrusPropertyPreferencesConstant.LABEL_DISPLAY_PREFERENCE)) {
- store.setValue(IPapyrusPropertyPreferencesConstant.LABEL_DISPLAY_PREFERENCE, propertyValue);
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/providers/ActionStateSourceProvider.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/providers/ActionStateSourceProvider.java
deleted file mode 100644
index 4e2e45485b7..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/providers/ActionStateSourceProvider.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.providers;
-
-import org.eclipse.papyrus.diagram.common.providers.AbstractActionStateSourceProvider;
-import org.eclipse.papyrus.diagram.component.custom.actions.ShowHideRelatedContentsHandler;
-import org.eclipse.ui.ISources;
-
-/**
- * This class provides the state of the actions. It's used to refresh
- * the status of these actions in the menu. (in toolbar and popup, it's not needed)
- *
- * To get the status, we listen the selection service AND the part service!
- * The part service is used to know if the selection is in the Model Explorer or not!
- * When the selection is not in the model explorer, the handlers listening the variable need to be disabled
- */
-public class ActionStateSourceProvider extends AbstractActionStateSourceProvider {
-
- /**
- * The name of the variable to check.
- */
- public static final String SHOW_HIDE_RELATED_CONTENTS = "showHideRelatedContents"; //$NON-NLS-1$
-
- /**
- *
- * Constructor.
- *
- */
- public ActionStateSourceProvider() {
- super();
- currentState.put(SHOW_HIDE_RELATED_CONTENTS, DISABLED);
- }
-
-
- /**
- *
- * @see org.eclipse.ui.ISourceProvider#getProvidedSourceNames()
- *
- * @return
- */
- @Override
- public String[] getProvidedSourceNames() {
- return new String[]{ SHOW_HIDE_RELATED_CONTENTS };
- }
-
-
- /**
- * Refresh the state of the Delete Action
- */
- protected void refreshShowHideRelatedContentsAction() {
- String oldState = currentState.get(SHOW_HIDE_RELATED_CONTENTS);
- String newState = (testShowHideRelatedContents() ? ENABLED : DISABLED);
-
- if(oldState != newState) {
- currentState.put(SHOW_HIDE_RELATED_CONTENTS, newState);
- fireSourceChanged(ISources.WORKBENCH, currentState);
- }
- }
-
- /**
- * Tests if the action DeleteFromDiagram (now called Delete Selected Element can be executed
- *
- * @return
- * <code>true</code> if the action DeleteFromDiagram (now called Delete Selected Element can be executed <code>false</code> if not
- */
- protected boolean testShowHideRelatedContents() {
- ShowHideRelatedContentsHandler handler = new ShowHideRelatedContentsHandler();
- return isSelectionInDiagram() && handler.isEnabled();
- }
-
- /**
- *
- * @see org.eclipse.papyrus.diagram.common.providers.AbstractActionStateSourceProvider#refreshActions()
- *
- */
- @Override
- protected void refreshActions() {
- refreshShowHideRelatedContentsAction();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/providers/CustomEditPolicyProvider.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/providers/CustomEditPolicyProvider.java
deleted file mode 100644
index 74c268303fc..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/providers/CustomEditPolicyProvider.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.providers;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.NavigationEditPolicy;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-
-/**
- * this is an editpolicy provider in charge to install a policy to navigate between diagrams and elements
- *
- */
-public class CustomEditPolicyProvider implements IEditPolicyProvider {
-
- /**
- *
- * {@inheritDoc}
- */
- public void addProviderChangeListener(IProviderChangeListener listener) {
-
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void createEditPolicies(EditPart editPart) {
- editPart.installEditPolicy(NavigationEditPolicy.NAVIGATION_POLICY, new NavigationEditPolicy());
- if( editPart instanceof IPrimaryEditPart){
- editPart.installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- }
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public boolean provides(IOperation operation) {
- CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation)operation;
- if(!(epOperation.getEditPart() instanceof GraphicalEditPart)) {
- return false;
- }
- GraphicalEditPart gep = (GraphicalEditPart)epOperation.getEditPart();
- String diagramType = gep.getNotationView().getDiagram().getType();
- if(ComponentDiagramEditPart.MODEL_ID.equals(diagramType)) {
- return true;
- }
-
-
- return false;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void removeProviderChangeListener(IProviderChangeListener listener) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/ui/CreateUmlElementDialog.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/ui/CreateUmlElementDialog.java
deleted file mode 100644
index 0682cad6f5e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/ui/CreateUmlElementDialog.java
+++ /dev/null
@@ -1,438 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.ui;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.CreateRelationshipCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.papyrus.diagram.common.util.Util;
-import org.eclipse.papyrus.diagram.component.custom.messages.Messages;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-import org.eclipse.papyrus.umlutils.NamedElementUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLPackage;
-
-
-/**
- * This dialog allows to create easily a new element in a UML Model.
- */
-public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
-
- /** the hinted type of the element to create. */
- private IHintedType hintedType;
-
- /** the parent container of the element to create. */
- private Object parentContainer;
-
- /** the type of the element to create. */
- private String type;
-
- /** the root of the model. */
- private Package pack;
-
- /** the text field used to display the choose the name of the future element. */
- private Text text;
-
- /** creation request. */
- private CreateElementRequest request;
-
- /** the editing domain. */
- private TransactionalEditingDomain domain;
-
- /** The element to create is represented by this field. */
- private NewElementRepresentation elementToCreate;
-
- /** this Set contains names to exclude from the proposed name. */
- private List<String> forbiddenNames;
-
-
-
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent
- * @param domain
- * the domain
- * @param labelProvider
- * the label provider
- * @param contentProvider
- * the content provider
- * @param pack
- * the pack
- * @param hintedType
- * the hinted type
- */
- public CreateUmlElementDialog(Shell parent, TransactionalEditingDomain domain, ILabelProvider labelProvider, ITreeContentProvider contentProvider, Package pack, IHintedType hintedType) {
- super(parent, labelProvider, contentProvider);
- Assert.isNotNull(pack);
- Assert.isNotNull(hintedType);
- this.pack = pack;
- this.hintedType = hintedType;
- this.domain = domain;
- init();
- }
-
- /**
- * Initializes the field {@link #type};.
- */
- protected void init() {
- EClass eClass = hintedType.getEClass();
- this.type = eClass.getName();
- this.parentContainer = null;
- this.forbiddenNames = null;
- }
-
- /**
- * Sets the forbidden names.
- *
- * @param forbiddenNames
- * the new forbidden names
- */
- public void setForbiddenNames(List<String> forbiddenNames) {
- this.forbiddenNames = forbiddenNames;
- }
-
- /**
- * Creates the dialog area.
- *
- * @param parent
- * the parent
- * @return the control
- * @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createDialogArea(Composite parent) {
-
- GridData data = (GridData)parent.getLayoutData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalSpan = 1;
- data.horizontalAlignment = SWT.FILL;
- data.verticalAlignment = SWT.FILL;
- Composite composite = (Composite)super.createDialogArea(parent);
- composite.setLayout(new GridLayout());
- GridData dat = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(dat);
- createNameSection(parent);
-
- return composite;
- }
-
- /**
- * Creates the name section and put it at the top of the composite.
- *
- * @param parent
- * the composite parent
- */
- protected void createNameSection(Composite parent) {
-
- Composite nameSection = new Composite(parent, SWT.NONE);
-
- //the label
- Label label = new Label(nameSection, SWT.NONE);
- label.setText(Messages.CreateUmlElementDialog_New_Element_Name);
-
- //the text field
- text = new Text(nameSection, SWT.BORDER);
- text.setText(getDefaultName());
- GridData textData = new GridData(GridData.FILL_HORIZONTAL);
- text.setLayoutData(textData);
-
- //layout for the nameSection
- GridLayout layout = new GridLayout(2, false);
- GridData data = new GridData(GridData.FILL_BOTH);
- nameSection.setLayout(layout);
- nameSection.setLayoutData(data);
-
- //we set the name section in first!
- nameSection.moveAbove(null);
- }
-
- /**
- * Returns the default name for the new Element.
- *
- * @return the default name
- * the default name for the new Element
- */
- protected String getDefaultName() {
-
- boolean existsInterface = false;
- String defaultName;
- int max = 0;
- do {
-
- ArrayList<?> allInterface = Util.getInstancesFilteredByType(pack, Interface.class, null);
- for(Object object : allInterface) {
- String name = NamedElementUtil.getName((NamedElement)object);
- if(name != null && name.startsWith(type)) {
- name = name.substring(type.length());
- Integer val = null;
- try {
- val = Integer.parseInt(name);
- } catch (NumberFormatException e) {
- //Nothing to do
- }
- if(val != null) {
- max = Math.max(Integer.valueOf(val), max);
- existsInterface = true;
- }
- }
- }
- if(existsInterface) {
- defaultName = type + new Integer(max + 1).toString();
- } else {
- defaultName = type + new Integer(max).toString();
- }
- max++;
- } while(!isCorrectName(defaultName));
- return defaultName;
- }
-
- /**
- * Tests if the proposed name is not forbidden
- *
- * @param name
- * a name
- * @return
- * <code>true</code> if the proposed name is not forbidden
- */
- protected boolean isCorrectName(String name) {
- if(forbiddenNames == null) {
- return true;
- }
- return !forbiddenNames.contains(name);
- }
-
- /**
- * Returns the command to create the new element which the chosen name.
- *
- * @return the command
- * the command to create the new element which the chosen name
- */
- public Command getCommand() {
-
- CompositeCommand cmd = new CompositeCommand("Create new element command"); //$NON-NLS-1$
- //request to create the new Interface
- if(elementToCreate.getCreateElementRequest() != null) {
- ICommand command = getCommand(elementToCreate.getCreateElementRequest());
- if(command.canExecute()) {
- cmd.add(command);
- SetNameCommand nameCommand = new SetNameCommand(domain, "Set Name Command", null, request, elementToCreate); //$NON-NLS-1$
- if(nameCommand.canExecute()) {
- cmd.add(nameCommand);
- }
- }
- return new ICommandProxy(cmd);
- } else {
- return new ICommandProxy(new CustomCreateElementCommand(domain, "CustomCreateElementCommand", null, elementToCreate)); //$NON-NLS-1$
- }
- }
-
- /**
- * Compute result.
- *
- * @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#computeResult()
- */
- @Override
- protected void computeResult() {
- java.util.List<Object> result = new ArrayList<Object>();
- result.add(elementToCreate);
- setResult(result);
- }
-
- /**
- * Set the value to {@link #name} and {@link #parentContainer}.
- *
- * @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed()
- */
- @Override
- protected void okPressed() {
- ISelection selection = getTreeViewer().getSelection();
- parentContainer = ((IStructuredSelection)selection).getFirstElement();
- CreateElementRequest request = null;
- if(parentContainer instanceof EObject) {
- request = new CreateElementRequest(domain, (EObject)parentContainer, this.hintedType);
- }
- elementToCreate = new NewElementRepresentation(this.text.getText(), parentContainer, hintedType, request);
- super.okPressed();
- }
-
- /**
- * Returns a command corresponding to this request.
- *
- * @param request
- * a request
- * @return the command
- * The command corresponding to this request or an {@link UnexecutableCommand} when the command can not be build
- */
- private ICommand getCommand(IEditCommandRequest request) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(UMLPackage.eINSTANCE.getNamedElement());
- {
- if(provider != null) {
- ICommand cmd = provider.getEditCommand(request);
- if(cmd != null && cmd.canExecute()) {
- return cmd;
- }
- }
- }
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
-
- /**
- * This command is used to set the chosen name to the new element.
- */
- public class SetNameCommand extends AbstractTransactionalCommand {
-
- /** the representation that will own the new element when it will be created. */
- private NewElementRepresentation representation;
-
- /**
- * Constructor.
- *
- * @param domain
- * the domain
- * @param label
- * the label
- * @param affectedFiles
- * the affected files
- * @param previousRequest
- * the previous request
- * @param representation
- * the representation
- */
- public SetNameCommand(TransactionalEditingDomain domain, String label, List<?> affectedFiles, CreateElementRequest previousRequest, NewElementRepresentation representation) {
- super(domain, label, affectedFiles);
- this.representation = representation;
- }
-
- /**
- * Do execute with result.
- *
- * @param monitor
- * the monitor
- * @param info
- * the info
- * @return the command result
- * @throws ExecutionException
- * the execution exception
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(representation.getEObject() instanceof NamedElement) {
- NamedElement el = (NamedElement)representation.getEObject();
- el.setName(representation.getName());
- }
-
- return CommandResult.newOKCommandResult(representation);
- }
-
- }
-
- /**
- * This command allows to create a new element when its parent is not yet created when the command is build
- *
- * We need a such command, because {@link CreateRelationshipCommand#getCommandResult()} return <code>null</code> when the command has not been
- * executed.
- */
- public class CustomCreateElementCommand extends AbstractTransactionalCommand {
-
- /** the representation of the element to create. */
- private NewElementRepresentation elementToCreate;
-
- /**
- * Constructor.
- *
- * @param domain
- * the domain
- * @param label
- * the label
- * @param affectedFiles
- * the affected files
- * @param elementToCreate
- * the element to create
- */
- public CustomCreateElementCommand(TransactionalEditingDomain domain, String label, List<?> affectedFiles, NewElementRepresentation elementToCreate) {
- super(domain, label, affectedFiles);
- this.elementToCreate = elementToCreate;
- }
-
- /**
- * Do execute with result.
- *
- * @param monitor
- * the monitor
- * @param info
- * the info
- * @return the command result
- * @throws ExecutionException
- * the execution exception
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- EObject container = elementToCreate.getEObjectParent();
- CreateElementRequest request = new CreateElementRequest(domain, container, hintedType);
- ICommand command = getCommand(request);
- command.execute(new NullProgressMonitor(), null);
- EObject newEl = request.getNewElement();
-
- if(newEl instanceof NamedElement) {
- ((NamedElement)newEl).setName(elementToCreate.getName());
- }
-
- elementToCreate.setCreateElement(request.getNewElement());
- return CommandResult.newOKCommandResult(elementToCreate);
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/ui/InterfaceManagerDialog.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/ui/InterfaceManagerDialog.java
deleted file mode 100644
index fab3b10a89f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/ui/InterfaceManagerDialog.java
+++ /dev/null
@@ -1,1053 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.core.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.core.services.ServiceException;
-import org.eclipse.papyrus.core.utils.ServiceUtils;
-import org.eclipse.papyrus.diagram.common.Activator;
-import org.eclipse.papyrus.diagram.common.providers.EditorLabelProvider;
-import org.eclipse.papyrus.diagram.common.util.Util;
-import org.eclipse.papyrus.diagram.common.util.Visitor;
-import org.eclipse.papyrus.diagram.component.custom.messages.Messages;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.papyrus.widgets.editors.IElementSelector;
-import org.eclipse.papyrus.widgets.editors.SelectionEditor;
-import org.eclipse.papyrus.widgets.providers.IStaticContentProvider;
-import org.eclipse.papyrus.widgets.selectors.ReferenceSelector;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Namespace;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Realization;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.Usage;
-
-
-/**
- *
- * This class provides a Dialog to manage easily the provided and the required Interfaces for a {@link Port}
- *
- *
- */
-public class InterfaceManagerDialog extends SelectionDialog {
-
- /** the selected port */
- private Port port;
-
- /** the list of the provided interfaces */
- private List<Object> providedInterfaces;
-
- /** the list of the required interfaces */
- private List<Object> requiredInterfaces;
-
- /** the {@link ReferenceSelector} for the provided interfaces */
- private ReferenceSelector providedSelector;
-
- /** the {@link ReferenceSelector} for the required interfaces */
- private ReferenceSelector requiredSelector;
-
- /** the Editor for the provided interfaces */
- private SelectionEditor providedEditor;
-
- /** the Editor for the required interfaces */
- private SelectionEditor requiredEditor;
-
- /**
- * In this map, we link the {@link Interface} with their {@link Usage} This map is used when we want remove an Interface from a Usage
- */
- private Map<Interface, List<Usage>> requiredInterfacesMappedWithUsage = new HashMap<Interface, List<Usage>>();
-
- /**
- * In this map, we link the {@link Interface} with their {@link Realization} This map is used when we want remove an Interface from a Realization
- */
- private Map<Interface, List<Realization>> providedInterfacesMappedWithRealization = new HashMap<Interface, List<Realization>>();
-
- /** the label provider for selector */
- private final ILabelProvider selectorLabelProvider = new SelectorLabelProvider();
-
- /** the label provider for the create new element dialog */
- private final ILabelProvider newElementLabelProvider = new CreateElementLabelProvider();
-
- /** the domain used for the commands */
- private TransactionalEditingDomain domain;
-
- /** the model */
- private Package model = null;
-
- /** this command contains the list of the command to create the new Interfaces */
- private CompoundCommand interfaceCreationCommand = new CompoundCommand("Create Interfaces Commands"); //$NON-NLS-1$
-
- /** This list contains representation of the Interface before their creation */
- private List<NewElementRepresentation> interfaceRepresentations;
-
- /** boolean used to know if the {@link Port} is typed with an {@link Interface} */
- private boolean typedWithInterface;
-
- /** path for the warning icons */
- private static final String ICON_WARNING = "/icons/warning.gif"; //$NON-NLS-1$
-
- /**
- * This list contains the names used for the new elements.
- * We need to remember these names are used in order don't suggest them when we create other new elements
- */
- private List<String> forbiddenNames;
-
- /**
- *
- * Constructor.
- *
- * @param parentShell
- * the parent {@link Shell}
- * @param port
- * the {@link Port} for which we want manage the Interfaces
- */
- public InterfaceManagerDialog(Shell parentShell, Port port) {
- super(parentShell);
- this.setTitle(Messages.InterfaceManagerDialog_Title);
- this.port = port;
- Assert.isTrue(this.port.getType() instanceof Classifier);
- this.typedWithInterface = (this.port.getType() instanceof Interface);
- }
-
- /**
- *
- * @see org.eclipse.jface.dialogs.Dialog#create()
- *
- */
- @Override
- public void create() {
- super.create();
- init();
- }
-
- /**
- * This method initialize some fields of the class
- */
- protected void init() {
-
- this.forbiddenNames = new ArrayList<String>();
- this.interfaceRepresentations = new ArrayList<NewElementRepresentation>();
- EList<Namespace> namespaces = port.allNamespaces();
- Element el = namespaces.get(namespaces.size() - 1);
- if(el instanceof Package) {
- model = (Package)el;
- } else {
- model = el.getNearestPackage();
- }
-
- //fill the hashmap to link Interfaces with Usage and InterfaceRealization
- buildProvidedInterfaces();
- buildRequiredInterfaces();
-
- //we build the list of the provided interfaces
- this.providedInterfaces = new ArrayList<Object>();
- for(Interface current : this.port.getProvideds()) {
- this.providedInterfaces.add(current);
- }
- //when the port is typed by an Interface, we don't propose this interface in the possible Provided Interfaces list.
- if(typedWithInterface) {
- this.providedInterfaces.remove(this.port.getType());
- }
-
- //we build the list of the required interfaces
- this.requiredInterfaces = new ArrayList<Object>();
- for(Interface current : this.port.getRequireds()) {
- this.requiredInterfaces.add(current);
- }
-
- //initialize the transactional editing domain
- IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editor = activePage.getActiveEditor();
- if(editor instanceof IMultiDiagramEditor) {
- try {
- this.domain = ServiceUtils.getInstance().getTransactionalEditingDomain(((IMultiDiagramEditor)editor).getServicesRegistry());
- } catch (ServiceException e) {
- e.printStackTrace();
- }
- }
-
- //selectors creation
- createSelectors();
- //editors creation
- createEditors();
-
- }
-
-
- /**
- * This method fills the map {@link #requiredInterfacesMappedWithUsage}
- */
- protected void buildRequiredInterfaces() {
- List<?> allUsage = Util.getInstancesFilteredByType(this.model, Usage.class, null);
- List<Classifier> classifiers = new ArrayList<Classifier>();
- classifiers.add((Classifier)this.port.getType());
-
- classifiers.addAll(Util.getAllSuperClasses(null, (Classifier)this.port.getType()));
-
-
- for(Object current : allUsage) {
- Usage usage = (Usage)current;
- for(Classifier classifier : classifiers) {//we test if the current Usage is linked with the type of the Port
- if(usage.getClients().contains(classifier)) {//this Usage concerns the current port
- for(EObject target : usage.getSuppliers()) {
- if(this.port.getRequireds().contains(target)) {
- List<Usage> usages = requiredInterfacesMappedWithUsage.get(target);
- if(usages != null) {
- usages.add(usage);
- } else {
- usages = new ArrayList<Usage>();
- usages.add(usage);
- this.requiredInterfacesMappedWithUsage.put((Interface)target, usages);
- }
- }
- }
- break;
- }
- }
- }
- }
-
- /**
- * This method fills the map {@link #providedInterfacesMappedWithRealization}
- */
- protected void buildProvidedInterfaces() {
- List<?> allRealization = Util.getInstancesFilteredByType(this.model, Realization.class, null);
- List<Classifier> classifiers = new ArrayList<Classifier>();
- classifiers.add((Classifier)this.port.getType());
-
- classifiers.addAll(Util.getAllSuperClasses(null, (Classifier)this.port.getType()));
-
-
- for(Object current : allRealization) {
- Realization realization = (Realization)current;
- for(Classifier classifier : classifiers) {//we test if the current Realization is linked with the type of the Port
- if(realization.getClients().contains(classifier)) {//this Realization concerns the current port
- for(EObject target : realization.getSuppliers()) {
- if(this.port.getProvideds().contains(target)) {
- List<Realization> realizations = providedInterfacesMappedWithRealization.get(target);
- if(realizations != null) {
- realizations.add(realization);
- } else {
- realizations = new ArrayList<Realization>();
- realizations.add(realization);
- this.providedInterfacesMappedWithRealization.put((Interface)target, realizations);
- }
- }
- }
- break;
- }
- }
- }
- }
-
- /**
- * This method creates the selectors {@link #providedSelector} and {@link #requiredSelector}
- */
- protected void createSelectors() {
- //the provided selector
- this.providedSelector = new ReferenceSelector(true);
- this.providedSelector.setLabelProvider(selectorLabelProvider);
- this.providedSelector.setContentProvider(new IStaticContentProvider() {
-
- /**
- *
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- *
- * @param viewer
- * @param oldInput
- * @param newInput
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- *
- */
- public void dispose() {
-
- }
-
- /**
- *
- * @see org.eclipse.papyrus.editors.providers.IStaticContentProvider#getElements()
- *
- * @return
- */
- public Object[] getElements() {
- List<Object> tmp = new ArrayList<Object>();
- tmp.addAll(getAllAvailableInterfaces(model));
- if(typedWithInterface) {
- tmp.remove(port.getType());
- }
- //we add the new interfaces which are not yet created
- tmp.addAll(interfaceRepresentations);
- return tmp.toArray();
- }
- });
- //the required selector
- this.requiredSelector = new ReferenceSelector(true);
- this.requiredSelector.setLabelProvider(selectorLabelProvider);
- this.requiredSelector.setContentProvider(new IStaticContentProvider() {
-
- /**
- *
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- *
- * @param viewer
- * @param oldInput
- * @param newInput
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- *
- */
- public void dispose() {
-
- }
-
- /**
- *
- * @see org.eclipse.papyrus.editors.providers.IStaticContentProvider#getElements()
- *
- * @return
- */
- public Object[] getElements() {
- List<Object> tmp = new ArrayList<Object>();
- tmp.addAll(getAllAvailableInterfaces(model));
-
- //we add the new interfaces which are not yet created
- tmp.addAll(interfaceRepresentations);
- return tmp.toArray();
- }
- });
- }
-
-
- /**
- * This method create the 2 Editors {@link #providedEditor} and {@link #requiredEditor} and provides the listener for the button of these editors
- */
- protected void createEditors() {
- Composite parent = (Composite)getDialogArea();
- CreateButtonListener listener = new CreateButtonListener();
- //we set a specific message if the port is typed with an Interface
- if(typedWithInterface) {
- Composite messageSection = new Composite(parent, SWT.BORDER);
- CLabel label = new CLabel(messageSection, SWT.NONE);
-
- label.setText(Messages.InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage);
- Image errorImage = Activator.getPluginIconImage(Activator.ID, ICON_WARNING);
- label.setImage(errorImage);
- GridLayout layout = new GridLayout(1, true);
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
- messageSection.setLayout(layout);
- messageSection.setLayoutData(data);
- messageSection.setEnabled(false);
- }
- this.providedEditor = createEditor(parent, providedSelector, Messages.InterfaceManagerDialog_SelectedTheProvidedInterfaces, false, listener, this.providedInterfaces);
- this.requiredEditor = createEditor(parent, requiredSelector, Messages.InterfaceManagerDialog_SelectTheRequiredInterfaces, true, listener, this.requiredInterfaces);
-
- this.providedEditor.create();
- this.requiredEditor.create();
-
- GridLayout layout = (GridLayout)parent.getLayout();
- layout.numColumns = 1;
- layout.makeColumnsEqualWidth = true;
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
- this.providedEditor.setLayoutData(data);
- this.requiredEditor.setLayoutData(data);
- getShell().setSize(950, 700);
- getShell().layout();
- }
-
- /**
- * Creates a {@link SelectionEditor} and returns it
- *
- * @param parent
- * the composite parent
- * @param selector
- * the selector used by the created editor
- * @param message
- * the message to display in the created editor
- * @param withCreateButton
- * indicates if the editor provides an additional button for a specific action
- * @param listener
- * the listener for the button
- * @param initialSelection
- * the initial selection for this editor
- * @return
- * the created {@link SelectionEditor}
- */
- protected SelectionEditor createEditor(Composite parent, IElementSelector selector, String message, boolean withCreateButton, SelectionListener listener, List<Object> initialSelection) {
- SelectionEditor editor = new SelectionEditor(parent, selector, selectorLabelProvider, initialSelection);
- editor.setMessage(message);
- editor.setAdditionalButton(withCreateButton, Messages.InterfaceManagerDialog_CreateNewInterface, listener);
- return editor;
- }
-
- /**
- * Returns all the available Interfaces
- *
- * @return
- * all the available Interfaces
- * //TODO add the interfaces of the package import!
- */
- @SuppressWarnings("unchecked")
- protected List<Interface> getAllAvailableInterfaces(Package pack) {
- List<Interface> otherInterfaces = new ArrayList<Interface>();
- List<Element> interfaces = Visitor.getOwnedAndImportedElement(pack, Interface.class);
- for(Namespace namespace : Visitor.getOwnedAndImportedNamespaces(pack)) {
- interfaces.addAll(Visitor.getOwnedAndImportedElement(namespace, Interface.class));
-
- }
-
- for(Element element : interfaces) {
- otherInterfaces.add((Interface)element);
- }
-
- return otherInterfaces;
- }
-
- /**
- * Returns the commands to apply the changes
- *
- * @return
- * the commands to apply the changes
- */
- public Command getCommand() {
- CompoundCommand command = new CompoundCommand("Command to manage interfaces on Port"); //$NON-NLS-1$
- if(!interfaceCreationCommand.isEmpty()) {
- command.add(interfaceCreationCommand);
- }
- Command cmd = getCommandsToCreateElements();
- if(cmd.canExecute()) {
- command.add(cmd);
- }
- cmd = getCommandToRemoveReferencedInterfaces();
- if(cmd.canExecute()) {
- command.add(cmd);
- }
- return command;
- }
-
- /**
- * Returns the command to remove referenced Interfaces in Usage and InterfaceRealization
- *
- * @return
- * The command to remove referenced Interfaces the Usage and InterfaceRealization.
- * Moreover, we add a command to destroy Usage and InterfaceRealization when they have any Suppliers after this action
- */
- protected Command getCommandToRemoveReferencedInterfaces() {
- CompoundCommand command = new CompoundCommand("Command to destroy Usage and InterfaceRealization"); //$NON-NLS-1$
-
- Set<Dependency> relationshipToDestroy = new HashSet<Dependency>();
- //commands to destroy Usage
- for(Object current : this.requiredEditor.getElementToRemove()) {
- //we get all usage associated with this interface
- List<Usage> usages = requiredInterfacesMappedWithUsage.get(current);
- for(Usage currentUsage : usages) {
- //we remove the reference to the Interface in the Usage
- DestroyReferenceRequest request = new DestroyReferenceRequest(domain, currentUsage, UMLPackage.eINSTANCE.getDependency_Supplier(), (EObject)current, false);
- Command cmd = getCommand(request);
- if(cmd.canExecute()) {
- command.add(cmd);
- relationshipToDestroy.add(currentUsage);
- }
- }
- }
-
- //commands to destroy InterfaceRealization
- for(Object current : this.providedEditor.getElementToRemove()) {
- //we get all usage associated with this interface
- List<Realization> realizations = providedInterfacesMappedWithRealization.get(current);
- for(Realization currentRealization : realizations) {
- //we remove the reference to the Interface in the Usage
- DestroyReferenceRequest request = new DestroyReferenceRequest(domain, currentRealization, UMLPackage.eINSTANCE.getDependency_Supplier(), (EObject)current, false);
- Command cmd = getCommand(request);
- if(cmd.canExecute()) {
- command.add(cmd);
- relationshipToDestroy.add(currentRealization);
- }
- }
- }
- if(!relationshipToDestroy.isEmpty()) {
- command.add(new ICommandProxy(new DestroyDependencyWithoutSupplierCommand(this.domain, null, relationshipToDestroy)));
- return command;
- }
-
- //nothing to do
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Returns the command to create new Usage and new InterfaceRealization
- *
- * @return
- * the command to create new Usage and new InterfaceRealization
- */
- protected Command getCommandsToCreateElements() {
- CompoundCommand command = new CompoundCommand("Command to create Usage and InterfaceRealization"); //$NON-NLS-1$
- //commands for Usage Creation
- for(Object current : this.requiredEditor.getElementToAdd()) {
- if(current instanceof EObject) {
- CreateRelationshipRequest request = new CreateRelationshipRequest(this.port.getType().eContainer(), this.port.getType(), (EObject)current, org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.USAGE);
- Command cmd = getCommand(request);
- if(cmd.canExecute()) {
- command.add(cmd);
- }
- } else {//its an NewElementRepresentation
-
- CreateUsageCommand cmd = new CreateUsageCommand(this.domain, this.port.getType().eContainer(), this.port.getType(), (NewElementRepresentation)current, null);
- if(cmd.canExecute()) {
- command.add(new ICommandProxy(cmd));
- }
- }
- }
-
- //commands for InterfaceRealization Creation
- for(Object current : providedEditor.getElementToAdd()) {
- if(current instanceof EObject) {
- CreateRelationshipRequest request = new CreateRelationshipRequest(this.port.getType(), this.port.getType(), (EObject)current, org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.INTERFACE_REALIZATION);
- Command cmd = getCommand(request);
- if(cmd.canExecute()) {
- command.add(cmd);
- }
- } else {//its an NewElementRepresentation
- CreateInterfaceRealizationCommand cmd = new CreateInterfaceRealizationCommand(this.domain, this.port.getType(), this.port.getType(), (NewElementRepresentation)current, null);
- if(cmd.canExecute()) {
- command.add(new ICommandProxy(cmd));
- }
- }
- }
- if(!command.isEmpty()) {
- return command;
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * Return the command corresponding to the request
- *
- * @param req
- * a request
- * @return
- * the command corresponding to the request
- */
- protected Command getCommand(AbstractEditCommandRequest req) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(model);
- if(provider != null) {
- ICommand setCommand = provider.getEditCommand(req);
- if(setCommand != null) {
- return new ICommandProxy(setCommand.reduce());
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * This listener is used to know when the user clicks on the Button to create a new {@link Interface}
- *
- *
- *
- */
- public class CreateButtonListener implements SelectionListener {
-
- /**
- *
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- *
- * @param e
- */
- public void widgetSelected(SelectionEvent e) {
- CreateUmlElementDialog dialog = new CreateUmlElementDialog(getShell(), domain, newElementLabelProvider, new CustomContentProvider(), model, UMLElementTypes.INTERFACE);
- dialog.setTitle(Messages.InterfaceManagerDialog_CreateANewInterface);
- dialog.setMessage(Messages.InterfaceManagerDialog_SelectTheParentOfThisNewInterface);
- dialog.setHelpAvailable(false);
- dialog.setForbiddenNames(forbiddenNames);
- List<Object> input = new ArrayList<Object>();
- input.add(model);
- dialog.setInput(input);
- dialog.setValidator(new ParentInterfaceValidator());
- if(dialog.open() == org.eclipse.jface.dialogs.Dialog.OK) {
- interfaceCreationCommand.add(dialog.getCommand());
- Object[] res = dialog.getResult();
- for(Object current : res) {
- if(current instanceof NewElementRepresentation) {
- interfaceRepresentations.add((NewElementRepresentation)current);
- forbiddenNames.add(((NewElementRepresentation)current).getName());
- }
- }
- providedSelector.refresh();
- requiredSelector.refresh();
- }
- }
-
- /**
- *
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
- *
- * @param e
- */
- public void widgetDefaultSelected(SelectionEvent e) {
-
- }
-
- }
-
-
- /**
- *
- * This class provides a validator for the selection of the parent of the new Interface
- *
- *
- */
- public class ParentInterfaceValidator implements ISelectionStatusValidator {
-
- /**
- * Selection has to be a Classifier or an Interface to allow creation
- *
- * @see org.eclipse.ui.dialogs.ISelectionStatusValidator#validate(java.lang.Object[])
- *
- * @param selection
- * @return
- */
- public IStatus validate(Object[] selection) {
-
- IStatus status = new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, Messages.NoSelectionFound);
- if(selection.length >= 1) {
- for(int i = 0; i < selection.length; i++) {
- if(selection[i] instanceof Package || selection[i] instanceof Classifier || selection[i] instanceof NewElementRepresentation)
- status = new Status(IStatus.OK, UMLDiagramEditorPlugin.ID, Messages.SelectionValidated);
- else {
- status = new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, Messages.InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier);
- break;
- }
- }
- }
- return status;
- }
- }
-
- /**
- *
- * This class provides a CustomLabelProvider for this dialog.
- * This class manages the {@link NewElementRepresentation} and consider them like Interfaces
- *
- *
- */
- public class SelectorLabelProvider extends CreateElementLabelProvider {
-
-
- /**
- *
- * @see org.eclipse.papyrus.diagram.common.providers.EditorLabelProvider#getText(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public String getText(Object element) {
- if(element instanceof NewElementRepresentation) {
- return ((NewElementRepresentation)element).getQualifiedName();
- } else if(element instanceof NamedElement) {
- return ((NamedElement)element).getQualifiedName();
- }
- return super.getText(element);
- }
-
- }
-
- public class CreateElementLabelProvider extends EditorLabelProvider {
-
- /**
- *
- * @see org.eclipse.papyrus.diagram.common.providers.EditorLabelProvider#getImage(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public Image getImage(Object element) {
- if(element instanceof NewElementRepresentation) {
- String imagePath = new String(imageFolder);
- imagePath += "Interface.gif"; //$NON-NLS-1$
- return Activator.getPluginIconImage(pluginID, imagePath);
- }
- return super.getImage(element);
- }
-
- /**
- *
- * @see org.eclipse.papyrus.diagram.common.providers.EditorLabelProvider#getText(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public String getText(Object element) {
- if(element instanceof NewElementRepresentation) {
- return ((NewElementRepresentation)element).getName();
- }
- return super.getText(element);
- }
-
- }
-
- /**
- *
- * This content provider is used in this dialog. It returns the available element in the model + the future element which are
- * {@link NewElementRepresentation}
- *
- *
- */
- public class CustomContentProvider implements ITreeContentProvider {
-
- /**
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- *
- */
- public void dispose() {
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- *
- * @param viewer
- * @param oldInput
- * @param newInput
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
- *
- * @param inputElement
- * @return
- */
- public Object[] getElements(Object inputElement) {
- if(inputElement instanceof List<?>) {
- return ((List<?>)inputElement).toArray();
- }
- return new Object[0];
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- *
- * @param parentElement
- * @return
- */
- public Object[] getChildren(Object parentElement) {
- List<Object> children = new ArrayList<Object>();
- List<?> tmp = null;
- if(parentElement instanceof Package) {
- tmp = ((Package)parentElement).getOwnedMembers();
- } else if(parentElement instanceof Classifier) {
- tmp = ((Classifier)parentElement).getOwnedMembers();
- }
- if(tmp != null) {
- for(Object current : tmp) {
- if(current instanceof Classifier || current instanceof Package) {
- children.add(current);
- }
- }
- }
- //we add the future Interfaces to this selection
- for(NewElementRepresentation current : interfaceRepresentations) {
- if(current.getParent() == parentElement) {
- children.add(current);
- }
- }
- return children.toArray();
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- *
- * @param element
- * @return
- */
- public Object getParent(Object element) {
- if(element == model) {
- return model;
- } else if(element instanceof NamedElement) {
- return ((NamedElement)element).eContainer();
- }
- return null;
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- *
- * @param element
- * @return
- */
- public boolean hasChildren(Object element) {
- return getChildren(element).length != 0;
- }
-
- }
-
- /**
- *
- * This command is used to create a New Usage, when its target (an Interface) doesn't exist when the command is created
- * (but this Interface will exist when the command will be executed)
- *
- *
- */
- public class CreateUsageCommand extends AbstractTransactionalCommand {
-
- /** The container for the new Usage */
- private EObject container;
-
- /** the source of this Usage */
- private EObject source;
-
- /** the target : the representation of the new interface */
- private NewElementRepresentation target;
-
- /**
- *
- * Constructor.
- *
- * @param domain
- * the domain
- * @param container
- * the container for the Usage
- * @param source
- * the source for the Usage
- * @param target
- * the target for the Usage
- * @param affectedFiles
- * the affected files
- */
- public CreateUsageCommand(TransactionalEditingDomain domain, EObject container, EObject source, NewElementRepresentation target, List<?> affectedFiles) {
- super(domain, "Create Usage Command", affectedFiles); //$NON-NLS-1$
- this.container = container;
- this.source = source;
- this.target = target;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
- * @param monitor
- * @param info
- * @return
- * @throws ExecutionException
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CreateRelationshipRequest request = new CreateRelationshipRequest(domain, container, source, target.getEObject(), org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.USAGE);
- Command command = getCommand(request);
- if(command.canExecute()) {
- command.execute();
- }
- return CommandResult.newOKCommandResult(request.getNewElement());
- }
-
- }
-
- /**
- *
- * This command is used to create a New InterfaceRealition, when its target (an Interface) doesn't exist when the command is created
- * (but this Interface will exist when the command will be executed)
- *
- *
- */
- public class CreateInterfaceRealizationCommand extends AbstractTransactionalCommand {
-
- /** The container for the new InterfaceRealization */
- private EObject container;
-
- /** The source for the new InterfaceRealization */
- private EObject source;
-
- /** the target : the representation of the new interface */
- private NewElementRepresentation target;
-
- /**
- *
- * Constructor.
- *
- * @param domain
- * the domain
- * @param container
- * the container for the InterfaceRealization
- * @param source
- * the source for the InterfaceRealization
- * @param target
- * the target for the InterfaceRealization
- * @param affectedFiles
- * the affected files
- */
- public CreateInterfaceRealizationCommand(TransactionalEditingDomain domain, EObject container, EObject source, NewElementRepresentation target, List<?> affectedFiles) {
- super(domain, "Create InterfaceRealization Command", affectedFiles); //$NON-NLS-1$
- this.container = container;
- this.source = source;
- this.target = target;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
- * @param monitor
- * @param info
- * @return
- * @throws ExecutionException
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- CreateRelationshipRequest request = new CreateRelationshipRequest(domain, container, source, target.getEObject(), org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.INTERFACE_REALIZATION);
- Command command = getCommand(request);
- if(command.canExecute()) {
- command.execute();
- }
- return CommandResult.newOKCommandResult(request.getNewElement());
- }
-
- }
-
- /**
- *
- * This command is used to destroy Dependencies which have any supplier before the deletion of the Interface
- *
- *
- */
- public class DestroyDependencyWithoutSupplierCommand extends AbstractTransactionalCommand {
-
- /**
- * the dependencies to test
- */
- private Set<Dependency> dependencies;
-
- /**
- *
- * Constructor.
- *
- * @param domain
- * the domain
- * @param affectedFiles
- * the affected files
- * @param dependencies
- * the dependencies to test
- */
- public DestroyDependencyWithoutSupplierCommand(TransactionalEditingDomain domain, List<?> affectedFiles, Set<Dependency> dependencies) {
- super(domain, "Destroy the empty elements", affectedFiles); //$NON-NLS-1$
- this.dependencies = dependencies;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
- * @param monitor
- * @param info
- * @return
- * @throws ExecutionException
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CompoundCommand command = new CompoundCommand("Destroy relationship without suppliers"); //$NON-NLS-1$
- for(Dependency current : dependencies) {
- if(current.getSuppliers().isEmpty()) {
- DestroyElementRequest request = new DestroyElementRequest(domain, current, false);
- Command cmd = getCommand(request);
- if(cmd.canExecute()) {
- command.add(cmd);
- }
- }
- }
-
- if(!command.isEmpty() && command.canExecute()) {
- command.execute();
- }
- return CommandResult.newOKCommandResult();
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/ui/NewElementRepresentation.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/ui/NewElementRepresentation.java
deleted file mode 100644
index d3214c75234..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/custom/ui/NewElementRepresentation.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.custom.ui;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.uml2.uml.NamedElement;
-
-/**
- * This class provides facilities to represent a New Element before its real creation.
- * We can store in this class :
- * <ul>
- * <li>the name of the new element</li>
- * <li>the parent of the new element</li>
- * <li>the {@link IHintedType} of the new element</li>
- * <li>the request to build the new element (optional)</li>
- * <li>the element itself when it has been created</li>
- * </ul>
- *
- *
- *
- */
-public class NewElementRepresentation {
-
- /** the name of the new element */
- private String name;
-
- /** the parent of the new element */
- private Object parent;
-
- /** the created element itself */
- private EObject createdElement;
-
- /** the {@link IHintedType} of the new element */
- private IHintedType hintedType;
-
- /** this field is used only when the element have an existing parent */
- private CreateElementRequest request;
-
- /**
- *
- * Constructor.
- *
- * @param name
- * the name of the new element
- * @param parent
- * the parent of the new element
- * @param hintedType
- * the hinted type of the new element
- * @param request
- * the request to build the new element (can be <code>null</code>)
- */
- public NewElementRepresentation(String name, Object parent, IHintedType hintedType, CreateElementRequest request) {
- this.name = name;
- this.parent = parent;
- this.createdElement = null;
- this.hintedType = hintedType;
- this.request = request;
- }
-
- /**
- * Getter for {@link #hintedType}
- *
- * @return
- * {@link #hintedType}
- */
- public IHintedType getHintedType() {
- return this.hintedType;
- }
-
- /**
- * Getter for {@link #name}
- *
- * @return
- * {@link #name}
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * Getter for {@link #parent}
- *
- * @return
- * {@link #parent}
- */
- public Object getParent() {
- return this.parent;
- }
-
- /**
- * Returns the parent of this element
- *
- * @return
- * the parent of this element or <code>null</code> if the parent is a {@link NewElementRepresentation} itself and if it has not been
- * created
- */
- public EObject getEObjectParent() {
- if(parent instanceof EObject) {
- return (EObject)this.parent;
- } else if(parent instanceof NewElementRepresentation) {
- return ((NewElementRepresentation)parent).getEObject();
- }
- return null;
- }
-
- /**
- * Returns the created object
- *
- * @return
- * the created Object or <code>null</code> if the object has not been created
- */
- public EObject getEObject() {
- if(this.request != null) {
- return this.request.getNewElement();
- }
- return this.createdElement;
- }
-
- /**
- * Setter for {@link #createdElement}
- *
- * @param newElement
- *
- */
- public void setCreateElement(EObject newElement) {
- this.createdElement = newElement;
- }
-
- /**
- * Setter for {@link #request}
- *
- * @return
- * {@link #request}
- */
- public CreateElementRequest getCreateElementRequest() {
- return this.request;
- }
-
- /**
- *
- * @see java.lang.Object#toString()
- *
- * @return
- */
- @Override
- public String toString() {
- return "Name : " + this.name + ", parent : " + this.parent;
- }
-
- public String getQualifiedName() {
- String qualifiedName = "";
- if(parent instanceof NewElementRepresentation) {
- qualifiedName = ((NewElementRepresentation)parent).getQualifiedName();
- } else if(parent instanceof NamedElement) {
- qualifiedName = ((NamedElement)parent).getQualifiedName() + "::" + this.name;
- }
- return qualifiedName;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/preferences/CommentAnnotatedElementPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/preferences/CommentAnnotatedElementPreferencePage.java
deleted file mode 100644
index 230dd1637e2..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/preferences/CommentAnnotatedElementPreferencePage.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-// TODO: Auto-generated Javadoc
-/**
- * Preference page for CommentAnnotatedElement notation element.
- * Currently not generated.
- */
-public class CommentAnnotatedElementPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * Instantiates a new comment annotated element preference page.
- *
- * @generated
- */
- public CommentAnnotatedElementPreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_CommentAnnotatedElement");
- }
-
- /**
- * Gets the bundle id.
- *
- * @return the bundle id
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * Inits the defaults.
- *
- * @param store the store
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/preferences/ConstraintConstrainedElementPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/preferences/ConstraintConstrainedElementPreferencePage.java
deleted file mode 100644
index 7f8fadccf34..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/custom-src/org/eclipse/papyrus/diagram/component/preferences/ConstraintConstrainedElementPreferencePage.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-// TODO: Auto-generated Javadoc
-/**
- * Preference page for ConstraintConstrainedElement notation element.
- * Currently not generated.
- */
-public class ConstraintConstrainedElementPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * Instantiates a new constraint constrained element preference page.
- *
- * @generated
- */
- public ConstraintConstrainedElementPreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_ConstraintConstrainedElement");
- }
-
- /**
- * Gets the bundle id.
- *
- * @return the bundle id
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * Inits the defaults.
- *
- * @param store the store
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/incomingLinksNavigatorGroup.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/incomingLinksNavigatorGroup.gif
deleted file mode 100644
index fca9c53e629..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/incomingLinksNavigatorGroup.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/linkSourceNavigatorGroup.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/linkSourceNavigatorGroup.gif
deleted file mode 100644
index fca9c53e629..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/linkSourceNavigatorGroup.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/linkTargetNavigatorGroup.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/linkTargetNavigatorGroup.gif
deleted file mode 100644
index fca9c53e629..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/linkTargetNavigatorGroup.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/linksNavigatorGroup.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/linksNavigatorGroup.gif
deleted file mode 100644
index fca9c53e629..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/linksNavigatorGroup.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Abstraction.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Abstraction.gif
deleted file mode 100644
index 38df3e62097..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Abstraction.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ArtifactIcon.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ArtifactIcon.gif
deleted file mode 100644
index f0c7d31c50a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ArtifactIcon.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Comment.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Comment.gif
deleted file mode 100644
index c495731c682..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Comment.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Component.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Component.gif
deleted file mode 100644
index 56b94fc30b6..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Component.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ComponentDiagram.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ComponentDiagram.gif
deleted file mode 100644
index 75f02269636..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ComponentDiagram.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ComponentIcon.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ComponentIcon.gif
deleted file mode 100644
index 72575f10ff5..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ComponentIcon.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ComponentRealization.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ComponentRealization.gif
deleted file mode 100644
index 14cdfbbe2f1..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/ComponentRealization.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Constraint.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Constraint.gif
deleted file mode 100644
index eed6acec1ee..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Constraint.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Dependency.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Dependency.gif
deleted file mode 100644
index add6dec9b61..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Dependency.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Generalization.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Generalization.gif
deleted file mode 100644
index 6f3189ac5aa..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Generalization.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/InterfaceAsCercle.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/InterfaceAsCercle.gif
deleted file mode 100644
index 517996a6530..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/InterfaceAsCercle.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/InterfaceRealization.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/InterfaceRealization.gif
deleted file mode 100644
index e73f5788ced..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/InterfaceRealization.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Link.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Link.gif
deleted file mode 100644
index 13fb22e4bfe..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Link.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Manifestation.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Manifestation.gif
deleted file mode 100644
index 0aff25b401d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Manifestation.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Nodes.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Nodes.gif
deleted file mode 100644
index 047a553f7f0..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Nodes.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Operation.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Operation.gif
deleted file mode 100644
index 482a4d51abb..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Operation.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Package.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Package.gif
deleted file mode 100644
index e79ecca80f4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Package.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Port.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Port.gif
deleted file mode 100644
index 43d235b47e9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Port.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Realization.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Realization.gif
deleted file mode 100644
index 81880dda556..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Realization.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Substitution.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Substitution.gif
deleted file mode 100644
index e86854e07cf..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Substitution.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/UMLDiagramFile.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/UMLDiagramFile.gif
deleted file mode 100644
index de938070dea..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/UMLDiagramFile.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Usage.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Usage.gif
deleted file mode 100644
index 6f8d212ebc4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/obj16/Usage.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/outgoingLinksNavigatorGroup.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/outgoingLinksNavigatorGroup.gif
deleted file mode 100644
index fca9c53e629..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/outgoingLinksNavigatorGroup.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/icons/wizban/NewUMLWizard.gif b/incoming/org.eclipse.papyrus.diagram.component/icons/wizban/NewUMLWizard.gif
deleted file mode 100644
index 83e03bf39bf..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/icons/wizban/NewUMLWizard.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.component/messages.properties b/incoming/org.eclipse.papyrus.diagram.component/messages.properties
deleted file mode 100644
index 8eacb0b5c9a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/messages.properties
+++ /dev/null
@@ -1,244 +0,0 @@
-
-# TODO: manually put keys and values
-UMLCreationWizardTitle=New PapyrusUMLComponentDiagram Diagram
-UMLCreationWizard_DiagramModelFilePageTitle=Create PapyrusUMLComponentDiagram Diagram
-UMLCreationWizard_DiagramModelFilePageDescription=Select file that will contain diagram model.
-UMLCreationWizard_DomainModelFilePageTitle=Create PapyrusUMLComponentDiagram Domain Model
-UMLCreationWizard_DomainModelFilePageDescription=Select file that will contain domain model.
-UMLCreationWizardOpenEditorError=Error opening diagram editor
-UMLCreationWizardCreationError=Creation Problems
-UMLCreationWizardPageExtensionError=File name should have {0} extension.
-UMLDiagramEditorUtil_OpenModelResourceErrorDialogTitle=Error
-UMLDiagramEditorUtil_OpenModelResourceErrorDialogMessage=Failed to load model file {0}
-UMLDiagramEditorUtil_CreateDiagramProgressTask=Creating diagram and model files
-UMLDiagramEditorUtil_CreateDiagramCommandLabel=Creating diagram and model
-UMLDocumentProvider_isModifiable=Updating cache failed
-UMLDocumentProvider_handleElementContentChanged=Failed to refresh hierarchy for changed resource
-UMLDocumentProvider_IncorrectInputError={1}
-UMLDocumentProvider_NoDiagramInResourceError=Diagram is not present in resource
-UMLDocumentProvider_DiagramLoadingError=Error loading diagram
-UMLDocumentProvider_UnsynchronizedFileSaveError=The file has been changed on the file system
-UMLDocumentProvider_SaveDiagramTask=Saving diagram
-UMLDocumentProvider_SaveNextResourceTask=Saving {0}
-UMLDocumentProvider_SaveAsOperation=Saving {0} diagram as
-InitDiagramFile_ResourceErrorDialogTitle=Error
-InitDiagramFile_ResourceErrorDialogMessage=Model file loading failed
-InitDiagramFile_WizardTitle=Initialize new {0} diagram file
-InitDiagramFile_OpenModelFileDialogTitle=Select domain model
-UMLNewDiagramFileWizard_CreationPageName=Initialize new diagram file
-UMLNewDiagramFileWizard_CreationPageTitle=Diagram file
-UMLNewDiagramFileWizard_CreationPageDescription=Create new diagram based on {0} model content
-UMLNewDiagramFileWizard_RootSelectionPageName=Select diagram root element
-UMLNewDiagramFileWizard_RootSelectionPageTitle=Diagram root element
-UMLNewDiagramFileWizard_RootSelectionPageDescription=Select semantic model element to be depicted on diagram
-UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle=Select diagram root element:
-UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage=Diagram root element is not selected
-UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage=Invalid diagram root element is selected
-UMLNewDiagramFileWizard_InitDiagramCommand=Initializing diagram contents
-UMLNewDiagramFileWizard_IncorrectRootError=Incorrect model object stored as a root resource object
-UMLDiagramEditor_SavingDeletedFile=The original file "{0}" has been deleted.
-UMLDiagramEditor_SaveAsErrorTitle=Problem During Save As...
-UMLDiagramEditor_SaveAsErrorMessage=Save could not be completed. Target file is already open in another editor.
-UMLDiagramEditor_SaveErrorTitle=Save Problems
-UMLDiagramEditor_SaveErrorMessage=Could not save file.
-UMLElementChooserDialog_SelectModelElementTitle=Select model element
-ModelElementSelectionPageMessage=Select model element:
-ValidateActionMessage=Validate
-Nodes1Group_title=Nodes
-Nodes1Group_desc=Diagram Nodes
-Links2Group_title=Links
-Links2Group_desc=Diagram Links
-Package1CreationTool_title=Package
-Package1CreationTool_desc=Create a Package
-Component2CreationTool_title=Component
-Component2CreationTool_desc=Create a Component
-InterfaceasCercle3CreationTool_title=Interface as Cercle
-InterfaceasCercle3CreationTool_desc=Create an Interface as a cercle
-Interface4CreationTool_title=Interface
-Interface4CreationTool_desc=Create an Interface
-Property5CreationTool_title=Property
-Property5CreationTool_desc=Create a Property
-Operation6CreationTool_title=Operation
-Operation6CreationTool_desc=Create an Operation
-NestedClassifier7CreationTool_title=Nested Classifier
-NestedClassifier7CreationTool_desc=Create a Nested Classifier
-Requirementlink1CreationTool_title=Requirement link
-Requirementlink1CreationTool_desc=Create a Requirement link
-Providinglink2CreationTool_title=Providing link
-Providinglink2CreationTool_desc=Create a Providing link
-Generalization3CreationTool_title=Generalization
-Generalization3CreationTool_desc=Create a Generalization link
-InterfaceAttributeCompartmentEditPart_title=AttributeCompartment
-InterfaceOperationCompartmentEditPart_title=OperationCompartment
-InterfaceNestedClassifierCompartementEditPart_title=NestedClassifierCompartement
-PackagePackageContentsCompartmentEditPart_title=PackageContentsCompartment
-InterfaceAttributeCompartment2EditPart_title=AttributeCompartment
-InterfaceOperationCompartment2EditPart_title=OperationCompartment
-InterfaceNestedClassifierCompartement2EditPart_title=NestedClassifierCompartement
-
-CommandName_OpenDiagram=Open Diagram
-NavigatorGroupName_Usage_4001_target=target
-NavigatorGroupName_Usage_4001_incominglinks=incoming links
-NavigatorGroupName_Usage_4001_source=source
-NavigatorGroupName_Usage_4001_outgoinglinks=outgoing links
-NavigatorGroupName_Interface_2002_incominglinks=incoming links
-NavigatorGroupName_Interface_2002_outgoinglinks=outgoing links
-NavigatorGroupName_Component_2001_incominglinks=incoming links
-NavigatorGroupName_Component_2001_outgoinglinks=outgoing links
-NavigatorGroupName_Generalization_4003_target=target
-NavigatorGroupName_Generalization_4003_source=source
-NavigatorGroupName_Realization_4002_target=target
-NavigatorGroupName_Realization_4002_incominglinks=incoming links
-NavigatorGroupName_Realization_4002_source=source
-NavigatorGroupName_Realization_4002_outgoinglinks=outgoing links
-NavigatorGroupName_Component_3004_incominglinks=incoming links
-NavigatorGroupName_Component_3004_outgoinglinks=outgoing links
-NavigatorGroupName_Model_1000_links=links
-NavigatorGroupName_Interface_3005_incominglinks=incoming links
-NavigatorGroupName_Interface_3005_outgoinglinks=outgoing links
-NavigatorGroupName_Package_2003_incominglinks=incoming links
-NavigatorGroupName_Package_2003_outgoinglinks=outgoing links
-NavigatorActionProvider_OpenDiagramActionName=Open Diagram
-AbstractParser_UnexpectedValueType=Value of type {0} is expected
-AbstractParser_WrongStringConversion=String value does not convert to {0} value
-AbstractParser_UnknownLiteral=Unknown literal: {0}
-
-MessageFormatParser_InvalidInputError=Invalid input at {0}
-UMLModelingAssistantProviderTitle=Select domain model element
-UMLModelingAssistantProviderMessage=Available domain model elements:
-NavigatorGroupName_Interface_2004_incominglinks=incoming links
-NavigatorGroupName_Interface_2004_outgoinglinks=outgoing links
-createNodes1Group_title=Nodes
-createNodes1Group_desc=Diagram Nodes
-createLinks2Group_title=Links
-createLinks2Group_desc=Diagram Links
-createPackage1CreationTool_title=Package
-createPackage1CreationTool_desc=Create a Package
-createComponent2CreationTool_title=Component
-createComponent2CreationTool_desc=Create a Component
-createInterfaceasCercle3CreationTool_title=Interface as Cercle
-createInterfaceasCercle3CreationTool_desc=Create an Interface as a cercle
-createRequirementlink1CreationTool_title=Requirement link
-createRequirementlink1CreationTool_desc=Create a Requirement link
-createProvidinglink2CreationTool_title=Providing link
-createProvidinglink2CreationTool_desc=Create a Providing link
-createGeneralization3CreationTool_title=Generalization
-createGeneralization3CreationTool_desc=Create a Generalization link
-NavigatorGroupName_Interface_3002_incominglinks=incoming links
-NavigatorGroupName_Interface_3002_outgoinglinks=outgoing links
-NavigatorGroupName_Component_3001_incominglinks=incoming links
-NavigatorGroupName_Component_3001_outgoinglinks=outgoing links
-NavigatorGroupName_Interface_2003_incominglinks=incoming links
-NavigatorGroupName_Interface_2003_outgoinglinks=outgoing links
-NavigatorGroupName_Package_2001_incominglinks=incoming links
-NavigatorGroupName_Package_2001_outgoinglinks=outgoing links
-NavigatorGroupName_Component_2002_incominglinks=incoming links
-NavigatorGroupName_Component_2002_outgoinglinks=outgoing links
-createInterface3CreationTool_title=Interface
-createInterface3CreationTool_desc=Create an Interface
-createProperty4CreationTool_title=Property
-createProperty4CreationTool_desc=Create a Property
-createOperation5CreationTool_title=Operation
-createOperation5CreationTool_desc=Create an Operation
-createNestedClassifier6CreationTool_title=Nested Classifier
-createNestedClassifier6CreationTool_desc=Create a Nested Classifier
-createUsage1CreationTool_title=Usage
-createUsage1CreationTool_desc=Create an Usage link
-createRealization2CreationTool_title=Realization
-createRealization2CreationTool_desc=Create a Realization link
-NavigatorGroupName_Realization_4003_target=target
-NavigatorGroupName_Realization_4003_incominglinks=incoming links
-NavigatorGroupName_Realization_4003_source=source
-NavigatorGroupName_Realization_4003_outgoinglinks=outgoing links
-NavigatorGroupName_Generalization_4004_target=target
-NavigatorGroupName_Generalization_4004_source=source
-ModelPackageContentsCompartmentEditPart_title=PackageContentsCompartment
-NavigatorGroupName_Model_2004_incominglinks=incoming links
-NavigatorGroupName_Model_2004_outgoinglinks=outgoing links
-Component1CreationTool_title=Component
-Component1CreationTool_desc=Create a Component
-InterfaceasCercle2CreationTool_title=Interface as Cercle
-InterfaceasCercle2CreationTool_desc=Create an Interface as a cercle
-Interface2CreationTool_title=Interface
-Interface2CreationTool_desc=Create an Interface
-NavigatorGroupName_InterfaceRealization_4004_target=target
-NavigatorGroupName_InterfaceRealization_4004_incominglinks=incoming links
-NavigatorGroupName_InterfaceRealization_4004_source=source
-NavigatorGroupName_InterfaceRealization_4004_outgoinglinks=outgoing links
-Interface23CreationTool_title=Interface 2
-Property4CreationTool_title=Property
-Property4CreationTool_desc=Create a Property
-Operation5CreationTool_title=Operation
-Operation5CreationTool_desc=Create an Operation
-NestedClassifier6CreationTool_title=Nested Classifier
-NestedClassifier6CreationTool_desc=Create a Nested Classifier
-createComponent1CreationTool_title=Component
-createComponent1CreationTool_desc=Create a Component
-createInterface2CreationTool_title=Interface
-createInterface2CreationTool_desc=Create an Interface
-createInterface23CreationTool_title=Interface 2
-NavigatorGroupName_Package_2005_incominglinks=incoming links
-NavigatorGroupName_Package_2005_outgoinglinks=outgoing links
-NavigatorGroupName_Realization_4005_target=target
-NavigatorGroupName_Realization_4005_incominglinks=incoming links
-NavigatorGroupName_Realization_4005_source=source
-NavigatorGroupName_Realization_4005_outgoinglinks=outgoing links
-NavigatorGroupName_InterfaceRealization_4006_target=target
-NavigatorGroupName_InterfaceRealization_4006_source=source
-NavigatorGroupName_InterfaceRealization_4006_outgoinglinks=outgoing links
-createPortCreationTool_title=Port
-createPortCreationTool_desc=Create new Port
-PackagePackageableElementCompartmentEditPart_title=PackageableElementCompartment
-PackagePackageableElementCompartment2EditPart_title=PackageableElementCompartment
-createPackage3CreationTool_title=Package
-NavigatorGroupName_Package_2004_incominglinks=incoming links
-NavigatorGroupName_Package_2004_outgoinglinks=outgoing links
-NavigatorGroupName_File_incominglinks=incoming links
-NavigatorGroupName_File_outgoinglinks=outgoing links
-createPort3CreationTool_title=Port
-createPort3CreationTool_desc=Create a Port
-ComponentCompositeCompartmentEditPart_title=CompositeCompartment
-ComponentCompositeCompartmentEditPartCN_title=CompositeCompartment
-createNodesGroup_title=Nodes
-createNodesGroup_desc=Diagram Nodes
-createLinksGroup_title=Links
-createLinksGroup_desc=Diagram Links
-createPackageCreationTool_title=Package
-createPackageCreationTool_desc=Create a Package
-createComponentCreationTool_title=Component
-createComponentCreationTool_desc=Create a Component
-createInterfaceCreationTool_title=Interface
-createInterfaceCreationTool_desc=Create an Interface
-createCommentCreationTool_title=Comment
-createCommentCreationTool_desc=Create a Comment
-createConstraintCreationTool_title=Constraint
-createConstraintCreationTool_desc=Create a Constraint
-createLinkCreationTool_title=Link
-createLinkCreationTool_desc=Create new Link (Comment / Constraint)
-createDependencyCreationTool_title=Dependency
-createDependencyCreationTool_desc=Create a Dependency
-createRequirementlinkCreationTool_title=Requirement link
-createRequirementlinkCreationTool_desc=Create a Requirement link
-createProvidinglinkCreationTool_title=Providing link
-createProvidinglinkCreationTool_desc=Create a Providing link
-createGeneralizationCreationTool_title=Generalization
-createGeneralizationCreationTool_desc=Create a Generalization link
-createComponentRealizationCreationTool_title=Component Realization
-createComponentRealizationCreationTool_desc=Create a Component Realization
-ComponentCompositeCompartmentEditPartPCN_title=CompositeCompartmentPCN
-createAbstractionCreationTool_title=Abstraction
-createAbstractionCreationTool_desc=Create an Abstraction
-createManifestationCreationTool_title=Manifestation
-createManifestationCreationTool_desc=Create a Manifestation
-createSubstitutionCreationTool_title=Substitution
-createSubstitutionCreationTool_desc=Create a Substitution
-createAssociationCreationTool_title=Association
-createManifestCreationTool_title=Manifest
-createManifestCreationTool_desc=Create a Substitution
-createAssociationCreationTool_desc=Create an Association
-createUsageCreationTool_title=Usage
-createUsageCreationTool_desc=Create an Usage
-createInterfaceRealizationCreationTool_title=Interface Realization
-createInterfaceRealizationCreationTool_desc=Create an Interface Realization
-createArtifactCreationTool_title=Artifact
-createArtifactCreationTool_desc=Create an Artefact
diff --git a/incoming/org.eclipse.papyrus.diagram.component/model/ComponentDiagram.gmfgen b/incoming/org.eclipse.papyrus.diagram.component/model/ComponentDiagram.gmfgen
deleted file mode 100644
index 6be38e2bc70..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/model/ComponentDiagram.gmfgen
+++ /dev/null
@@ -1,2040 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgen="http://www.eclipse.org/gmf/2009/GenModel"
- xmlns:papyrusgmfgenextension="http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension">
- <gmfgen:GenEditorGenerator
- packageNamePrefix="org.eclipse.papyrus.diagram.component"
- modelID="PapyrusUMLComponentDiagram"
- domainFileExtension="PapyrusUMLComponent"
- dynamicTemplates="true"
- templateDirectory="/org.eclipse.papyrus.def/dynamic-templates3.5/codegen"
- pluginDirectory="/org.eclipse.papyrus.diagram.component/src">
- <diagram
- visualID="1000"
- editPartClassName="ComponentDiagramEditPart"
- itemSemanticEditPolicyClassName="ComponentDiagramItemSemanticEditPolicy"
- canonicalEditPolicyClassName="ModelCanonicalEditPolicy"
- iconProviderPriority="Low"
- creationWizardIconPath="icons/obj16/ComponentStructure.gif"
- editingDomainID="org.eclipse.papyrus.diagram.component.EditingDomain"
- validationProviderPriority="Low">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Model_1000"
- displayName="ComponentDiagram"
- editHelperClassName="ModelEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.draw2d.FreeformLayer"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.DRAG_DROP_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.edit.policies.CustomDiagramDragDropEditPolicy"/>
- <domainDiagramElement
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Model"/>
- <childNodes
- xsi:type="gmfgen:GenChildSideAffixedNode"
- visualID="3069"
- editPartClassName="PortEditPart"
- itemSemanticEditPolicyClassName="PortItemSemanticEditPolicy"
- canonicalEditPolicyClassName="PortCanonicalEditPolicy"
- graphicalNodeEditPolicyClassName="PortGraphicalNodeEditPolicy"
- createCommandClassName="PortCreateCommand"
- containers="/0/@diagram/@topLevelNodes.0 /0/@diagram/@childNodes.1 /0/@diagram/@childNodes.2">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Port_3069"
- editHelperClassName="PortEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.figure.nodes.PortFigure">
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="20"
- height="20"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.SEMANTIC_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.edit.policies.PortItemSemanticEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.edit.policies.GraphicalNodeEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeIconlDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.edit.policies.PortLayoutEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Port"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StructuredClassifier/ownedAttribute"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StructuredClassifier/ownedAttribute"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.0/@expressions.1">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.2/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Property/aggregation"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- xsi:type="gmfgen:GenExternalNodeLabel"
- visualID="5006"
- editPartClassName="PortNameEditPart"
- itemSemanticEditPolicyClassName="PortNameItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.edit.policies.PropertyLabelEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- xsi:type="gmfgen:GenExternalNodeLabel"
- visualID="5007"
- editPartClassName="PortAppliedStereotypeEditPart"
- itemSemanticEditPolicyClassName="PortAppliedStereotypeItemSemanticEditPolicy"
- readOnly="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.node.AppliedStereotypeWrappingLabelFigure">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- x="25"
- y="-10"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeExternalNodeEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.2"
- viewPattern="&lt;&lt;{0}>>"
- editorPattern="&lt;&lt;{0}>>"
- editPattern="&lt;&lt;{0}>>">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </childNodes>
- <childNodes
- visualID="3070"
- editPartClassName="ComponentEditPartCN"
- itemSemanticEditPolicyClassName="ComponentItemSemanticEditPolicyCN"
- canonicalEditPolicyClassName="ComponentCanonicalEditPolicyCN"
- childNodes="/0/@diagram/@childNodes.0"
- compartments="/0/@diagram/@compartments.2"
- graphicalNodeEditPolicyClassName="ComponentGraphicalNodeEditPolicyCN"
- createCommandClassName="ComponentCreateCommandCN"
- containers="/0/@diagram/@compartments.2 /0/@diagram/@compartments.3 /0/@diagram/@compartments.0">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Component_3070"
- displayName="Component"
- metamodelType="/0/@diagram/@topLevelNodes.0/@elementType"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.figure.nodes.CompositeFigure">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"
- fixedBackground="true"/>
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="100"
- height="50"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AffixedNodeAlignmentEditPolicy.AFFIXED_CHILD_ALIGNMENT_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AffixedNodeAlignmentEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Component"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Class/nestedClassifier"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Class/nestedClassifier"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.0/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="5256"
- editPartClassName="ComponentNameEditPartCN"
- itemSemanticEditPolicyClassName="ComponentNameItemSemanticEditPolicyCN"
- elementIcon="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"
- fixedForeground="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0"
- viewPattern="{0}"
- editorPattern="{0}"
- editPattern="{0}">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </childNodes>
- <childNodes
- visualID="3071"
- editPartClassName="ComponentEditPartPCN"
- itemSemanticEditPolicyClassName="ComponentItemSemanticEditPolicyPCN"
- canonicalEditPolicyClassName="ComponentCanonicalEditPolicyPCN"
- childNodes="/0/@diagram/@childNodes.0"
- compartments="/0/@diagram/@compartments.3"
- graphicalNodeEditPolicyClassName="ComponentGraphicalNodeEditPolicyPCN"
- createCommandClassName="ComponentCreateCommandPCN"
- containers="/0/@diagram/@compartments.1">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Component_3071"
- displayName="Component"
- metamodelType="/0/@diagram/@topLevelNodes.0/@elementType"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.figure.nodes.CompositeFigure">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"
- fixedBackground="true"/>
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="100"
- height="50"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AffixedNodeAlignmentEditPolicy.AFFIXED_CHILD_ALIGNMENT_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AffixedNodeAlignmentEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Component"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.0/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="5257"
- editPartClassName="ComponentNameEditPartPCN"
- itemSemanticEditPolicyClassName="ComponentNameItemSemanticEditPolicyPCN">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"
- fixedForeground="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0"
- viewPattern="{0}"
- editorPattern="{0}"
- editPattern="{0}">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </childNodes>
- <childNodes
- visualID="3072"
- editPartClassName="InterfaceEditPartPCN"
- itemSemanticEditPolicyClassName="InterfaceItemSemanticEditPolicyPCN"
- canonicalEditPolicyClassName="InterfaceCanonicalEditPolicyPCN"
- graphicalNodeEditPolicyClassName="InterfaceGraphicalNodeEditPolicyPCN"
- createCommandClassName="InterfaceCreateCommandPCN"
- containers="/0/@diagram/@compartments.1">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Interface_3072"
- displayName="Interface"
- metamodelType="/0/@diagram/@topLevelNodes.1/@elementType"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="InterfaceAsCercle"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class InterfaceAsCercle extends org.eclipse.draw2d.Ellipse {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public InterfaceAsCercle() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setFill(false);&#xA;&#x9;this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"/>
- <attributes
- xsi:type="gmfgen:ResizeConstraints"/>
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="20"
- height="20"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interface"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.0/@expressions.2">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- xsi:type="gmfgen:GenExternalNodeLabel"
- editPartClassName="InterfaceNameEditPartPCN"
- itemSemanticEditPolicyClassName="InterfaceNameItemSemanticEditPolicyPCN">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="InterfaceAsCercle_nameLabel"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class InterfaceAsCercle_nameLabel extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public InterfaceAsCercle_nameLabel() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </childNodes>
- <childNodes
- visualID="3074"
- editPartClassName="CommentEditPartPCN"
- itemSemanticEditPolicyClassName="CommentItemSemanticEditPolicyPCN"
- canonicalEditPolicyClassName="CommentCanonicalEditPolicyPCN"
- graphicalNodeEditPolicyClassName="CommentGraphicalNodeEditPolicyPCN"
- createCommandClassName="CommentCreateCommandPCN"
- containers="/0/@diagram/@compartments.1">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Comment_3074"
- metamodelType="/0/@diagram/@topLevelNodes.3/@elementType"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedComment"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedComment"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.2">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/body"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="5258"
- editPartClassName="CommentBodyEditPartPCN"
- itemSemanticEditPolicyClassName="CommentBodyItemSemanticEditPolicyPCN">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCornerBentFigure"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.1">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/body"/>
- </modelFacet>
- </labels>
- </childNodes>
- <childNodes
- visualID="3075"
- editPartClassName="ConstraintEditPartPCN"
- itemSemanticEditPolicyClassName="ConstraintItemSemanticEditPolicyPCN"
- canonicalEditPolicyClassName="ConstraintCanonicalEditPolicyPCN"
- graphicalNodeEditPolicyClassName="ConstraintGraphicalNodeEditPolicyPCN"
- createCommandClassName="ConstraintCreateCommandPCN"
- containers="/0/@diagram/@compartments.1">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Constraint_3075"
- metamodelType="/0/@diagram/@topLevelNodes.4/@elementType"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.node.ConstraintFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Namespace/ownedRule"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Namespace/ownedRule"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.1">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/specification"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="5259"
- editPartClassName="ConstraintNameEditPartPCN"
- itemSemanticEditPolicyClassName="ConstraintNameItemSemanticEditPolicyPCN"
- elementIcon="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- visualID="5260"
- editPartClassName="ConstraintSpecificationEditPartPCN"
- itemSemanticEditPolicyClassName="ConstraintSpecificationItemSemanticEditPolicyPCN"
- elementIcon="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getConstraintFigure"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.node.ConstraintFigure"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.3">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/specification"/>
- <editableMetaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/specification"/>
- </modelFacet>
- </labels>
- </childNodes>
- <topLevelNodes
- visualID="2002"
- editPartClassName="ComponentEditPart"
- itemSemanticEditPolicyClassName="ComponentItemSemanticEditPolicy"
- notationViewFactoryClassName="ComponentViewFactory"
- canonicalEditPolicyClassName="ComponentCanonicalEditPolicy"
- childNodes="/0/@diagram/@childNodes.0"
- compartments="/0/@diagram/@compartments.0"
- graphicalNodeEditPolicyClassName="ComponentGraphicalNodeEditPolicy"
- createCommandClassName="ComponentCreateCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Component_2002"
- editHelperClassName="ComponentEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.figure.nodes.CompositeFigure">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"
- fixedBackground="true"/>
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="150"
- height="100"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AffixedNodeAlignmentEditPolicy.AFFIXED_CHILD_ALIGNMENT_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AffixedNodeAlignmentEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Component"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/ownedType"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.0/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="5004"
- editPartClassName="ComponentNameEditPart"
- itemSemanticEditPolicyClassName="ComponentNameItemSemanticEditPolicy"
- notationViewFactoryClassName="ComponentNameViewFactory"
- elementIcon="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"
- fixedForeground="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0"
- editPattern="">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </topLevelNodes>
- <topLevelNodes
- visualID="2003"
- editPartClassName="InterfaceEditPart"
- itemSemanticEditPolicyClassName="InterfaceItemSemanticEditPolicy"
- notationViewFactoryClassName="InterfaceViewFactory"
- canonicalEditPolicyClassName="InterfaceCanonicalEditPolicy"
- graphicalNodeEditPolicyClassName="InterfaceGraphicalNodeEditPolicy"
- createCommandClassName="InterfaceCreateCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Interface_2003"
- editHelperClassName="InterfaceEditHelper"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="InterfaceAsCercle"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class InterfaceAsCercle extends org.eclipse.draw2d.Ellipse {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public InterfaceAsCercle() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setFill(false);&#xA;&#x9;this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"/>
- <attributes
- xsi:type="gmfgen:ResizeConstraints"/>
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="20"
- height="20"/>
- </viewmap>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interface"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/ownedType"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.0/@expressions.2">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- xsi:type="gmfgen:GenExternalNodeLabel"
- visualID="5005"
- editPartClassName="InterfaceNameEditPart"
- itemSemanticEditPolicyClassName="InterfaceNameItemSemanticEditPolicy"
- notationViewFactoryClassName="InterfaceNameViewFactory">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="InterfaceAsCercle_nameLabel"
- classBody="&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class InterfaceAsCercle_nameLabel extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public InterfaceAsCercle_nameLabel() {&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#xD;&#xA;"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </topLevelNodes>
- <topLevelNodes
- visualID="3200"
- editPartClassName="PackageEditPart"
- itemSemanticEditPolicyClassName="PackageItemSemanticEditPolicy"
- canonicalEditPolicyClassName="PackageCanonicalEditPolicy"
- compartments="/0/@diagram/@compartments.1"
- graphicalNodeEditPolicyClassName="PackageGraphicalNodeEditPolicy"
- createCommandClassName="PackageCreateCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Package_3200"
- displayName="Package"
- editHelperClassName="PackageEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.node.PackageFigure">
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="150"
- height="150"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.0/@expressions.5">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="5254"
- editPartClassName="PackageNameEditPart"
- itemSemanticEditPolicyClassName="PackageNameItemSemanticEditPolicy"
- elementIcon="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </topLevelNodes>
- <topLevelNodes
- visualID="3201"
- editPartClassName="CommentEditPart"
- itemSemanticEditPolicyClassName="CommentItemSemanticEditPolicy"
- canonicalEditPolicyClassName="CommentCanonicalEditPolicy"
- graphicalNodeEditPolicyClassName="CommentGraphicalNodeEditPolicy"
- createCommandClassName="CommentCreateCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Comment_3201"
- displayName="Comment"
- editHelperClassName="CommentEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedComment"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedComment"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.2">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/body"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="5255"
- editPartClassName="CommentBodyEditPart"
- itemSemanticEditPolicyClassName="CommentBodyItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCornerBentFigure"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.1">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/body"/>
- </modelFacet>
- </labels>
- </topLevelNodes>
- <topLevelNodes
- visualID="3199"
- editPartClassName="ConstraintEditPart"
- itemSemanticEditPolicyClassName="ConstraintItemSemanticEditPolicy"
- canonicalEditPolicyClassName="ConstraintCanonicalEditPolicy"
- graphicalNodeEditPolicyClassName="ConstraintGraphicalNodeEditPolicy"
- createCommandClassName="ConstraintCreateCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Comment_3199"
- displayName="Constraint"
- editHelperClassName="ConstraintEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.node.ConstraintFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Namespace/ownedRule"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Namespace/ownedRule"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.1">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/specification"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="5252"
- editPartClassName="ConstraintNameEditPart"
- itemSemanticEditPolicyClassName="ConstraintNameItemSemanticEditPolicy"
- elementIcon="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- visualID="5253"
- editPartClassName="ConstraintSpecificationEditPart"
- itemSemanticEditPolicyClassName="ConstraintSpecificationItemSemanticEditPolicy"
- elementIcon="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getConstraintFigure"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.node.ConstraintFigure"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.3">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/specification"/>
- <editableMetaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/specification"/>
- </modelFacet>
- </labels>
- </topLevelNodes>
- <links
- visualID="4001"
- editPartClassName="UsageEditPart"
- itemSemanticEditPolicyClassName="UsageItemSemanticEditPolicy"
- notationViewFactoryClassName="UsageViewFactory"
- createCommandClassName="UsageCreateCommand"
- reorientCommandClassName="UsageReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Usage_4001"
- editHelperClassName="UsageEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.component.custom.figure.edges.UsageDecoration"/>
- <modelFacet
- xsi:type="gmfgen:TypeLinkModelFacet">
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Usage"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.0/@expressions.3">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- <sourceMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/client"/>
- <targetMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/supplier"/>
- </modelFacet>
- <creationConstraints
- sourceEnd="/0/@expressionProviders/@providers.0/@expressions.7"
- targetEnd="/0/@expressionProviders/@providers.0/@expressions.6"/>
- </links>
- <links
- visualID="4006"
- editPartClassName="InterfaceRealizationEditPart"
- itemSemanticEditPolicyClassName="InterfaceRealizationItemSemanticEditPolicy"
- notationViewFactoryClassName="InterfaceRealizationViewFactory"
- createCommandClassName="InterfaceRealizationCreateCommand"
- reorientCommandClassName="InterfaceRealizationReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.InterfaceRealization_4006"
- editHelperClassName="InterfaceRealizationEditHelper"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="SimpleDependency"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class SimpleDependency extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public SimpleDependency() {&#xA;&#x9;&#x9;&#x9;this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:TypeLinkModelFacet">
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InterfaceRealization"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.0/@expressions.4">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- <sourceMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/client"/>
- <targetMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InterfaceRealization/contract"/>
- </modelFacet>
- <creationConstraints
- sourceEnd="/0/@expressionProviders/@providers.0/@expressions.7"
- targetEnd="/0/@expressionProviders/@providers.0/@expressions.6"/>
- </links>
- <links
- visualID="4003"
- editPartClassName="GeneralizationEditPart"
- itemSemanticEditPolicyClassName="GeneralizationItemSemanticEditPolicy"
- notationViewFactoryClassName="GeneralizationViewFactory"
- createCommandClassName="GeneralizationCreateCommand"
- reorientCommandClassName="GeneralizationReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Generalization_4003"
- editHelperClassName="GeneralizationEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.edge.GeneralizationFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:TypeLinkModelFacet">
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Generalization"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Classifier/generalization"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Classifier/generalization"/>
- <sourceMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Generalization/specific"/>
- <targetMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Generalization/general"/>
- </modelFacet>
- <labels
- visualID="2"
- editPartClassName="GeneralizationAppliedStereotypeEditPart"
- itemSemanticEditPolicyClassName="GeneralizationAppliedStereotypeItemSemanticEditPolicy"
- readOnly="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getAppliedStereotypeLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="60"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.2"
- viewPattern="&lt;&lt;{0}>>"
- editorPattern="&lt;&lt;{0}>>"
- editPattern="&lt;&lt;{0}>>">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Generalization/isSubstitutable"/>
- </modelFacet>
- </labels>
- </links>
- <links
- visualID="4012"
- editPartClassName="SubstitutionEditPart"
- itemSemanticEditPolicyClassName="SubstitutionItemSemanticEditPolicy"
- createCommandClassName="SubstitutionCreateCommand"
- reorientCommandClassName="SubstitutionReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Substitution_4012"
- displayName="Substitution"
- editHelperClassName="SubstitutionEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.edge.InterfaceRealizationFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeSubstitutionLabelDisplayEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:TypeLinkModelFacet">
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Substitution"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- <sourceMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/client"/>
- <targetMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/supplier"/>
- </modelFacet>
- <labels
- visualID="6006"
- editPartClassName="SubstitutionNameEditPart"
- itemSemanticEditPolicyClassName="SubstitutionNameItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="60"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- visualID="6020"
- editPartClassName="SubstitutionAppliedStereotypeEditPart"
- itemSemanticEditPolicyClassName="SubstitutionAppliedStereotypeItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getAppliedStereotypeLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="30"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.2"
- viewPattern="&lt;&lt;{0}>>"
- editorPattern="&lt;&lt;{0}>>"
- editPattern="&lt;&lt;{0}>>">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </links>
- <links
- visualID="4014"
- editPartClassName="ManifestationEditPart"
- itemSemanticEditPolicyClassName="ManifestationItemSemanticEditPolicy"
- createCommandClassName="ManifestationCreateCommand"
- reorientCommandClassName="ManifestationReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Manifestation_4014"
- displayName="Manifestation"
- editHelperClassName="ManifestationEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.edge.DashedEdgeFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeManifestationLabelDisplayEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:TypeLinkModelFacet">
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Manifestation"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- <sourceMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/client"/>
- <targetMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/supplier"/>
- </modelFacet>
- <labels
- visualID="6008"
- editPartClassName="ManifestationNameEditPart"
- itemSemanticEditPolicyClassName="ManifestationNameItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="60"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- visualID="6022"
- editPartClassName="ManifestationAppliedStereotypeEditPart"
- itemSemanticEditPolicyClassName="ManifestationAppliedStereotypeItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getAppliedStereotypeLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="30"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.2"
- viewPattern="&lt;&lt;{0}>>"
- editorPattern="&lt;&lt;{0}>>"
- editPattern="&lt;&lt;{0}>>">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </links>
- <links
- visualID="4007"
- editPartClassName="ComponentRealizationEditPart"
- itemSemanticEditPolicyClassName="ComponentRealizationItemSemanticEditPolicy"
- createCommandClassName="ComponentRealizationCreateCommand"
- reorientCommandClassName="ComponentRealizationReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="ComponentRealizationEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.edge.InterfaceRealizationFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:TypeLinkModelFacet">
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ComponentRealization"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- <sourceMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/client"/>
- <targetMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/supplier"/>
- </modelFacet>
- <labels
- visualID="3"
- editPartClassName="ComponentRealizationNameEditPart"
- itemSemanticEditPolicyClassName="ComponentRealizationNameItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="60"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- visualID="4"
- editPartClassName="ComponentRealizationAppliedStereotypeEditPart"
- itemSemanticEditPolicyClassName="ComponentRealizationAppliedStereotypeItemSemanticEditPolicy"
- readOnly="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getAppliedStereotypeLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="30"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.2"
- viewPattern="&lt;&lt;{0}>>"
- editorPattern="&lt;&lt;{0}>>"
- editPattern="&lt;&lt;{0}>>">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </links>
- <links
- visualID="4013"
- editPartClassName="AbstractionEditPart"
- itemSemanticEditPolicyClassName="AbstractionItemSemanticEditPolicy"
- createCommandClassName="AbstractionCreateCommand"
- reorientCommandClassName="AbstractionReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.Abstraction_4013"
- displayName="Abstraction"
- editHelperClassName="AbstractionEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.edge.DashedEdgeFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeAbstractionLabelDisplayEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:TypeLinkModelFacet">
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Abstraction"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- <sourceMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/client"/>
- <targetMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/supplier"/>
- </modelFacet>
- <labels
- visualID="6007"
- editPartClassName="AbstractionNameEditPart"
- itemSemanticEditPolicyClassName="AbstractionNameItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="60"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- visualID="6021"
- editPartClassName="AbstractionAppliedStereotypeEditPart"
- itemSemanticEditPolicyClassName="AbstractionAppliedStereotypeItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getAppliedStereotypeLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="30"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.2"
- viewPattern="&lt;&lt;{0}>>"
- editorPattern="&lt;&lt;{0}>>"
- editPattern="&lt;&lt;{0}>>">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </links>
- <links
- visualID="4016"
- editPartClassName="LinkDescriptorEditPart"
- itemSemanticEditPolicyClassName="LinkDescriptorItemSemanticEditPolicy"
- createCommandClassName="LinkDescriptorCreateCommand"
- reorientCommandClassName="LinkDescriptorReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:NotationType"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="LinkDescriptor"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class LinkDescriptor extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public LinkDescriptor() {&#xA;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASH);&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
- </links>
- <links
- visualID="4015"
- editPartClassName="CommentAnnotatedElementEditPart"
- itemSemanticEditPolicyClassName="CommentAnnotatedElementItemSemanticEditPolicy"
- createCommandClassName="CommentAnnotatedElementCreateCommand"
- reorientCommandClassName="CommentAnnotatedElementReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.CommentAnnotatedElement_4008"
- displayName="CommentAnnotatedElement"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="CommentLinkDescriptor"
- classBody="&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class CommentLinkDescriptor extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public CommentLinkDescriptor() {&#xD;&#xA;&#x9;&#x9;this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASH);&#xD;&#xA;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#xD;&#xA;">
- <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLinkModelFacet">
- <metaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/annotatedElement"/>
- </modelFacet>
- </links>
- <links
- visualID="4009"
- editPartClassName="ConstraintConstrainedElementEditPart"
- itemSemanticEditPolicyClassName="ConstraintConstrainedElementItemSemanticEditPolicy"
- createCommandClassName="ConstraintConstrainedElementCreateCommand"
- reorientCommandClassName="ConstraintConstrainedElementReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.component.ConstraintConstrainedElement_4009"
- displayName="ConstraintConstrainedElement"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="CommentLinkDescriptor"
- classBody="&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class CommentLinkDescriptor extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public CommentLinkDescriptor() {&#xD;&#xA;&#x9;&#x9;this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASH);&#xD;&#xA;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#xD;&#xA;">
- <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLinkModelFacet">
- <metaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/constrainedElement"/>
- </modelFacet>
- </links>
- <links
- visualID="4010"
- editPartClassName="DependencyEditPart"
- itemSemanticEditPolicyClassName="DependencyItemSemanticEditPolicy"
- createCommandClassName="DependencyCreateCommand"
- reorientCommandClassName="DependencyReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="DependencyEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.edge.DashedEdgeFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:TypeLinkModelFacet">
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- <sourceMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/client"/>
- <targetMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/supplier"/>
- </modelFacet>
- <labels
- visualID="6009"
- editPartClassName="DependencyNameEditPart"
- itemSemanticEditPolicyClassName="DependencyNameItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="60"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- visualID="6023"
- editPartClassName="DependencyAppliedStereotypeEditPart"
- itemSemanticEditPolicyClassName="DependencyAppliedStereotypeItemSemanticEditPolicy"
- readOnly="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getAppliedStereotypeLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="60"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.2"
- viewPattern="&lt;&lt;{0}>>"
- editorPattern="&lt;&lt;{0}>>"
- editPattern="&lt;&lt;{0}>>">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </links>
- <compartments
- visualID="7001"
- editPartClassName="ComponentCompositeCompartmentEditPart"
- itemSemanticEditPolicyClassName="ComponentCompositeCompartmentItemSemanticEditPolicy"
- canonicalEditPolicyClassName="ComponentCompositeCompartmentCanonicalEditPolicy"
- childNodes="/0/@diagram/@childNodes.1"
- title="CompositeCompartment"
- needsTitle="false"
- node="/0/@diagram/@topLevelNodes.0"
- listLayout="false">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCompositeCompartmentFigure"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy"/>
- </compartments>
- <compartments
- visualID="7002"
- editPartClassName="PackagePackageableElementCompartmentEditPart"
- itemSemanticEditPolicyClassName="PackagePackageableElementCompartmentItemSemanticEditPolicy"
- canonicalEditPolicyClassName="PackagePackageableElementCompartmentCanonicalEditPolicy"
- childNodes="/0/@diagram/@childNodes.3 /0/@diagram/@childNodes.4 /0/@diagram/@childNodes.5 /0/@diagram/@childNodes.2"
- title="PackageableElementCompartment"
- canCollapse="false"
- needsTitle="false"
- node="/0/@diagram/@topLevelNodes.2"
- listLayout="false">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getPackageableElementFigure"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- </compartments>
- <compartments
- visualID="7003"
- editPartClassName="ComponentCompositeCompartmentEditPartCN"
- itemSemanticEditPolicyClassName="ComponentCompositeCompartmentItemSemanticEditPolicyCN"
- canonicalEditPolicyClassName="ComponentCompositeCompartmentCanonicalEditPolicyCN"
- childNodes="/0/@diagram/@childNodes.1"
- title="CompositeCompartmentCN"
- needsTitle="false"
- node="/0/@diagram/@childNodes.1"
- listLayout="false">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCompositeCompartmentFigure"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy"/>
- </compartments>
- <compartments
- visualID="7004"
- editPartClassName="ComponentCompositeCompartmentEditPartPCN"
- itemSemanticEditPolicyClassName="ComponentCompositeCompartmentItemSemanticEditPolicyPCN"
- canonicalEditPolicyClassName="ComponentCompositeCompartmentCanonicalEditPolicyPCN"
- childNodes="/0/@diagram/@childNodes.1"
- title="CompositeCompartmentPCN"
- needsTitle="false"
- node="/0/@diagram/@childNodes.2"
- listLayout="false">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCompositeCompartmentFigure"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy"/>
- </compartments>
- <palette>
- <groups
- title="Nodes"
- description="Diagram Nodes"
- largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- createMethodName="createNodesGroup"
- id="&quot;component.group.nodes&quot;"
- stack="true"
- collapse="true">
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Package"
- description="Create a Package"
- largeIconPath="icons/obj16/Package.gif"
- smallIconPath="icons/obj16/Package.gif"
- createMethodName="createPackageCreationTool"
- id="&quot;component.tool.package&quot;"
- genNodes="/0/@diagram/@topLevelNodes.2"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Component"
- description="Create a Component"
- largeIconPath="icons/obj16/Component.gif"
- smallIconPath="icons/obj16/Component.gif"
- createMethodName="createComponentCreationTool"
- id="&quot;component.tool.component&quot;"
- genNodes="/0/@diagram/@topLevelNodes.0 /0/@diagram/@childNodes.1 /0/@diagram/@childNodes.2"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Interface"
- description="Create an Interface"
- largeIconPath="icons/obj16/InterfaceAsCercle.gif"
- smallIconPath="icons/obj16/InterfaceAsCercle.gif"
- createMethodName="createInterfaceCreationTool"
- id="&quot;component.tool.interface&quot;"
- genNodes="/0/@diagram/@topLevelNodes.1 /0/@diagram/@childNodes.3"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Port"
- description="Create a Port"
- largeIconPath="icons/obj16/Port.gif"
- smallIconPath="icons/obj16/Port.gif"
- createMethodName="createPortCreationTool"
- id="&quot;component.tool.port&quot;"
- genNodes="/0/@diagram/@childNodes.0"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Comment"
- description="Create a Comment"
- largeIconPath="icons/obj16/Comment.gif"
- smallIconPath="icons/obj16/Comment.gif"
- createMethodName="createCommentCreationTool"
- id="&quot;component.tool.comment&quot;"
- qualifiedToolName=""
- genNodes="/0/@diagram/@topLevelNodes.3 /0/@diagram/@childNodes.4"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Constraint"
- description="Create a Constraint"
- largeIconPath="icons/obj16/Constraint.gif"
- smallIconPath="icons/obj16/Constraint.gif"
- createMethodName="createConstraintCreationTool"
- id="&quot;component.tool.constraint&quot;"
- genNodes="/0/@diagram/@topLevelNodes.4 /0/@diagram/@childNodes.5"/>
- </groups>
- <groups
- title="Links"
- description="Diagram Links"
- largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- createMethodName="createLinksGroup"
- id="&quot;component.group.links&quot;"
- stack="true"
- collapse="true">
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Link"
- description="Create a Link (Comment / Constraint)"
- largeIconPath="icons/obj16/Link.gif"
- smallIconPath="icons/obj16/Link.gif"
- createMethodName="createLinkCreationTool"
- id="&quot;component.tool.link&quot;"
- genLinks="/0/@diagram/@links.8 /0/@diagram/@links.9"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Dependency"
- description="Create a Dependency"
- largeIconPath="icons/obj16/Dependency.gif"
- smallIconPath="icons/obj16/Dependency.gif"
- createMethodName="createDependencyCreationTool"
- id="&quot;component.tool.dependency&quot;"
- genLinks="/0/@diagram/@links.10"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Abstraction"
- description="Create an Abstraction"
- largeIconPath="icons/obj16/Abstraction.gif"
- smallIconPath="icons/obj16/Abstraction.gif"
- createMethodName="createAbstractionCreationTool"
- id="&quot;component.tool.abstraction&quot;"
- genLinks="/0/@diagram/@links.6"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Manifestation"
- description="Create a Manifestation"
- largeIconPath="icons/obj16/Manifestation.gif"
- smallIconPath="icons/obj16/Manifestation.gif"
- createMethodName="createManifestationCreationTool"
- id="&quot;component.tool.manifestation&quot;"
- genLinks="/0/@diagram/@links.4"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Generalization"
- description="Create a Generalization link"
- largeIconPath="icons/obj16/Generalization.gif"
- smallIconPath="icons/obj16/Generalization.gif"
- createMethodName="createGeneralizationCreationTool"
- id="&quot;component.tool.generalization&quot;"
- genLinks="/0/@diagram/@links.2"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Usage"
- description="Create an Usage"
- largeIconPath="icons/obj16/Usage.gif"
- smallIconPath="icons/obj16/Usage.gif"
- createMethodName="createUsageCreationTool"
- id="&quot;component.tool.usage&quot;"
- genLinks="/0/@diagram/@links.0"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Substitution"
- description="Create a Substitution"
- largeIconPath="icons/obj16/Substitution.gif"
- smallIconPath="icons/obj16/Substitution.gif"
- createMethodName="createSubstitutionCreationTool"
- id="&quot;component.tool.substitution&quot;"
- genLinks="/0/@diagram/@links.3"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Interface Realization"
- description="Create an Interface Realization"
- largeIconPath="icons/obj16/InterfaceRealization.gif"
- smallIconPath="icons/obj16/InterfaceRealization.gif"
- createMethodName="createInterfaceRealizationCreationTool"
- id="&quot;component.tool.interfaceRealization&quot;"
- genLinks="/0/@diagram/@links.1"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Component Realization"
- description="Create a Component Realization"
- largeIconPath="icons/obj16/ComponentRealization.gif"
- smallIconPath="icons/obj16/ComponentRealization.gif"
- createMethodName="createComponentRealizationCreationTool"
- id="&quot;component.tool.componentRealization&quot;"
- genLinks="/0/@diagram/@links.5"/>
- </groups>
- </palette>
- <preferencePages
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.general"
- name="UML Diagram">
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.appearance"
- name="Appearance"
- kind="Appearance"/>
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.connections"
- name="Connections"
- kind="Connections"/>
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.printing"
- name="Printing"
- kind="Printing"/>
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.rulersAndGrid"
- name="Rulers And Grid"
- kind="RulersAndGrid"/>
- </preferencePages>
- </diagram>
- <plugin
- iD="org.eclipse.papyrus.diagram.component"
- name="Papyrus Component Diagram (Incubation)"
- provider="Eclipse Modeling Project"
- version="0.7.2.qualifier">
- <requiredPlugins>org.eclipse.draw2d</requiredPlugins>
- <requiredPlugins>org.eclipse.gmf.runtime.draw2d.ui</requiredPlugins>
- </plugin>
- <editor
- iconPath="icons/obj16/ComponentDiagram.gif"/>
- <diagramUpdater/>
- <propertySheet>
- <tabs
- xsi:type="gmfgen:GenStandardPropertyTab"
- iD="appearance"/>
- <tabs
- xsi:type="gmfgen:GenStandardPropertyTab"
- iD="diagram"/>
- <tabs
- xsi:type="gmfgen:GenCustomPropertyTab"
- iD="domain"
- label="Core">
- <filter
- xsi:type="gmfgen:TypeTabFilter">
- <types>org.eclipse.gmf.runtime.notation.View</types>
- <types>org.eclipse.gef.EditPart</types>
- <generatedTypes>abstractNavigatorItem</generatedTypes>
- </filter>
- </tabs>
- </propertySheet>
- <domainGenModel
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#/"/>
- <expressionProviders>
- <providers
- xsi:type="gmfgen:GenExpressionInterpreter">
- <expressions
- body="let base : String = 'Component' in&#xD;&#xA;let suffixes : Sequence(String) = Sequence {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'} in &#xD;&#xA;let space : Namespace = self.namespace in&#xD;&#xA;let allMissed : Sequence(String) = suffixes->&#xD;&#xA; select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))&#xD;&#xA; ) in&#xD;&#xA;let firstMissed : String = allMissed->first() in &#xD;&#xA;let noMisses : Boolean = firstMissed.oclIsUndefined() in&#xD;&#xA;let allNames : Set(String) = &#xD;&#xA; if noMisses &#xD;&#xA; then &#xD;&#xA; space.member->collect(e : NamedElement | &#xD;&#xA; if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) &lt;> base&#xD;&#xA; then '' &#xD;&#xA; else e.name &#xD;&#xA; endif)->asSet()->excluding('') else Set{'not in use'} &#xD;&#xA; endif in &#xD;&#xA;let longestName : String = &#xD;&#xA; if noMisses&#xD;&#xA; then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() &#xD;&#xA; else 'not in use' &#xD;&#xA; endif in &#xD;&#xA;if noMisses then &#xD;&#xA; if longestName.oclIsUndefined() &#xD;&#xA; then base &#xD;&#xA; else longestName.concat('1') &#xD;&#xA; endif &#xD;&#xA;else &#xD;&#xA; base.concat(firstMissed) &#xD;&#xA;endif "/>
- <expressions
- body="let base : String = 'Port' in&#xD;&#xA;let suffixes : Sequence(String) = Sequence {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'} in &#xD;&#xA;let space : Namespace = self.namespace in&#xD;&#xA;let allMissed : Sequence(String) = suffixes->&#xD;&#xA; select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))&#xD;&#xA; ) in&#xD;&#xA;let firstMissed : String = allMissed->first() in &#xD;&#xA;let noMisses : Boolean = firstMissed.oclIsUndefined() in&#xD;&#xA;let allNames : Set(String) = &#xD;&#xA; if noMisses &#xD;&#xA; then &#xD;&#xA; space.member->collect(e : NamedElement | &#xD;&#xA; if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) &lt;> base&#xD;&#xA; then '' &#xD;&#xA; else e.name &#xD;&#xA; endif)->asSet()->excluding('') else Set{'not in use'} &#xD;&#xA; endif in &#xD;&#xA;let longestName : String = &#xD;&#xA; if noMisses&#xD;&#xA; then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() &#xD;&#xA; else 'not in use' &#xD;&#xA; endif in &#xD;&#xA;if noMisses then &#xD;&#xA; if longestName.oclIsUndefined() &#xD;&#xA; then base &#xD;&#xA; else longestName.concat('1') &#xD;&#xA; endif &#xD;&#xA;else &#xD;&#xA; base.concat(firstMissed) &#xD;&#xA;endif "/>
- <expressions
- body="let base : String = 'Interface' in&#xD;&#xA;let suffixes : Sequence(String) = Sequence {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'} in &#xD;&#xA;let space : Namespace = self.namespace in&#xD;&#xA;let allMissed : Sequence(String) = suffixes->&#xD;&#xA; select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))&#xD;&#xA; ) in&#xD;&#xA;let firstMissed : String = allMissed->first() in &#xD;&#xA;let noMisses : Boolean = firstMissed.oclIsUndefined() in&#xD;&#xA;let allNames : Set(String) = &#xD;&#xA; if noMisses &#xD;&#xA; then &#xD;&#xA; space.member->collect(e : NamedElement | &#xD;&#xA; if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) &lt;> base&#xD;&#xA; then '' &#xD;&#xA; else e.name &#xD;&#xA; endif)->asSet()->excluding('') else Set{'not in use'} &#xD;&#xA; endif in &#xD;&#xA;let longestName : String = &#xD;&#xA; if noMisses&#xD;&#xA; then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() &#xD;&#xA; else 'not in use' &#xD;&#xA; endif in &#xD;&#xA;if noMisses then &#xD;&#xA; if longestName.oclIsUndefined() &#xD;&#xA; then base &#xD;&#xA; else longestName.concat('1') &#xD;&#xA; endif &#xD;&#xA;else &#xD;&#xA; base.concat(firstMissed) &#xD;&#xA;endif "/>
- <expressions
- body="let base : String = 'Usage' in&#xD;&#xA;let suffixes : Sequence(String) = Sequence {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'} in &#xD;&#xA;let space : Namespace = self.namespace in&#xD;&#xA;let allMissed : Sequence(String) = suffixes->&#xD;&#xA; select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))&#xD;&#xA; ) in&#xD;&#xA;let firstMissed : String = allMissed->first() in &#xD;&#xA;let noMisses : Boolean = firstMissed.oclIsUndefined() in&#xD;&#xA;let allNames : Set(String) = &#xD;&#xA; if noMisses &#xD;&#xA; then &#xD;&#xA; space.member->collect(e : NamedElement | &#xD;&#xA; if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) &lt;> base&#xD;&#xA; then '' &#xD;&#xA; else e.name &#xD;&#xA; endif)->asSet()->excluding('') else Set{'not in use'} &#xD;&#xA; endif in &#xD;&#xA;let longestName : String = &#xD;&#xA; if noMisses&#xD;&#xA; then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() &#xD;&#xA; else 'not in use' &#xD;&#xA; endif in &#xD;&#xA;if noMisses then &#xD;&#xA; if longestName.oclIsUndefined() &#xD;&#xA; then base &#xD;&#xA; else longestName.concat('1') &#xD;&#xA; endif &#xD;&#xA;else &#xD;&#xA; base.concat(firstMissed) &#xD;&#xA;endif "/>
- <expressions
- body="let base : String = 'Realization' in&#xD;&#xA;let suffixes : Sequence(String) = Sequence {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'} in &#xD;&#xA;let space : Namespace = self.namespace in&#xD;&#xA;let allMissed : Sequence(String) = suffixes->&#xD;&#xA; select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))&#xD;&#xA; ) in&#xD;&#xA;let firstMissed : String = allMissed->first() in &#xD;&#xA;let noMisses : Boolean = firstMissed.oclIsUndefined() in&#xD;&#xA;let allNames : Set(String) = &#xD;&#xA; if noMisses &#xD;&#xA; then &#xD;&#xA; space.member->collect(e : NamedElement | &#xD;&#xA; if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) &lt;> base&#xD;&#xA; then '' &#xD;&#xA; else e.name &#xD;&#xA; endif)->asSet()->excluding('') else Set{'not in use'} &#xD;&#xA; endif in &#xD;&#xA;let longestName : String = &#xD;&#xA; if noMisses&#xD;&#xA; then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() &#xD;&#xA; else 'not in use' &#xD;&#xA; endif in &#xD;&#xA;if noMisses then &#xD;&#xA; if longestName.oclIsUndefined() &#xD;&#xA; then base &#xD;&#xA; else longestName.concat('1') &#xD;&#xA; endif &#xD;&#xA;else &#xD;&#xA; base.concat(firstMissed) &#xD;&#xA;endif "/>
- <expressions
- body="let base : String = 'Package' in&#xD;&#xA;let suffixes : Sequence(String) = Sequence {'', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'} in &#xD;&#xA;let space : Namespace = self.namespace in&#xD;&#xA;let allMissed : Sequence(String) = suffixes->&#xD;&#xA; select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))&#xD;&#xA; ) in&#xD;&#xA;let firstMissed : String = allMissed->first() in &#xD;&#xA;let noMisses : Boolean = firstMissed.oclIsUndefined() in&#xD;&#xA;let allNames : Set(String) = &#xD;&#xA; if noMisses &#xD;&#xA; then &#xD;&#xA; space.member->collect(e : NamedElement | &#xD;&#xA; if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) &lt;> base&#xD;&#xA; then '' &#xD;&#xA; else e.name &#xD;&#xA; endif)->asSet()->excluding('') else Set{'not in use'} &#xD;&#xA; endif in &#xD;&#xA;let longestName : String = &#xD;&#xA; if noMisses&#xD;&#xA; then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() &#xD;&#xA; else 'not in use' &#xD;&#xA; endif in &#xD;&#xA;if noMisses then &#xD;&#xA; if longestName.oclIsUndefined() &#xD;&#xA; then base &#xD;&#xA; else longestName.concat('1') &#xD;&#xA; endif &#xD;&#xA;else &#xD;&#xA; base.concat(firstMissed) &#xD;&#xA;endif "/>
- <expressions
- xsi:type="gmfgen:GenConstraint"
- body="self.oclIsKindOf(uml::Interface)"/>
- <expressions
- xsi:type="gmfgen:GenConstraint"
- body="self.oclIsKindOf(uml::Component) or self.oclIsKindOf(uml::Port)"/>
- <expressions
- body="self.name.concat('.file') "/>
- </providers>
- <providers
- xsi:type="gmfgen:GenJavaExpressionProvider"
- injectExpressionBody="true">
- <expressions
- body="return org.eclipse.papyrus.diagram.common.helper.NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());"/>
- <expressions
- body="// Constraint specification init&#xD;&#xA;org.eclipse.uml2.uml.LiteralString value = org.eclipse.uml2.uml.UMLFactory.eINSTANCE.createLiteralString();&#xD;&#xA;value.setValue(&quot;&quot;);&#xD;&#xA;return value;"/>
- <expressions
- body="// Comment body init&#xD;&#xA;return &quot;&quot;;"/>
- <expressions
- xsi:type="gmfgen:GenConstraint"
- body="// Creation constraint for TopLevelNodes&#xD;&#xA;&#x9;if(! (getElementToEdit() instanceof org.eclipse.uml2.uml.Package)) {&#xD;&#xA;&#x9;&#x9;return false;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;return true;"/>
- </providers>
- <providers
- xsi:type="gmfgen:GenLiteralExpressionProvider">
- <expressions
- body="org.eclipse.uml2.uml.AggregationKind.COMPOSITE_LITERAL"/>
- </providers>
- </expressionProviders>
- <labelParsers
- extensibleViaService="true">
- <implementations
- xsi:type="gmfgen:PredefinedParser"
- uses="/0/@diagram/@childNodes.0/@labels.0/@modelFacet /0/@diagram/@topLevelNodes.0/@labels.0/@modelFacet /0/@diagram/@topLevelNodes.1/@labels.0/@modelFacet /0/@diagram/@links.4/@labels.0/@modelFacet /0/@diagram/@topLevelNodes.2/@labels.0/@modelFacet /0/@diagram/@topLevelNodes.4/@labels.0/@modelFacet /0/@diagram/@childNodes.1/@labels.0/@modelFacet /0/@diagram/@childNodes.2/@labels.0/@modelFacet /0/@diagram/@childNodes.3/@labels.0/@modelFacet /0/@diagram/@childNodes.5/@labels.0/@modelFacet /0/@diagram/@links.6/@labels.0/@modelFacet /0/@diagram/@links.3/@labels.0/@modelFacet /0/@diagram/@links.5/@labels.0/@modelFacet /0/@diagram/@links.10/@labels.0/@modelFacet"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="/0/@diagram/@topLevelNodes.3/@labels.0/@modelFacet /0/@diagram/@childNodes.4/@labels.0/@modelFacet"
- qualifiedName="org.eclipse.papyrus.diagram.common.parser.CommentParser"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="/0/@diagram/@links.2/@labels.0/@modelFacet /0/@diagram/@links.4/@labels.1/@modelFacet /0/@diagram/@links.6/@labels.1/@modelFacet /0/@diagram/@links.3/@labels.1/@modelFacet /0/@diagram/@links.5/@labels.1/@modelFacet /0/@diagram/@links.10/@labels.1/@modelFacet /0/@diagram/@childNodes.0/@labels.1/@modelFacet"
- qualifiedName="org.eclipse.papyrus.diagram.common.parser.stereotype.AppliedStereotypeParser"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="/0/@diagram/@topLevelNodes.4/@labels.1/@modelFacet /0/@diagram/@childNodes.5/@labels.1/@modelFacet"
- qualifiedName="org.eclipse.papyrus.diagram.common.parser.ConstraintParser"/>
- </labelParsers>
- <contextMenus
- context="/0/@diagram">
- <items
- xsi:type="gmfgen:LoadResourceAction"/>
- </contextMenus>
- </gmfgen:GenEditorGenerator>
- <papyrusgmfgenextension:PapyrusExtensionRootNode
- comment="Papyrus specific extension for GMFGen">
- <extensionNodes
- xsi:type="papyrusgmfgenextension:ExtendedGenView"
- comment="Manage named element figure relying on Affixed Node"
- genView="/0/@diagram/@childNodes.0"
- name="EP_NamedElement_AFF_NODE"
- superOwnedEditPart="org.eclipse.papyrus.diagram.common.editparts.AbstractBorderEditPart"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:ExtendedGenView"
- comment="Manages stereotype shown with External Label"
- genView="/0/@diagram/@links.4/@labels.1"
- name="EP_Stereotypes_EXT_NODE"
- superOwnedEditPart="org.eclipse.papyrus.diagram.common.editparts.AbstractLabelEditPart"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:ExtendedGenView"
- comment="Add super class to a Comment edit parts"
- genView="/0/@diagram/@childNodes.4 /0/@diagram/@topLevelNodes.3"
- name="EP_Comment_NODE"
- superOwnedEditPart="org.eclipse.papyrus.diagram.common.editparts.AbstractCommentEditPart"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:ExtendedGenView"
- comment="Add super class to a Constraint edit parts"
- genView="/0/@diagram/@childNodes.5 /0/@diagram/@topLevelNodes.4"
- name="EP_Constraint_NODE"
- superOwnedEditPart="org.eclipse.papyrus.diagram.common.editparts.AbstractConstraintEditPart"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:SpecificLocator"
- comment="Affixed Port locator"
- classpath="org.eclipse.papyrus.diagram.component.custom.locators.PortPositionLocator"
- genChildSideAffixedNode="/0/@diagram/@childNodes.0"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:SpecificLocatorExternalLabel"
- comment="External node label locator"
- classpath="org.eclipse.papyrus.diagram.common.locator.ExternalLabelPositionLocator"
- genExternalNodeLabel="/0/@diagram/@topLevelNodes.1/@labels.0 /0/@diagram/@childNodes.3/@labels.0 /0/@diagram/@childNodes.0/@labels.0"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:GenNodeConstraint"
- comment="Creation constraint for TopLevelNode in virtual canvas"
- genNode="/0/@diagram/@topLevelNodes.0 /0/@diagram/@topLevelNodes.1 /0/@diagram/@topLevelNodes.2 /0/@diagram/@topLevelNodes.3 /0/@diagram/@topLevelNodes.4"
- genConstraint="/0/@expressionProviders/@providers.1/@expressions.3"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:AdditionalEditPartCandies"
- comment="Indicate specific BaseEditHelper in place of generated EditHelper"
- baseEditHelperPackage="org.eclipse.papyrus.diagram.common.helper"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:EditPartUsingDeleteService"
- comment="The delete service is used on every TopNode Childnode and Link"
- name="Every TopNode ChildNode Link"
- genView="/0/@diagram/@childNodes.0 /0/@diagram/@childNodes.1 /0/@diagram/@childNodes.2 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.4 /0/@diagram/@childNodes.5 /0/@diagram/@topLevelNodes.0 /0/@diagram/@topLevelNodes.1 /0/@diagram/@topLevelNodes.2 /0/@diagram/@topLevelNodes.3 /0/@diagram/@topLevelNodes.4 /0/@diagram/@links.0 /0/@diagram/@links.1 /0/@diagram/@links.2 /0/@diagram/@links.4 /0/@diagram/@links.6 /0/@diagram/@links.5 /0/@diagram/@links.8"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:EditPartUsingReorientService"
- comment="Use the edit service for reorient command (All DirectedRelationship)"
- name="DirectedRelationship"
- genView="/0/@diagram/@links.2 /0/@diagram/@links.0 /0/@diagram/@links.1 /0/@diagram/@links.3 /0/@diagram/@links.4 /0/@diagram/@links.5 /0/@diagram/@links.6 /0/@diagram/@links.10"/>
- </papyrusgmfgenextension:PapyrusExtensionRootNode>
-</xmi:XMI>
diff --git a/incoming/org.eclipse.papyrus.diagram.component/plugin.properties b/incoming/org.eclipse.papyrus.diagram.component/plugin.properties
deleted file mode 100644
index b04aa97b9a7..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/plugin.properties
+++ /dev/null
@@ -1,1110 +0,0 @@
-pluginName=Papyrus Component Diagram (Incubation)
-providerName=Eclipse Modeling Project
-_UI_CreateChild_text = {0}
-_UI_CreateChild_text2 = {1} {0}
-_UI_CreateChild_text3 = {1}
-_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
-_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
-_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
- _UI_PropertyDescriptor_description = The {0} of the {1}
- _UI_Connexion_type = Connexion
-_UI_Eclipse_type = Eclipse
-_UI_Rectangle_type = Rectangle
-_UI_Forme_type = Forme
-_UI_FormesDiagram_type = Formes Diagram
-_UI_Unknown_type = Object
- _UI_Unknown_datatype= Value
- _UI_Connexion_source_feature = Source
-_UI_Connexion_destination_feature = Destination
-_UI_Connexion_label_feature = Label
-_UI_Forme_sourceConnexions_feature = Source Connexions
-_UI_Forme_destConnexions_feature = Dest Connexions
-_UI_Forme_nom_feature = Nom
-_UI_FormesDiagram_formes_feature = Formes
-_UI_Unknown_feature = Unspecified
-
-_UI_MyDiagramEditor_menu = &MyDiagram Editor
- _UI_CreateChild_menu_item = &New Child
-_UI_CreateSibling_menu_item = N&ew Sibling
- _UI_ShowPropertiesView_menu_item = Show &Properties View
-_UI_RefreshViewer_menu_item = &Refresh
- _UI_SelectionPage_label = Selection
-_UI_ParentPage_label = Parent
-_UI_ListPage_label = List
-_UI_TreePage_label = Tree
-_UI_TablePage_label = Table
-_UI_TreeWithColumnsPage_label = Tree with Columns
-_UI_ObjectColumn_label = Object
-_UI_SelfColumn_label = Self
- _UI_NoObjectSelected = Selected Nothing
-_UI_SingleObjectSelected = Selected Object: {0}
-_UI_MultiObjectSelected = Selected {0} Objects
- _UI_OpenEditorError_label = Open Editor
- _UI_Wizard_category = Example EMF Model Creation Wizards
- _UI_CreateModelError_message = Problems encountered in file "{0}"
- _UI_MyDiagramModelWizard_label = MyDiagram Model
-_UI_MyDiagramModelWizard_description = Create a new MyDiagram model
- _UI_MyDiagramEditor_label = MyDiagram Model Editor
- _UI_MyDiagramEditorFilenameDefaultBase = My
-_UI_MyDiagramEditorFilenameExtensions = mydiagram
- _UI_Wizard_label = New
- _WARN_FilenameExtension = The file name must end in ''.{0}''
-_WARN_FilenameExtensions = The file name must have one of the following extensions: {0}
- _UI_ModelObject = &Model Object
-_UI_XMLEncoding = &XML Encoding
-_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1
-_UI_Wizard_initial_object_description = Select a model object to create
- _UI_FileConflict_label = File Conflict
-_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
-
-editorName=ComponentDiagram Diagram Editing
-context.description=ComponentDiagram Diagram Editing
-context.name=In ComponentDiagram Diagram Editor
-newWizardName=ComponentDiagram Diagram
-newWizardDesc=Creates ComponentDiagram diagram.
- initDiagramActionLabel=Initialize mydiagram_diagram diagram file
- navigatorContentName=*.mydiagram_diagram diagram contents
-domainNavigatorContentName=*.mydiagram model contents
-update.diagram.name=Update ComponentDiagram diagram
-update.diagram.description=Perform ComponentDiagram diagram update
- tab.appearance=Appearance
-tab.diagram=Rulers & Grid
-tab.domain=Core
- prefpage.org.eclipse.papyrus.diagram.component.diagram.general=ComponentDiagram Diagram
-prefpage.org.eclipse.papyrus.diagram.component.diagram.appearance=Appearance
-prefpage.org.eclipse.papyrus.diagram.component.diagram.connections=Connections
-prefpage.org.eclipse.papyrus.diagram.component.diagram.printing=Printing
-prefpage.org.eclipse.papyrus.diagram.component.diagram.rulersAndGrid=Rulers And Grid
- metatype.name.FormesDiagram_1000=Undefined
-metatype.name.Rectangle_2001=Rectangle
-metatype.name.Eclipse_2002=Eclipse
-metatype.name.Connexion_4001=Connexion
-metatype.name.FormeDestConnexions_4002=Undefined
- cmdcategory.name=ComponentDiagram Editor Commands
-cmdcategory.desc=ComponentDiagram Editor Commands
-
-_UI_org.eclipse.papyrus.diagram.componentEditor_menu = &org.eclipse.papyrus.diagram.component Editor
- _UI_org.eclipse.papyrus.diagram.componentModelWizard_label = org.eclipse.papyrus.diagram.component Model
-_UI_org.eclipse.papyrus.diagram.componentModelWizard_description = Create a new org.eclipse.papyrus.diagram.component model
- _UI_org.eclipse.papyrus.diagram.componentEditor_label = org.eclipse.papyrus.diagram.component Model Editor
- _UI_org.eclipse.papyrus.diagram.componentEditorFilenameDefaultBase = My
-_UI_org.eclipse.papyrus.diagram.componentEditorFilenameExtensions = org.eclipse.papyrus.diagram.component
-
-prefpage.org.eclipse.uml2.uml.diagram.general=UML Diagram
-prefpage.org.eclipse.uml2.uml.diagram.appearance=Appearance
-prefpage.org.eclipse.uml2.uml.diagram.connections=Connections
-prefpage.org.eclipse.uml2.uml.diagram.printing=Printing
-prefpage.org.eclipse.uml2.uml.diagram.rulersAndGrid=Rulers And Grid
- metatype.name.Package_1000=Undefined
-metatype.name.Component_2001=Component
-metatype.name.Usage_4001=Usage
-
-_UI_UML_content_type = UML File
-_UI_Comment_type = Comment
-_UI_Element_type = Element
-_UI_Package_type = Package
-_UI_PackageableElement_type = Packageable Element
-_UI_NamedElement_type = Named Element
-_UI_Dependency_type = Dependency
-_UI_DirectedRelationship_type = Directed Relationship
-_UI_Relationship_type = Relationship
-_UI_Namespace_type = Namespace
-_UI_ElementImport_type = Element Import
-_UI_PackageImport_type = Package Import
-_UI_Constraint_type = Constraint
-_UI_ValueSpecification_type = Value Specification
-_UI_TypedElement_type = Typed Element
-_UI_Type_type = Type
-_UI_Association_type = Association
-_UI_Classifier_type = Classifier
-_UI_RedefinableElement_type = Redefinable Element
-_UI_TemplateableElement_type = Templateable Element
-_UI_TemplateBinding_type = Template Binding
-_UI_TemplateSignature_type = Template Signature
-_UI_TemplateParameter_type = Template Parameter
-_UI_ParameterableElement_type = Parameterable Element
-_UI_TemplateParameterSubstitution_type = Template Parameter Substitution
-_UI_Generalization_type = Generalization
-_UI_GeneralizationSet_type = Generalization Set
-_UI_Feature_type = Feature
-_UI_Substitution_type = Substitution
-_UI_Realization_type = Realization
-_UI_Abstraction_type = Abstraction
-_UI_OpaqueExpression_type = Opaque Expression
-_UI_Parameter_type = Parameter
-_UI_MultiplicityElement_type = Multiplicity Element
-_UI_ConnectableElement_type = Connectable Element
-_UI_ConnectorEnd_type = Connector End
-_UI_Property_type = Property
-_UI_DeploymentTarget_type = Deployment Target
-_UI_Deployment_type = Deployment
-_UI_DeployedArtifact_type = Deployed Artifact
-_UI_DeploymentSpecification_type = Deployment Specification
-_UI_Artifact_type = Artifact
-_UI_Manifestation_type = Manifestation
-_UI_Operation_type = Operation
-_UI_BehavioralFeature_type = Behavioral Feature
-_UI_Behavior_type = Behavior
-_UI_Class_type = Class
-_UI_BehavioredClassifier_type = Behaviored Classifier
-_UI_InterfaceRealization_type = Interface Realization
-_UI_Interface_type = Interface
-_UI_Reception_type = Reception
-_UI_Signal_type = Signal
-_UI_ProtocolStateMachine_type = Protocol State Machine
-_UI_StateMachine_type = State Machine
-_UI_Region_type = Region
-_UI_Vertex_type = Vertex
-_UI_Transition_type = Transition
-_UI_Trigger_type = Trigger
-_UI_Event_type = Event
-_UI_Port_type = Port
-_UI_State_type = State
-_UI_ConnectionPointReference_type = Connection Point Reference
-_UI_Pseudostate_type = Pseudostate
-_UI_ProtocolConformance_type = Protocol Conformance
-_UI_EncapsulatedClassifier_type = Encapsulated Classifier
-_UI_StructuredClassifier_type = Structured Classifier
-_UI_Connector_type = Connector
-_UI_Extension_type = Extension
-_UI_ExtensionEnd_type = Extension End
-_UI_Stereotype_type = Stereotype
-_UI_Image_type = Image
-_UI_Profile_type = Profile
-_UI_Model_type = Model
-_UI_ParameterSet_type = Parameter Set
-_UI_DataType_type = Data Type
-_UI_OperationTemplateParameter_type = Operation Template Parameter
-_UI_StructuralFeature_type = Structural Feature
-_UI_ConnectableElementTemplateParameter_type = Connectable Element Template Parameter
-_UI_CollaborationUse_type = Collaboration Use
-_UI_Collaboration_type = Collaboration
-_UI_UseCase_type = Use Case
-_UI_Include_type = Include
-_UI_Extend_type = Extend
-_UI_ExtensionPoint_type = Extension Point
-_UI_RedefinableTemplateSignature_type = Redefinable Template Signature
-_UI_ClassifierTemplateParameter_type = Classifier Template Parameter
-_UI_StringExpression_type = String Expression
-_UI_Expression_type = Expression
-_UI_Usage_type = Usage
-_UI_PackageMerge_type = Package Merge
-_UI_ProfileApplication_type = Profile Application
-_UI_Enumeration_type = Enumeration
-_UI_EnumerationLiteral_type = Enumeration Literal
-_UI_InstanceSpecification_type = Instance Specification
-_UI_Slot_type = Slot
-_UI_PrimitiveType_type = Primitive Type
-_UI_LiteralSpecification_type = Literal Specification
-_UI_LiteralInteger_type = Literal Integer
-_UI_LiteralString_type = Literal String
-_UI_LiteralBoolean_type = Literal Boolean
-_UI_LiteralNull_type = Literal Null
-_UI_InstanceValue_type = Instance Value
-_UI_LiteralUnlimitedNatural_type = Literal Unlimited Natural
-_UI_OpaqueBehavior_type = Opaque Behavior
-_UI_FunctionBehavior_type = Function Behavior
-_UI_OpaqueAction_type = Opaque Action
-_UI_Action_type = Action
-_UI_ExecutableNode_type = Executable Node
-_UI_ActivityNode_type = Activity Node
-_UI_StructuredActivityNode_type = Structured Activity Node
-_UI_ActivityGroup_type = Activity Group
-_UI_Activity_type = Activity
-_UI_Variable_type = Variable
-_UI_ActivityEdge_type = Activity Edge
-_UI_ActivityPartition_type = Activity Partition
-_UI_InterruptibleActivityRegion_type = Interruptible Activity Region
-_UI_ExceptionHandler_type = Exception Handler
-_UI_ObjectNode_type = Object Node
-_UI_OutputPin_type = Output Pin
-_UI_Pin_type = Pin
-_UI_InputPin_type = Input Pin
-_UI_CallAction_type = Call Action
-_UI_InvocationAction_type = Invocation Action
-_UI_SendSignalAction_type = Send Signal Action
-_UI_CallOperationAction_type = Call Operation Action
-_UI_CallBehaviorAction_type = Call Behavior Action
-_UI_SequenceNode_type = Sequence Node
-_UI_ControlNode_type = Control Node
-_UI_ControlFlow_type = Control Flow
-_UI_InitialNode_type = Initial Node
-_UI_ActivityParameterNode_type = Activity Parameter Node
-_UI_ValuePin_type = Value Pin
-_UI_Message_type = Message
-_UI_MessageEnd_type = Message End
-_UI_Interaction_type = Interaction
-_UI_InteractionFragment_type = Interaction Fragment
-_UI_Lifeline_type = Lifeline
-_UI_PartDecomposition_type = Part Decomposition
-_UI_InteractionUse_type = Interaction Use
-_UI_Gate_type = Gate
-_UI_GeneralOrdering_type = General Ordering
-_UI_OccurrenceSpecification_type = Occurrence Specification
-_UI_InteractionOperand_type = Interaction Operand
-_UI_InteractionConstraint_type = Interaction Constraint
-_UI_ExecutionSpecification_type = Execution Specification
-_UI_StateInvariant_type = State Invariant
-_UI_ActionExecutionSpecification_type = Action Execution Specification
-_UI_BehaviorExecutionSpecification_type = Behavior Execution Specification
-_UI_ExecutionEvent_type = Execution Event
-_UI_CreationEvent_type = Creation Event
-_UI_DestructionEvent_type = Destruction Event
-_UI_SendOperationEvent_type = Send Operation Event
-_UI_MessageEvent_type = Message Event
-_UI_SendSignalEvent_type = Send Signal Event
-_UI_MessageOccurrenceSpecification_type = Message Occurrence Specification
-_UI_ExecutionOccurrenceSpecification_type = Execution Occurrence Specification
-_UI_ReceiveOperationEvent_type = Receive Operation Event
-_UI_ReceiveSignalEvent_type = Receive Signal Event
-_UI_Actor_type = Actor
-_UI_CallEvent_type = Call Event
-_UI_ChangeEvent_type = Change Event
-_UI_SignalEvent_type = Signal Event
-_UI_AnyReceiveEvent_type = Any Receive Event
-_UI_ForkNode_type = Fork Node
-_UI_FlowFinalNode_type = Flow Final Node
-_UI_FinalNode_type = Final Node
-_UI_CentralBufferNode_type = Central Buffer Node
-_UI_MergeNode_type = Merge Node
-_UI_DecisionNode_type = Decision Node
-_UI_ObjectFlow_type = Object Flow
-_UI_ActivityFinalNode_type = Activity Final Node
-_UI_ComponentRealization_type = Component Realization
-_UI_Component_type = Component
-_UI_Node_type = Node
-_UI_CommunicationPath_type = Communication Path
-_UI_Device_type = Device
-_UI_ExecutionEnvironment_type = Execution Environment
-_UI_CombinedFragment_type = Combined Fragment
-_UI_Continuation_type = Continuation
-_UI_ConsiderIgnoreFragment_type = Consider Ignore Fragment
-_UI_CreateObjectAction_type = Create Object Action
-_UI_DestroyObjectAction_type = Destroy Object Action
-_UI_TestIdentityAction_type = Test Identity Action
-_UI_ReadSelfAction_type = Read Self Action
-_UI_StructuralFeatureAction_type = Structural Feature Action
-_UI_ReadStructuralFeatureAction_type = Read Structural Feature Action
-_UI_WriteStructuralFeatureAction_type = Write Structural Feature Action
-_UI_ClearStructuralFeatureAction_type = Clear Structural Feature Action
-_UI_RemoveStructuralFeatureValueAction_type = Remove Structural Feature Value Action
-_UI_AddStructuralFeatureValueAction_type = Add Structural Feature Value Action
-_UI_LinkAction_type = Link Action
-_UI_LinkEndData_type = Link End Data
-_UI_QualifierValue_type = Qualifier Value
-_UI_ReadLinkAction_type = Read Link Action
-_UI_LinkEndCreationData_type = Link End Creation Data
-_UI_CreateLinkAction_type = Create Link Action
-_UI_WriteLinkAction_type = Write Link Action
-_UI_DestroyLinkAction_type = Destroy Link Action
-_UI_LinkEndDestructionData_type = Link End Destruction Data
-_UI_ClearAssociationAction_type = Clear Association Action
-_UI_BroadcastSignalAction_type = Broadcast Signal Action
-_UI_SendObjectAction_type = Send Object Action
-_UI_ValueSpecificationAction_type = Value Specification Action
-_UI_TimeExpression_type = Time Expression
-_UI_Observation_type = Observation
-_UI_Duration_type = Duration
-_UI_DurationInterval_type = Duration Interval
-_UI_Interval_type = Interval
-_UI_TimeConstraint_type = Time Constraint
-_UI_IntervalConstraint_type = Interval Constraint
-_UI_TimeInterval_type = Time Interval
-_UI_DurationConstraint_type = Duration Constraint
-_UI_TimeObservation_type = Time Observation
-_UI_DurationObservation_type = Duration Observation
-_UI_FinalState_type = Final State
-_UI_TimeEvent_type = Time Event
-_UI_VariableAction_type = Variable Action
-_UI_ReadVariableAction_type = Read Variable Action
-_UI_WriteVariableAction_type = Write Variable Action
-_UI_ClearVariableAction_type = Clear Variable Action
-_UI_AddVariableValueAction_type = Add Variable Value Action
-_UI_RemoveVariableValueAction_type = Remove Variable Value Action
-_UI_RaiseExceptionAction_type = Raise Exception Action
-_UI_ActionInputPin_type = Action Input Pin
-_UI_InformationItem_type = Information Item
-_UI_InformationFlow_type = Information Flow
-_UI_ReadExtentAction_type = Read Extent Action
-_UI_ReclassifyObjectAction_type = Reclassify Object Action
-_UI_ReadIsClassifiedObjectAction_type = Read Is Classified Object Action
-_UI_StartClassifierBehaviorAction_type = Start Classifier Behavior Action
-_UI_ReadLinkObjectEndAction_type = Read Link Object End Action
-_UI_ReadLinkObjectEndQualifierAction_type = Read Link Object End Qualifier Action
-_UI_CreateLinkObjectAction_type = Create Link Object Action
-_UI_AcceptEventAction_type = Accept Event Action
-_UI_AcceptCallAction_type = Accept Call Action
-_UI_ReplyAction_type = Reply Action
-_UI_UnmarshallAction_type = Unmarshall Action
-_UI_ReduceAction_type = Reduce Action
-_UI_StartObjectBehaviorAction_type = Start Object Behavior Action
-_UI_JoinNode_type = Join Node
-_UI_DataStoreNode_type = Data Store Node
-_UI_ConditionalNode_type = Conditional Node
-_UI_Clause_type = Clause
-_UI_LoopNode_type = Loop Node
-_UI_ExpansionNode_type = Expansion Node
-_UI_ExpansionRegion_type = Expansion Region
-_UI_ProtocolTransition_type = Protocol Transition
-_UI_AssociationClass_type = Association Class
-_UI_Comment_body_feature = Body
-_UI_Comment_annotatedElement_feature = Annotated Element
-_UI_Element_ownedElement_feature = Owned Element
-_UI_Element_owner_feature = Owner
-_UI_Element_ownedComment_feature = Owned Comment
-_UI_Package_ownedType_feature = Owned Type
-_UI_Package_packageMerge_feature = Package Merge
-_UI_Package_packagedElement_feature = Packaged Element
-_UI_Package_nestedPackage_feature = Nested Package
-_UI_Package_nestingPackage_feature = Nesting Package
-_UI_Package_profileApplication_feature = Profile Application
-_UI_NamedElement_name_feature = Name
-_UI_NamedElement_visibility_feature = Visibility
-_UI_NamedElement_qualifiedName_feature = Qualified Name
-_UI_NamedElement_clientDependency_feature = Client Dependency
-_UI_NamedElement_namespace_feature = Namespace
-_UI_NamedElement_nameExpression_feature = Name Expression
-_UI_Dependency_supplier_feature = Supplier
-_UI_Dependency_client_feature = Client
-_UI_DirectedRelationship_source_feature = Source
-_UI_DirectedRelationship_target_feature = Target
-_UI_Relationship_relatedElement_feature = Related Element
-_UI_Namespace_elementImport_feature = Element Import
-_UI_Namespace_packageImport_feature = Package Import
-_UI_Namespace_ownedRule_feature = Owned Rule
-_UI_Namespace_member_feature = Member
-_UI_Namespace_importedMember_feature = Imported Member
-_UI_Namespace_ownedMember_feature = Owned Member
-_UI_ElementImport_visibility_feature = Visibility
-_UI_ElementImport_alias_feature = Alias
-_UI_ElementImport_importedElement_feature = Imported Element
-_UI_ElementImport_importingNamespace_feature = Importing Namespace
-_UI_PackageImport_visibility_feature = Visibility
-_UI_PackageImport_importedPackage_feature = Imported Package
-_UI_PackageImport_importingNamespace_feature = Importing Namespace
-_UI_Constraint_constrainedElement_feature = Constrained Element
-_UI_Constraint_specification_feature = Specification
-_UI_Constraint_context_feature = Context
-_UI_TypedElement_type_feature = Type
-_UI_Type_package_feature = Package
-_UI_Association_ownedEnd_feature = Owned End
-_UI_Association_memberEnd_feature = Member End
-_UI_Association_isDerived_feature = Is Derived
-_UI_Association_endType_feature = End Type
-_UI_Association_navigableOwnedEnd_feature = Navigable Owned End
-_UI_Classifier_isAbstract_feature = Is Abstract
-_UI_Classifier_generalization_feature = Generalization
-_UI_Classifier_powertypeExtent_feature = Powertype Extent
-_UI_Classifier_feature_feature = Feature
-_UI_Classifier_inheritedMember_feature = Inherited Member
-_UI_Classifier_redefinedClassifier_feature = Redefined Classifier
-_UI_Classifier_general_feature = General
-_UI_Classifier_substitution_feature = Substitution
-_UI_Classifier_attribute_feature = Attribute
-_UI_Classifier_representation_feature = Representation
-_UI_Classifier_collaborationUse_feature = Collaboration Use
-_UI_Classifier_ownedUseCase_feature = Owned Use Case
-_UI_Classifier_useCase_feature = Use Case
-_UI_RedefinableElement_isLeaf_feature = Is Leaf
-_UI_RedefinableElement_redefinedElement_feature = Redefined Element
-_UI_RedefinableElement_redefinitionContext_feature = Redefinition Context
-_UI_TemplateableElement_templateBinding_feature = Template Binding
-_UI_TemplateableElement_ownedTemplateSignature_feature = Owned Template Signature
-_UI_TemplateBinding_signature_feature = Signature
-_UI_TemplateBinding_parameterSubstitution_feature = Parameter Substitution
-_UI_TemplateBinding_boundElement_feature = Bound Element
-_UI_TemplateSignature_parameter_feature = Parameter
-_UI_TemplateSignature_ownedParameter_feature = Owned Parameter
-_UI_TemplateSignature_template_feature = Template
-_UI_TemplateParameter_signature_feature = Signature
-_UI_TemplateParameter_parameteredElement_feature = Parametered Element
-_UI_TemplateParameter_ownedParameteredElement_feature = Owned Parametered Element
-_UI_TemplateParameter_default_feature = Default
-_UI_TemplateParameter_ownedDefault_feature = Owned Default
-_UI_ParameterableElement_owningTemplateParameter_feature = Owning Template Parameter
-_UI_ParameterableElement_templateParameter_feature = Template Parameter
-_UI_TemplateParameterSubstitution_formal_feature = Formal
-_UI_TemplateParameterSubstitution_actual_feature = Actual
-_UI_TemplateParameterSubstitution_ownedActual_feature = Owned Actual
-_UI_TemplateParameterSubstitution_templateBinding_feature = Template Binding
-_UI_Generalization_isSubstitutable_feature = Is Substitutable
-_UI_Generalization_general_feature = General
-_UI_Generalization_generalizationSet_feature = Generalization Set
-_UI_Generalization_specific_feature = Specific
-_UI_GeneralizationSet_isCovering_feature = Is Covering
-_UI_GeneralizationSet_isDisjoint_feature = Is Disjoint
-_UI_GeneralizationSet_powertype_feature = Powertype
-_UI_GeneralizationSet_generalization_feature = Generalization
-_UI_Feature_isStatic_feature = Is Static
-_UI_Feature_featuringClassifier_feature = Featuring Classifier
-_UI_Substitution_contract_feature = Contract
-_UI_Substitution_substitutingClassifier_feature = Substituting Classifier
-_UI_Abstraction_mapping_feature = Mapping
-_UI_OpaqueExpression_body_feature = Body
-_UI_OpaqueExpression_language_feature = Language
-_UI_OpaqueExpression_result_feature = Result
-_UI_OpaqueExpression_behavior_feature = Behavior
-_UI_Parameter_parameterSet_feature = Parameter Set
-_UI_Parameter_operation_feature = Operation
-_UI_Parameter_direction_feature = Direction
-_UI_Parameter_default_feature = Default
-_UI_Parameter_defaultValue_feature = Default Value
-_UI_Parameter_isException_feature = Is Exception
-_UI_Parameter_isStream_feature = Is Stream
-_UI_Parameter_effect_feature = Effect
-_UI_MultiplicityElement_isOrdered_feature = Is Ordered
-_UI_MultiplicityElement_isUnique_feature = Is Unique
-_UI_MultiplicityElement_upper_feature = Upper
-_UI_MultiplicityElement_lower_feature = Lower
-_UI_MultiplicityElement_upperValue_feature = Upper Value
-_UI_MultiplicityElement_lowerValue_feature = Lower Value
-_UI_ConnectableElement_end_feature = End
-_UI_ConnectorEnd_definingEnd_feature = Defining End
-_UI_ConnectorEnd_role_feature = Role
-_UI_ConnectorEnd_partWithPort_feature = Part With Port
-_UI_Property_class_feature = Class
-_UI_Property_datatype_feature = Datatype
-_UI_Property_isDerived_feature = Is Derived
-_UI_Property_isDerivedUnion_feature = Is Derived Union
-_UI_Property_default_feature = Default
-_UI_Property_aggregation_feature = Aggregation
-_UI_Property_isComposite_feature = Is Composite
-_UI_Property_redefinedProperty_feature = Redefined Property
-_UI_Property_owningAssociation_feature = Owning Association
-_UI_Property_defaultValue_feature = Default Value
-_UI_Property_opposite_feature = Opposite
-_UI_Property_subsettedProperty_feature = Subsetted Property
-_UI_Property_association_feature = Association
-_UI_Property_qualifier_feature = Qualifier
-_UI_Property_associationEnd_feature = Association End
-_UI_DeploymentTarget_deployment_feature = Deployment
-_UI_DeploymentTarget_deployedElement_feature = Deployed Element
-_UI_Deployment_deployedArtifact_feature = Deployed Artifact
-_UI_Deployment_configuration_feature = Configuration
-_UI_Deployment_location_feature = Location
-_UI_DeploymentSpecification_deploymentLocation_feature = Deployment Location
-_UI_DeploymentSpecification_executionLocation_feature = Execution Location
-_UI_DeploymentSpecification_deployment_feature = Deployment
-_UI_Artifact_fileName_feature = File Name
-_UI_Artifact_nestedArtifact_feature = Nested Artifact
-_UI_Artifact_manifestation_feature = Manifestation
-_UI_Artifact_ownedOperation_feature = Owned Operation
-_UI_Artifact_ownedAttribute_feature = Owned Attribute
-_UI_Manifestation_utilizedElement_feature = Utilized Element
-_UI_Operation_interface_feature = Interface
-_UI_Operation_class_feature = Class
-_UI_Operation_isQuery_feature = Is Query
-_UI_Operation_isOrdered_feature = Is Ordered
-_UI_Operation_isUnique_feature = Is Unique
-_UI_Operation_lower_feature = Lower
-_UI_Operation_upper_feature = Upper
-_UI_Operation_precondition_feature = Precondition
-_UI_Operation_postcondition_feature = Postcondition
-_UI_Operation_redefinedOperation_feature = Redefined Operation
-_UI_Operation_datatype_feature = Datatype
-_UI_Operation_bodyCondition_feature = Body Condition
-_UI_Operation_type_feature = Type
-_UI_BehavioralFeature_ownedParameter_feature = Owned Parameter
-_UI_BehavioralFeature_isAbstract_feature = Is Abstract
-_UI_BehavioralFeature_method_feature = Method
-_UI_BehavioralFeature_concurrency_feature = Concurrency
-_UI_BehavioralFeature_raisedException_feature = Raised Exception
-_UI_BehavioralFeature_ownedParameterSet_feature = Owned Parameter Set
-_UI_Behavior_isReentrant_feature = Is Reentrant
-_UI_Behavior_redefinedBehavior_feature = Redefined Behavior
-_UI_Behavior_ownedParameter_feature = Owned Parameter
-_UI_Behavior_context_feature = Context
-_UI_Behavior_precondition_feature = Precondition
-_UI_Behavior_postcondition_feature = Postcondition
-_UI_Behavior_ownedParameterSet_feature = Owned Parameter Set
-_UI_Behavior_specification_feature = Specification
-_UI_Class_nestedClassifier_feature = Nested Classifier
-_UI_Class_ownedOperation_feature = Owned Operation
-_UI_Class_superClass_feature = Super Class
-_UI_Class_isActive_feature = Is Active
-_UI_Class_ownedReception_feature = Owned Reception
-_UI_Class_extension_feature = Extension
-_UI_BehavioredClassifier_ownedBehavior_feature = Owned Behavior
-_UI_BehavioredClassifier_classifierBehavior_feature = Classifier Behavior
-_UI_BehavioredClassifier_interfaceRealization_feature = Interface Realization
-_UI_BehavioredClassifier_ownedTrigger_feature = Owned Trigger
-_UI_InterfaceRealization_contract_feature = Contract
-_UI_InterfaceRealization_implementingClassifier_feature = Implementing Classifier
-_UI_Interface_ownedAttribute_feature = Owned Attribute
-_UI_Interface_ownedOperation_feature = Owned Operation
-_UI_Interface_nestedClassifier_feature = Nested Classifier
-_UI_Interface_redefinedInterface_feature = Redefined Interface
-_UI_Interface_ownedReception_feature = Owned Reception
-_UI_Interface_protocol_feature = Protocol
-_UI_Reception_signal_feature = Signal
-_UI_Signal_ownedAttribute_feature = Owned Attribute
-_UI_ProtocolStateMachine_conformance_feature = Conformance
-_UI_StateMachine_region_feature = Region
-_UI_StateMachine_submachineState_feature = Submachine State
-_UI_StateMachine_connectionPoint_feature = Connection Point
-_UI_StateMachine_extendedStateMachine_feature = Extended State Machine
-_UI_Region_subvertex_feature = Subvertex
-_UI_Region_transition_feature = Transition
-_UI_Region_state_feature = State
-_UI_Region_extendedRegion_feature = Extended Region
-_UI_Region_stateMachine_feature = State Machine
-_UI_Vertex_outgoing_feature = Outgoing
-_UI_Vertex_incoming_feature = Incoming
-_UI_Vertex_container_feature = Container
-_UI_Transition_kind_feature = Kind
-_UI_Transition_container_feature = Container
-_UI_Transition_source_feature = Source
-_UI_Transition_target_feature = Target
-_UI_Transition_redefinedTransition_feature = Redefined Transition
-_UI_Transition_guard_feature = Guard
-_UI_Transition_effect_feature = Effect
-_UI_Transition_trigger_feature = Trigger
-_UI_Trigger_event_feature = Event
-_UI_Trigger_port_feature = Port
-_UI_Port_isBehavior_feature = Is Behavior
-_UI_Port_isService_feature = Is Service
-_UI_Port_required_feature = Required
-_UI_Port_redefinedPort_feature = Redefined Port
-_UI_Port_provided_feature = Provided
-_UI_Port_protocol_feature = Protocol
-_UI_State_isComposite_feature = Is Composite
-_UI_State_isOrthogonal_feature = Is Orthogonal
-_UI_State_isSimple_feature = Is Simple
-_UI_State_isSubmachineState_feature = Is Submachine State
-_UI_State_submachine_feature = Submachine
-_UI_State_connection_feature = Connection
-_UI_State_connectionPoint_feature = Connection Point
-_UI_State_redefinedState_feature = Redefined State
-_UI_State_stateInvariant_feature = State Invariant
-_UI_State_entry_feature = Entry
-_UI_State_exit_feature = Exit
-_UI_State_doActivity_feature = Do Activity
-_UI_State_deferrableTrigger_feature = Deferrable Trigger
-_UI_State_region_feature = Region
-_UI_ConnectionPointReference_entry_feature = Entry
-_UI_ConnectionPointReference_exit_feature = Exit
-_UI_ConnectionPointReference_state_feature = State
-_UI_Pseudostate_kind_feature = Kind
-_UI_Pseudostate_stateMachine_feature = State Machine
-_UI_Pseudostate_state_feature = State
-_UI_ProtocolConformance_generalMachine_feature = General Machine
-_UI_ProtocolConformance_specificMachine_feature = Specific Machine
-_UI_EncapsulatedClassifier_ownedPort_feature = Owned Port
-_UI_StructuredClassifier_ownedAttribute_feature = Owned Attribute
-_UI_StructuredClassifier_part_feature = Part
-_UI_StructuredClassifier_role_feature = Role
-_UI_StructuredClassifier_ownedConnector_feature = Owned Connector
-_UI_Connector_type_feature = Type
-_UI_Connector_redefinedConnector_feature = Redefined Connector
-_UI_Connector_end_feature = End
-_UI_Connector_kind_feature = Kind
-_UI_Connector_contract_feature = Contract
-_UI_Extension_isRequired_feature = Is Required
-_UI_Extension_metaclass_feature = Metaclass
-_UI_Stereotype_icon_feature = Icon
-_UI_Image_content_feature = Content
-_UI_Image_location_feature = Location
-_UI_Image_format_feature = Format
-_UI_Profile_ownedStereotype_feature = Owned Stereotype
-_UI_Profile_metaclassReference_feature = Metaclass Reference
-_UI_Profile_metamodelReference_feature = Metamodel Reference
-_UI_Model_viewpoint_feature = Viewpoint
-_UI_ParameterSet_parameter_feature = Parameter
-_UI_ParameterSet_condition_feature = Condition
-_UI_DataType_ownedAttribute_feature = Owned Attribute
-_UI_DataType_ownedOperation_feature = Owned Operation
-_UI_StructuralFeature_isReadOnly_feature = Is Read Only
-_UI_CollaborationUse_type_feature = Type
-_UI_CollaborationUse_roleBinding_feature = Role Binding
-_UI_Collaboration_collaborationRole_feature = Collaboration Role
-_UI_UseCase_include_feature = Include
-_UI_UseCase_extend_feature = Extend
-_UI_UseCase_extensionPoint_feature = Extension Point
-_UI_UseCase_subject_feature = Subject
-_UI_Include_addition_feature = Addition
-_UI_Include_includingCase_feature = Including Case
-_UI_Extend_extendedCase_feature = Extended Case
-_UI_Extend_condition_feature = Condition
-_UI_Extend_extensionLocation_feature = Extension Location
-_UI_Extend_extension_feature = Extension
-_UI_ExtensionPoint_useCase_feature = Use Case
-_UI_RedefinableTemplateSignature_extendedSignature_feature = Extended Signature
-_UI_RedefinableTemplateSignature_inheritedParameter_feature = Inherited Parameter
-_UI_RedefinableTemplateSignature_classifier_feature = Classifier
-_UI_ClassifierTemplateParameter_allowSubstitutable_feature = Allow Substitutable
-_UI_ClassifierTemplateParameter_constrainingClassifier_feature = Constraining Classifier
-_UI_StringExpression_subExpression_feature = Sub Expression
-_UI_StringExpression_owningExpression_feature = Owning Expression
-_UI_Expression_symbol_feature = Symbol
-_UI_Expression_operand_feature = Operand
-_UI_PackageMerge_mergedPackage_feature = Merged Package
-_UI_PackageMerge_receivingPackage_feature = Receiving Package
-_UI_ProfileApplication_appliedProfile_feature = Applied Profile
-_UI_ProfileApplication_isStrict_feature = Is Strict
-_UI_ProfileApplication_applyingPackage_feature = Applying Package
-_UI_Enumeration_ownedLiteral_feature = Owned Literal
-_UI_EnumerationLiteral_enumeration_feature = Enumeration
-_UI_InstanceSpecification_classifier_feature = Classifier
-_UI_InstanceSpecification_slot_feature = Slot
-_UI_InstanceSpecification_specification_feature = Specification
-_UI_Slot_definingFeature_feature = Defining Feature
-_UI_Slot_value_feature = Value
-_UI_Slot_owningInstance_feature = Owning Instance
-_UI_LiteralInteger_value_feature = Value
-_UI_LiteralString_value_feature = Value
-_UI_LiteralBoolean_value_feature = Value
-_UI_InstanceValue_instance_feature = Instance
-_UI_LiteralUnlimitedNatural_value_feature = Value
-_UI_OpaqueBehavior_body_feature = Body
-_UI_OpaqueBehavior_language_feature = Language
-_UI_OpaqueAction_body_feature = Body
-_UI_OpaqueAction_language_feature = Language
-_UI_OpaqueAction_inputValue_feature = Input Value
-_UI_OpaqueAction_outputValue_feature = Output Value
-_UI_Action_output_feature = Output
-_UI_Action_input_feature = Input
-_UI_Action_context_feature = Context
-_UI_Action_localPrecondition_feature = Local Precondition
-_UI_Action_localPostcondition_feature = Local Postcondition
-_UI_ExecutableNode_handler_feature = Handler
-_UI_ActivityNode_inStructuredNode_feature = In Structured Node
-_UI_ActivityNode_activity_feature = Activity
-_UI_ActivityNode_outgoing_feature = Outgoing
-_UI_ActivityNode_incoming_feature = Incoming
-_UI_ActivityNode_inPartition_feature = In Partition
-_UI_ActivityNode_inInterruptibleRegion_feature = In Interruptible Region
-_UI_ActivityNode_inGroup_feature = In Group
-_UI_ActivityNode_redefinedNode_feature = Redefined Node
-_UI_StructuredActivityNode_variable_feature = Variable
-_UI_StructuredActivityNode_edge_feature = Edge
-_UI_StructuredActivityNode_mustIsolate_feature = Must Isolate
-_UI_StructuredActivityNode_node_feature = Node
-_UI_ActivityGroup_subgroup_feature = Subgroup
-_UI_ActivityGroup_superGroup_feature = Super Group
-_UI_ActivityGroup_inActivity_feature = In Activity
-_UI_ActivityGroup_containedEdge_feature = Contained Edge
-_UI_ActivityGroup_containedNode_feature = Contained Node
-_UI_Activity_structuredNode_feature = Structured Node
-_UI_Activity_variable_feature = Variable
-_UI_Activity_node_feature = Node
-_UI_Activity_isReadOnly_feature = Is Read Only
-_UI_Activity_edge_feature = Edge
-_UI_Activity_partition_feature = Partition
-_UI_Activity_isSingleExecution_feature = Is Single Execution
-_UI_Activity_group_feature = Group
-_UI_Variable_scope_feature = Scope
-_UI_Variable_activityScope_feature = Activity Scope
-_UI_ActivityEdge_source_feature = Source
-_UI_ActivityEdge_target_feature = Target
-_UI_ActivityEdge_redefinedEdge_feature = Redefined Edge
-_UI_ActivityEdge_inPartition_feature = In Partition
-_UI_ActivityEdge_guard_feature = Guard
-_UI_ActivityEdge_weight_feature = Weight
-_UI_ActivityEdge_interrupts_feature = Interrupts
-_UI_ActivityEdge_inStructuredNode_feature = In Structured Node
-_UI_ActivityEdge_inGroup_feature = In Group
-_UI_ActivityEdge_activity_feature = Activity
-_UI_ActivityPartition_isDimension_feature = Is Dimension
-_UI_ActivityPartition_isExternal_feature = Is External
-_UI_ActivityPartition_node_feature = Node
-_UI_ActivityPartition_subpartition_feature = Subpartition
-_UI_ActivityPartition_superPartition_feature = Super Partition
-_UI_ActivityPartition_represents_feature = Represents
-_UI_ActivityPartition_edge_feature = Edge
-_UI_InterruptibleActivityRegion_node_feature = Node
-_UI_InterruptibleActivityRegion_interruptingEdge_feature = Interrupting Edge
-_UI_ExceptionHandler_handlerBody_feature = Handler Body
-_UI_ExceptionHandler_exceptionInput_feature = Exception Input
-_UI_ExceptionHandler_exceptionType_feature = Exception Type
-_UI_ExceptionHandler_protectedNode_feature = Protected Node
-_UI_ObjectNode_ordering_feature = Ordering
-_UI_ObjectNode_isControlType_feature = Is Control Type
-_UI_ObjectNode_upperBound_feature = Upper Bound
-_UI_ObjectNode_inState_feature = In State
-_UI_ObjectNode_selection_feature = Selection
-_UI_Pin_isControl_feature = Is Control
-_UI_CallAction_isSynchronous_feature = Is Synchronous
-_UI_CallAction_result_feature = Result
-_UI_InvocationAction_argument_feature = Argument
-_UI_InvocationAction_onPort_feature = On Port
-_UI_SendSignalAction_target_feature = Target
-_UI_SendSignalAction_signal_feature = Signal
-_UI_CallOperationAction_operation_feature = Operation
-_UI_CallOperationAction_target_feature = Target
-_UI_CallBehaviorAction_behavior_feature = Behavior
-_UI_SequenceNode_executableNode_feature = Executable Node
-_UI_ActivityParameterNode_parameter_feature = Parameter
-_UI_ValuePin_value_feature = Value
-_UI_Message_messageKind_feature = Message Kind
-_UI_Message_messageSort_feature = Message Sort
-_UI_Message_receiveEvent_feature = Receive Event
-_UI_Message_sendEvent_feature = Send Event
-_UI_Message_connector_feature = Connector
-_UI_Message_interaction_feature = Interaction
-_UI_Message_argument_feature = Argument
-_UI_Message_signature_feature = Signature
-_UI_MessageEnd_message_feature = Message
-_UI_Interaction_lifeline_feature = Lifeline
-_UI_Interaction_fragment_feature = Fragment
-_UI_Interaction_action_feature = Action
-_UI_Interaction_formalGate_feature = Formal Gate
-_UI_Interaction_message_feature = Message
-_UI_InteractionFragment_covered_feature = Covered
-_UI_InteractionFragment_generalOrdering_feature = General Ordering
-_UI_InteractionFragment_enclosingInteraction_feature = Enclosing Interaction
-_UI_InteractionFragment_enclosingOperand_feature = Enclosing Operand
-_UI_Lifeline_represents_feature = Represents
-_UI_Lifeline_interaction_feature = Interaction
-_UI_Lifeline_selector_feature = Selector
-_UI_Lifeline_decomposedAs_feature = Decomposed As
-_UI_Lifeline_coveredBy_feature = Covered By
-_UI_InteractionUse_refersTo_feature = Refers To
-_UI_InteractionUse_actualGate_feature = Actual Gate
-_UI_InteractionUse_argument_feature = Argument
-_UI_GeneralOrdering_before_feature = Before
-_UI_GeneralOrdering_after_feature = After
-_UI_OccurrenceSpecification_toBefore_feature = To Before
-_UI_OccurrenceSpecification_event_feature = Event
-_UI_OccurrenceSpecification_toAfter_feature = To After
-_UI_InteractionOperand_guard_feature = Guard
-_UI_InteractionOperand_fragment_feature = Fragment
-_UI_InteractionConstraint_minint_feature = Minint
-_UI_InteractionConstraint_maxint_feature = Maxint
-_UI_ExecutionSpecification_start_feature = Start
-_UI_ExecutionSpecification_finish_feature = Finish
-_UI_StateInvariant_invariant_feature = Invariant
-_UI_ActionExecutionSpecification_action_feature = Action
-_UI_BehaviorExecutionSpecification_behavior_feature = Behavior
-_UI_SendOperationEvent_operation_feature = Operation
-_UI_SendSignalEvent_signal_feature = Signal
-_UI_ExecutionOccurrenceSpecification_execution_feature = Execution
-_UI_ReceiveOperationEvent_operation_feature = Operation
-_UI_ReceiveSignalEvent_signal_feature = Signal
-_UI_CallEvent_operation_feature = Operation
-_UI_ChangeEvent_changeExpression_feature = Change Expression
-_UI_SignalEvent_signal_feature = Signal
-_UI_DecisionNode_decisionInput_feature = Decision Input
-_UI_DecisionNode_decisionInputFlow_feature = Decision Input Flow
-_UI_ObjectFlow_isMulticast_feature = Is Multicast
-_UI_ObjectFlow_isMultireceive_feature = Is Multireceive
-_UI_ObjectFlow_transformation_feature = Transformation
-_UI_ObjectFlow_selection_feature = Selection
-_UI_ComponentRealization_abstraction_feature = Abstraction
-_UI_ComponentRealization_realizingClassifier_feature = Realizing Classifier
-_UI_Component_isIndirectlyInstantiated_feature = Is Indirectly Instantiated
-_UI_Component_required_feature = Required
-_UI_Component_provided_feature = Provided
-_UI_Component_packagedElement_feature = Packaged Element
-_UI_Component_realization_feature = Realization
-_UI_Node_nestedNode_feature = Nested Node
-_UI_CombinedFragment_interactionOperator_feature = Interaction Operator
-_UI_CombinedFragment_operand_feature = Operand
-_UI_CombinedFragment_cfragmentGate_feature = Cfragment Gate
-_UI_Continuation_setting_feature = Setting
-_UI_ConsiderIgnoreFragment_message_feature = Message
-_UI_CreateObjectAction_classifier_feature = Classifier
-_UI_CreateObjectAction_result_feature = Result
-_UI_DestroyObjectAction_isDestroyLinks_feature = Is Destroy Links
-_UI_DestroyObjectAction_isDestroyOwnedObjects_feature = Is Destroy Owned Objects
-_UI_DestroyObjectAction_target_feature = Target
-_UI_TestIdentityAction_first_feature = First
-_UI_TestIdentityAction_second_feature = Second
-_UI_TestIdentityAction_result_feature = Result
-_UI_ReadSelfAction_result_feature = Result
-_UI_StructuralFeatureAction_structuralFeature_feature = Structural Feature
-_UI_StructuralFeatureAction_object_feature = Object
-_UI_ReadStructuralFeatureAction_result_feature = Result
-_UI_WriteStructuralFeatureAction_value_feature = Value
-_UI_WriteStructuralFeatureAction_result_feature = Result
-_UI_ClearStructuralFeatureAction_result_feature = Result
-_UI_RemoveStructuralFeatureValueAction_isRemoveDuplicates_feature = Is Remove Duplicates
-_UI_RemoveStructuralFeatureValueAction_removeAt_feature = Remove At
-_UI_AddStructuralFeatureValueAction_isReplaceAll_feature = Is Replace All
-_UI_AddStructuralFeatureValueAction_insertAt_feature = Insert At
-_UI_LinkAction_endData_feature = End Data
-_UI_LinkAction_inputValue_feature = Input Value
-_UI_LinkEndData_value_feature = Value
-_UI_LinkEndData_end_feature = End
-_UI_LinkEndData_qualifier_feature = Qualifier
-_UI_QualifierValue_qualifier_feature = Qualifier
-_UI_QualifierValue_value_feature = Value
-_UI_ReadLinkAction_result_feature = Result
-_UI_LinkEndCreationData_isReplaceAll_feature = Is Replace All
-_UI_LinkEndCreationData_insertAt_feature = Insert At
-_UI_LinkEndDestructionData_isDestroyDuplicates_feature = Is Destroy Duplicates
-_UI_LinkEndDestructionData_destroyAt_feature = Destroy At
-_UI_ClearAssociationAction_object_feature = Object
-_UI_ClearAssociationAction_association_feature = Association
-_UI_BroadcastSignalAction_signal_feature = Signal
-_UI_SendObjectAction_target_feature = Target
-_UI_SendObjectAction_request_feature = Request
-_UI_ValueSpecificationAction_value_feature = Value
-_UI_ValueSpecificationAction_result_feature = Result
-_UI_TimeExpression_expr_feature = Expr
-_UI_TimeExpression_observation_feature = Observation
-_UI_Duration_expr_feature = Expr
-_UI_Duration_observation_feature = Observation
-_UI_Interval_min_feature = Min
-_UI_Interval_max_feature = Max
-_UI_TimeConstraint_firstEvent_feature = First Event
-_UI_DurationConstraint_firstEvent_feature = First Event
-_UI_TimeObservation_event_feature = Event
-_UI_TimeObservation_firstEvent_feature = First Event
-_UI_DurationObservation_event_feature = Event
-_UI_DurationObservation_firstEvent_feature = First Event
-_UI_TimeEvent_isRelative_feature = Is Relative
-_UI_TimeEvent_when_feature = When
-_UI_VariableAction_variable_feature = Variable
-_UI_ReadVariableAction_result_feature = Result
-_UI_WriteVariableAction_value_feature = Value
-_UI_AddVariableValueAction_isReplaceAll_feature = Is Replace All
-_UI_AddVariableValueAction_insertAt_feature = Insert At
-_UI_RemoveVariableValueAction_isRemoveDuplicates_feature = Is Remove Duplicates
-_UI_RemoveVariableValueAction_removeAt_feature = Remove At
-_UI_RaiseExceptionAction_exception_feature = Exception
-_UI_ActionInputPin_fromAction_feature = From Action
-_UI_InformationItem_represented_feature = Represented
-_UI_InformationFlow_realization_feature = Realization
-_UI_InformationFlow_conveyed_feature = Conveyed
-_UI_InformationFlow_informationSource_feature = Information Source
-_UI_InformationFlow_informationTarget_feature = Information Target
-_UI_InformationFlow_realizingActivityEdge_feature = Realizing Activity Edge
-_UI_InformationFlow_realizingConnector_feature = Realizing Connector
-_UI_InformationFlow_realizingMessage_feature = Realizing Message
-_UI_ReadExtentAction_result_feature = Result
-_UI_ReadExtentAction_classifier_feature = Classifier
-_UI_ReclassifyObjectAction_isReplaceAll_feature = Is Replace All
-_UI_ReclassifyObjectAction_oldClassifier_feature = Old Classifier
-_UI_ReclassifyObjectAction_newClassifier_feature = New Classifier
-_UI_ReclassifyObjectAction_object_feature = Object
-_UI_ReadIsClassifiedObjectAction_isDirect_feature = Is Direct
-_UI_ReadIsClassifiedObjectAction_classifier_feature = Classifier
-_UI_ReadIsClassifiedObjectAction_result_feature = Result
-_UI_ReadIsClassifiedObjectAction_object_feature = Object
-_UI_StartClassifierBehaviorAction_object_feature = Object
-_UI_ReadLinkObjectEndAction_object_feature = Object
-_UI_ReadLinkObjectEndAction_end_feature = End
-_UI_ReadLinkObjectEndAction_result_feature = Result
-_UI_ReadLinkObjectEndQualifierAction_object_feature = Object
-_UI_ReadLinkObjectEndQualifierAction_result_feature = Result
-_UI_ReadLinkObjectEndQualifierAction_qualifier_feature = Qualifier
-_UI_CreateLinkObjectAction_result_feature = Result
-_UI_AcceptEventAction_isUnmarshall_feature = Is Unmarshall
-_UI_AcceptEventAction_result_feature = Result
-_UI_AcceptEventAction_trigger_feature = Trigger
-_UI_AcceptCallAction_returnInformation_feature = Return Information
-_UI_ReplyAction_replyToCall_feature = Reply To Call
-_UI_ReplyAction_returnInformation_feature = Return Information
-_UI_ReplyAction_replyValue_feature = Reply Value
-_UI_UnmarshallAction_result_feature = Result
-_UI_UnmarshallAction_unmarshallType_feature = Unmarshall Type
-_UI_UnmarshallAction_object_feature = Object
-_UI_ReduceAction_reducer_feature = Reducer
-_UI_ReduceAction_result_feature = Result
-_UI_ReduceAction_collection_feature = Collection
-_UI_ReduceAction_isOrdered_feature = Is Ordered
-_UI_StartObjectBehaviorAction_object_feature = Object
-_UI_JoinNode_isCombineDuplicate_feature = Is Combine Duplicate
-_UI_JoinNode_joinSpec_feature = Join Spec
-_UI_ConditionalNode_isDeterminate_feature = Is Determinate
-_UI_ConditionalNode_isAssured_feature = Is Assured
-_UI_ConditionalNode_clause_feature = Clause
-_UI_ConditionalNode_result_feature = Result
-_UI_Clause_test_feature = Test
-_UI_Clause_body_feature = Body
-_UI_Clause_predecessorClause_feature = Predecessor Clause
-_UI_Clause_successorClause_feature = Successor Clause
-_UI_Clause_decider_feature = Decider
-_UI_Clause_bodyOutput_feature = Body Output
-_UI_LoopNode_isTestedFirst_feature = Is Tested First
-_UI_LoopNode_bodyPart_feature = Body Part
-_UI_LoopNode_setupPart_feature = Setup Part
-_UI_LoopNode_decider_feature = Decider
-_UI_LoopNode_test_feature = Test
-_UI_LoopNode_result_feature = Result
-_UI_LoopNode_loopVariable_feature = Loop Variable
-_UI_LoopNode_bodyOutput_feature = Body Output
-_UI_LoopNode_loopVariableInput_feature = Loop Variable Input
-_UI_ExpansionNode_regionAsOutput_feature = Region As Output
-_UI_ExpansionNode_regionAsInput_feature = Region As Input
-_UI_ExpansionRegion_mode_feature = Mode
-_UI_ExpansionRegion_inputElement_feature = Input Element
-_UI_ExpansionRegion_outputElement_feature = Output Element
-_UI_ProtocolTransition_postCondition_feature = Post Condition
-_UI_ProtocolTransition_referred_feature = Referred
-_UI_ProtocolTransition_preCondition_feature = Pre Condition
-_UI_VisibilityKind_public_literal = public
-_UI_VisibilityKind_private_literal = private
-_UI_VisibilityKind_protected_literal = protected
-_UI_VisibilityKind_package_literal = package
-_UI_TransitionKind_internal_literal = internal
-_UI_TransitionKind_local_literal = local
-_UI_TransitionKind_external_literal = external
-_UI_PseudostateKind_initial_literal = initial
-_UI_PseudostateKind_deepHistory_literal = deepHistory
-_UI_PseudostateKind_shallowHistory_literal = shallowHistory
-_UI_PseudostateKind_join_literal = join
-_UI_PseudostateKind_fork_literal = fork
-_UI_PseudostateKind_junction_literal = junction
-_UI_PseudostateKind_choice_literal = choice
-_UI_PseudostateKind_entryPoint_literal = entryPoint
-_UI_PseudostateKind_exitPoint_literal = exitPoint
-_UI_PseudostateKind_terminate_literal = terminate
-_UI_ConnectorKind_assembly_literal = assembly
-_UI_ConnectorKind_delegation_literal = delegation
-_UI_CallConcurrencyKind_sequential_literal = sequential
-_UI_CallConcurrencyKind_guarded_literal = guarded
-_UI_CallConcurrencyKind_concurrent_literal = concurrent
-_UI_AggregationKind_none_literal = none
-_UI_AggregationKind_shared_literal = shared
-_UI_AggregationKind_composite_literal = composite
-_UI_ParameterDirectionKind_in_literal = in
-_UI_ParameterDirectionKind_inout_literal = inout
-_UI_ParameterDirectionKind_out_literal = out
-_UI_ParameterDirectionKind_return_literal = return
-_UI_ParameterEffectKind_create_literal = create
-_UI_ParameterEffectKind_read_literal = read
-_UI_ParameterEffectKind_update_literal = update
-_UI_ParameterEffectKind_delete_literal = delete
-_UI_ObjectNodeOrderingKind_unordered_literal = unordered
-_UI_ObjectNodeOrderingKind_ordered_literal = ordered
-_UI_ObjectNodeOrderingKind_LIFO_literal = LIFO
-_UI_ObjectNodeOrderingKind_FIFO_literal = FIFO
-_UI_MessageKind_complete_literal = complete
-_UI_MessageKind_lost_literal = lost
-_UI_MessageKind_found_literal = found
-_UI_MessageKind_unknown_literal = unknown
-_UI_MessageSort_synchCall_literal = synchCall
-_UI_MessageSort_asynchCall_literal = asynchCall
-_UI_MessageSort_asynchSignal_literal = asynchSignal
-_UI_MessageSort_createMessage_literal = createMessage
-_UI_MessageSort_deleteMessage_literal = deleteMessage
-_UI_MessageSort_reply_literal = reply
-_UI_InteractionOperatorKind_seq_literal = seq
-_UI_InteractionOperatorKind_alt_literal = alt
-_UI_InteractionOperatorKind_opt_literal = opt
-_UI_InteractionOperatorKind_break_literal = break
-_UI_InteractionOperatorKind_par_literal = par
-_UI_InteractionOperatorKind_strict_literal = strict
-_UI_InteractionOperatorKind_loop_literal = loop
-_UI_InteractionOperatorKind_critical_literal = critical
-_UI_InteractionOperatorKind_neg_literal = neg
-_UI_InteractionOperatorKind_assert_literal = assert
-_UI_InteractionOperatorKind_ignore_literal = ignore
-_UI_InteractionOperatorKind_consider_literal = consider
-_UI_ExpansionKind_parallel_literal = parallel
-_UI_ExpansionKind_iterative_literal = iterative
-_UI_ExpansionKind_stream_literal = stream
-_UI_UMLEditor_menu = &UML Editor
- _UI_UMLModelWizard_label = UML Model
-_UI_UMLModelWizard_description = Create a new UML model
- _UI_UMLEditor_label = UML Model Editor
- _UI_UMLEditorFilenameDefaultBase = My
-_UI_UMLEditorFilenameExtensions = uml
-
-metatype.name.Model_1000=Undefined
-metatype.name.Component_2002=Component
-
-metatype.name.Interface_2003=Interface
-metatype.name.Component_3001=Component
-metatype.name.Property_3002=Property
-metatype.name.Operation_3003=Operation
-metatype.name.Property_3004=Property
-metatype.name.Operation_3005=Operation
-metatype.name.Realization_4002=Realization
-metatype.name.Component_3006=Component
-metatype.name.InterfaceRealization_4002=InterfaceRealization
-
-metatype.name.Realization_4003=Realization
-
-metatype.name.InterfaceRealization_4004=InterfaceRealization
-
-metatype.name.Class_3004=Class
-metatype.name.Dependency_2014=Dependency
-metatype.name.Interface_2004=Interface
-metatype.name.Comment_2012=Comment
-metatype.name.Property_3006=Property
-metatype.name.Operation_3007=Operation
-metatype.name.Class_3008=Class
-metatype.name.Link_4016=Undefined
-metatype.name.Realization_4005=Realization
-metatype.name.Usage_4007=Usage
-
-metatype.name.Interface_2002=Interface
-metatype.name.Interface_3004=Interface
-metatype.name.Class_3005=Class
-metatype.name.Operation_3008=Operation
-metatype.name.Constraint_2003=Constraint
-metatype.name.Comment_2004=Comment
-metatype.name.Package_2005=Package
-metatype.name.Comment_3005=Comment
-metatype.name.Package_3006=Package
-metatype.name.Generalization_4004=Generalization
-
-metatype.name.Association_2004=Association
-metatype.name.Association_4005=Association
-metatype.name.Package_2003=Package
-metatype.name.Component_3005=Component
-metatype.name.Interface_3006=Interface
-metatype.name.Property_3007=Property
-metatype.name.Class_3009=Class
-metatype.name.Usage_4005=Usage
-metatype.name.Realization_4006=Realization
-metatype.name.Property_3001=Property
-metatype.name.Operation_3002=Operation
-metatype.name.Class_3003=Class
-metatype.name.Component_3004=Component
-metatype.name.Interface_3005=Interface
-metatype.name.Generalization_4003=Generalization
-
-metatype.name.Package_2001=Package
-metatype.name.Interface_3002=Interface
-metatype.name.Property_3003=Property
-metatype.name.Operation_3004=Operation
-metatype.name.Model_2004=Model
-metatype.name.InterfaceRealization_4006=InterfaceRealization
-metatype.name.Port_3069=Port
-metatype.name.Package_0=Package
-metatype.name.Package_2007=Package
-metatype.name.Component_3021=Component
-metatype.name.Package_2004=Package
-metatype.name.Component_3002=Component
-metatype.name.Component_3003=Component
-metatype.name.Component_2102=Component
-metatype.name.Package_3200=Package
-metatype.name.Comment_3201=Comment
-metatype.name.Constraint_3199=Constraint
-metatype.name.Component_3070=Component
-metatype.name.Component_3071=Component
-metatype.name.Interface_3072=Interface
-metatype.name.Comment_3074=Comment
-metatype.name.Constraint_3075=Constraint
-metatype.name.Dependency_4010=Dependency
-metatype.name.ComponentRealization_4007=ComponentRealization
-metatype.name.CommentAnnotatedElement_4008=Undefined
-metatype.name.ConstraintConstrainedElement_4009=Undefined
-
-metatype.name.Substitution_4011=Substitution
-metatype.name.Manifestation_4012=Manifestation
-metatype.name.Abstraction_4013=Abstraction
-
-metatype.name.Abstraction_4011=Abstraction
-
-metatype.name.Association_4011=Association
-
-metatype.name.Abstraction_4012=Abstraction
-metatype.name.Manifestation_4013=Manifestation
-metatype.name.Manifestation_4014=Manifestation
-metatype.name.Manifestation_4011=Manifestation
-
-metatype.name.Substitution_4013=Substitution
-metatype.name.Abstraction_4014=Abstraction
-metatype.name.Substitution_4012=Substitution
-metatype.name.Association_4012=Association
-metatype.name.Association_4015=Association
-metatype.name.Realization_4007=Realization
-metatype.name.Association_3202=Association
-metatype.name.Association_3203=Association
-metatype.name.Association_4016=Association
-metatype.name.Artifact_3203=Artifact
-metatype.name.CommentAnnotatedElement_4015=Undefined
diff --git a/incoming/org.eclipse.papyrus.diagram.component/plugin.xml b/incoming/org.eclipse.papyrus.diagram.component/plugin.xml
deleted file mode 100644
index 48d93033cf1..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/plugin.xml
+++ /dev/null
@@ -1,1178 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-<extension
- point="org.eclipse.ui.commands">
- <command
- categoryId="org.eclipse.papyrus.editor.category"
- defaultHandler="org.eclipse.papyrus.diagram.component.custom.actions.ShowHideRelatedContentsHandler"
- description="Call the Show/Hide Related Contents Command"
- id="org.eclipse.papyrus.diagram.component.commands.ShowHideRelatedContentsCommand"
- name="Show/Hide Related Contents Command">
- </command>
-</extension>
-<extension
- point="org.eclipse.ui.services">
- <sourceProvider
- provider="org.eclipse.papyrus.diagram.component.custom.providers.ActionStateSourceProvider">
- <variable
- name="showHideRelatedContents"
- priorityLevel="workbench">
- </variable>
- </sourceProvider>
-</extension>
-<extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.papyrus.diagram.component.custom.actions.ShowHideRelatedContentsHandler"
- commandId="org.eclipse.papyrus.diagram.component.commands.ShowHideRelatedContentsCommand">
- <activeWhen>
- <and>
- <with
- variable="showHideRelatedContents">
- <equals
- value="enabled">
- </equals>
- </with>
- <with
- variable="selection">
- <iterate
- ifEmpty="false"
- operator="and">
- <instanceof
- value="org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart">
- </instanceof>
- </iterate>
- </with>
- </and>
- </activeWhen>
- </handler>
-</extension>
-<!-- The Command to manages the Provided and Required Interfaces for a Port-->
-<extension
- point="org.eclipse.ui.commands">
- <command
- categoryId="org.eclipse.papyrus.editor.category"
- description="Allows to manage easily provided Interfaces for a Port"
- id="org.eclipse.papyrus.diagram.component.command.manage.interfaces"
- name="Manage Provided Interfaces">
- </command>
-</extension>
-<!-- The Handler to manages the Provided and Required Interfaces for a Port-->
-<extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.papyrus.diagram.component.custom.actions.ManageProvidedInterfacesHandler"
- commandId="org.eclipse.papyrus.diagram.component.command.manage.interfaces">
- <activeWhen>
- <with
- variable="selection">
- <iterate>
- <instanceof
- value="org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
-</extension>
-<!-- Add the Menu to manages the Provided and Required Interfaces for a Port-->
-<extension
- point="org.eclipse.ui.menus">
- <menuContribution
- allPopups="false"
- locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu?endof=editMenu">
- <command
- commandId="org.eclipse.papyrus.diagram.component.command.manage.interfaces"
- icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Interface.gif"
- label="Manage Interfaces"
- mnemonic="&amp;I"
- style="push">
- <visibleWhen
- checkEnabled="true">
- </visibleWhen>
- </command>
- </menuContribution>
-</extension>
-<extension
- point="org.eclipse.ui.commands">
- <command
- defaultHandler="org.eclipse.papyrus.diagram.component.CreateComponentDiagramCommand"
- description="Create a new Component Diagram"
- id="org.eclipse.papyrus.diagram.component.CreateComponentDiagramCommand"
- name="Create a new Component Diagram">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.papyrus.diagram.component.CreateComponentDiagramCommand"
- commandId="org.eclipse.papyrus.diagram.component.CreateComponentDiagramCommand">
- <activeWhen>
- <or>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.core.papyrusEditor">
- </equals>
- </with>
- </or>
- </activeWhen>
- </handler>
- </extension>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- locationURI="menu:org.eclipse.papyrus.ui.menu">
- <menu
- id="org.eclipse.papyrus.diagram.ui.menu.diagrams"
- label="Diagrams">
- <command
- commandId="org.eclipse.papyrus.diagram.component.CreateComponentDiagramCommand"
- icon="icons/obj16/ComponentDiagram.gif"
- label="Create a new Component Diagram"
- style="push"
- tooltip="Create a new Component Diagram">
- <visibleWhen>
- <reference
- definitionId="org.eclipse.papyrus.diagram.common.IsPapyrusActiveWithUMLModel">
- </reference>
- </visibleWhen>
- </command>
- </menu>
- </menuContribution>
- <menuContribution
- locationURI="toolbar:org.eclipse.ui.main.toolbar">
- <toolbar
- id="org.eclipse.papyrus.diagram.ui.toolbar">
- <command
- commandId="org.eclipse.papyrus.diagram.component.CreateComponentDiagramCommand"
- icon="icons/obj16/ComponentDiagram.gif"
- label="Create a new Component Diagram"
- style="push"
- tooltip="Create a new Component Diagram">
- <visibleWhen>
- <reference
- definitionId="org.eclipse.papyrus.diagram.common.IsPapyrusActiveWithUMLModel">
- </reference>
- </visibleWhen>
- </command>
- </toolbar>
- </menuContribution>
- </extension>
- <extension
- point="org.eclipse.papyrus.core.papyrusDiagram">
- <editorDiagram
- actionBarContributorId="org.eclipse.papyrus.diagram.common.part.UMLDiagramActionBarContributor"
- factoryClass="org.eclipse.papyrus.diagram.component.ComponentDiagramEditorFactory"
- icon="icons/obj16/ComponentDiagram.gif">
- </editorDiagram>
- <creationCommand
- creationCommandClass="org.eclipse.papyrus.diagram.component.CreateComponentDiagramCommand"
- icon="icons/obj16/ComponentDiagram.gif"
- id="org.eclipse.papyrus.diagram.component.CreateComponentDiagramCommand"
- label="UML Component Diagram"
- language="uml">
- </creationCommand>
- </extension>
-
-
- <extension point="org.eclipse.ui.contexts" id="ui-context">
- <?gmfgen generated="true"?>
- <context
- description="%context.description"
- id="org.eclipse.papyrus.diagram.component.ui.diagramContext"
- name="%context.name"
- parentId="org.eclipse.gmf.runtime.diagram.ui.diagramContext">
- </context>
- </extension>
-
-
- <extension point="org.eclipse.gmf.runtime.common.ui.services.action.globalActionHandlerProviders" id="global-actions">
- <?gmfgen generated="true"?>
- <GlobalActionHandlerProvider
- class="org.eclipse.papyrus.diagram.common.providers.PapyrusGlobalActionHandlerProvider"
- id="PapyrusUMLComponentDiagramPresentation">
- <Priority name="Highest"/>
- <ViewId id="org.eclipse.papyrus.core.papyrusEditor">
- <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- <GlobalActionId actionId="delete"/>
- </ElementType>
- <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart">
- <GlobalActionId actionId="save"/>
- </ElementType>
- </ViewId>
- </GlobalActionHandlerProvider>
- <GlobalActionHandlerProvider
- class="org.eclipse.gmf.runtime.diagram.ui.providers.ide.providers.DiagramIDEGlobalActionHandlerProvider"
- id="PapyrusUMLComponentDiagramPresentationIDE">
- <Priority name="Low"/>
- <ViewId id="org.eclipse.papyrus.core.papyrusEditor">
- <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- <GlobalActionId actionId="bookmark"/>
- </ElementType>
- </ViewId>
- </GlobalActionHandlerProvider>
- <GlobalActionHandlerProvider
- class="org.eclipse.papyrus.diagram.common.providers.PapyrusGlobalActionHandlerProvider"
- id="PapyrusUMLComponentDiagramRender">
- <Priority name="Highest"/>
- <ViewId id="org.eclipse.papyrus.core.papyrusEditor">
- <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- <GlobalActionId actionId="cut"/>
- <GlobalActionId actionId="copy"/>
- <GlobalActionId actionId="paste"/>
- </ElementType>
- </ViewId>
- </GlobalActionHandlerProvider>
- </extension>
-
-
-
- <?gmfgen generated="true"?>
-
- <?gmfgen generated="true"?>
-
- <extension point="org.eclipse.ui.preferencePages" id="prefpages">
- <?gmfgen generated="true"?>
- <page
- id="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- name="PapyrusUMLComponentDiagram Diagram"
- category="org.eclipse.papyrus.preferences.diagrams"
- class="org.eclipse.papyrus.diagram.component.preferences.DiagramGeneralPreferencePage">
- </page>
-
-
-
- <page
- id="org.eclipse.papyrus.diagram.component.preferences.DiagramPrintingPreferencePage"
- name="%prefpage.org.eclipse.uml2.uml.diagram.printing"
- category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.DiagramPrintingPreferencePage">
- </page>
-
- <page
- id="org.eclipse.papyrus.diagram.component.preferences.DiagramRulersAndGridPreferencePage"
- name="%prefpage.org.eclipse.uml2.uml.diagram.rulersAndGrid"
- category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.DiagramRulersAndGridPreferencePage">
- </page>
-
- </extension>
-
- <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor" id="prop-contrib">
- <?gmfgen generated="true"?>
- <propertyContributor
- contributorId="org.eclipse.papyrus.diagram.component"
- labelProvider="org.eclipse.papyrus.diagram.component.sheet.UMLSheetLabelProvider">
- <propertyCategory category="domain"/>
- <propertyCategory category="visual"/>
- <propertyCategory category="extra"/>
- </propertyContributor>
- </extension>
-
- <extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs" id="proptabs">
- <?gmfgen generated="true"?>
- <propertyTabs contributorId="org.eclipse.papyrus.diagram.component">
- <propertyTab
- category="visual"
- id="property.tab.AppearancePropertySection"
- label="%tab.appearance"/>
- <propertyTab
- category="visual"
- id="property.tab.DiagramPropertySection"
- label="%tab.diagram"/>
- <propertyTab
- category="domain"
- id="property.tab.domain"
- label="%tab.domain"/>
- </propertyTabs>
- </extension>
-
- <extension point="org.eclipse.ui.views.properties.tabbed.propertySections" id="propsections">
- <?gmfgen generated="true"?>
- <propertySections contributorId="org.eclipse.papyrus.diagram.component">
- <propertySection id="property.section.ConnectorAppearancePropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ConnectionEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ConnectionAppearancePropertySection"
- tab="property.tab.AppearancePropertySection">
- </propertySection>
- <propertySection id="property.section.ShapeColorAndFontPropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ShapeEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection"
- tab="property.tab.AppearancePropertySection">
- </propertySection>
- <propertySection id="property.section.DiagramColorsAndFontsPropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.DiagramColorsAndFontsPropertySection"
- tab="property.tab.AppearancePropertySection">
- </propertySection>
- <propertySection id="property.section.RulerGridPropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid.RulerGridPropertySection"
- tab="property.tab.DiagramPropertySection">
- </propertySection>
- <propertySection
- id="property.section.domain"
- tab="property.tab.domain"
- class="org.eclipse.papyrus.diagram.component.sheet.UMLPropertySection">
- <input type="org.eclipse.gmf.runtime.notation.View"/>
- <input type="org.eclipse.gef.EditPart"/>
- </propertySection>
- </propertySections>
- </extension>
-
-
-<?gmfgen generated="true"?>
-
- <extension point="org.eclipse.core.runtime.preferences">
- <?gmfgen generated="true"?>
- <initializer class="org.eclipse.papyrus.diagram.component.preferences.DiagramPreferenceInitializer"/>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
- <?gmfgen generated="true"?>
- <viewProvider class="org.eclipse.papyrus.diagram.component.providers.UMLViewProvider">
- <Priority name="Lowest"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="PapyrusUMLComponentDiagram"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="2002,2003,3200,3201,3199,3069,3070,3071,3072,3074,3075"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4001,4006,4003,4012,4014,4007,4013,4016,4015,4009,4010"/>
- </viewProvider>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
- <?gmfgen generated="true"?>
- <editpartProvider class="org.eclipse.papyrus.diagram.component.providers.UMLEditPartProvider">
- <Priority name="Lowest"/>
- <object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram">
- <method name="getType()" value="PapyrusUMLComponentDiagram"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
- <method name="getType()" value="2002,2003,3200,3201,3199,3069,3070,3071,3072,3074,3075"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
- <method name="getType()" value="4001,4006,4003,4012,4014,4007,4013,4016,4015,4009,4010"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
- <method name="getType()" value="5004,5005,5254,5255,5252,5253,5006,5007,5256,5257,0,5258,5259,5260"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
- <method name="getType()" value="7001,7002,7003,7004"/>
- </object>
- <context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/>
- </editpartProvider>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders" id="modelassist-provider">
- <?gmfgen generated="true"?>
- <modelingAssistantProvider class="org.eclipse.papyrus.diagram.component.providers.UMLModelingAssistantProvider">
- <Priority name="Lowest"/>
- <object class="org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart" id="Model_1000"/>
- <object class="org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart" id="Component_2002"/>
- <object class="org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart" id="Interface_2003"/>
- <object class="org.eclipse.papyrus.diagram.component.edit.parts.PackageEditPart" id="Package_3200"/>
- <object class="org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPart" id="Comment_3201"/>
- <object class="org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart" id="Constraint_3199"/>
- <context elements="Model_1000,Component_2002,Interface_2003,Package_3200,Comment_3201,Constraint_3199"/>
- </modelingAssistantProvider>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
- <?gmfgen generated="true"?>
- <IconProvider class="org.eclipse.papyrus.diagram.component.providers.UMLIconProvider">
- <Priority name="Low"/>
- </IconProvider>
- </extension>
-
-
- <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
- <?gmfgen generated="true"?>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.component.Model_1000"
- name="%metatype.name.Model_1000"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Model"
- edithelper="org.eclipse.papyrus.diagram.component.edit.helpers.ModelEditHelper">
- <param name="semanticHint" value="1000"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.component.Component_2002"
- name="%metatype.name.Component_2002"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Component"
- edithelper="org.eclipse.papyrus.diagram.component.edit.helpers.ComponentEditHelper">
- <param name="semanticHint" value="2002"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.component.Interface_2003"
- name="%metatype.name.Interface_2003"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Interface"
- edithelper="org.eclipse.papyrus.diagram.component.edit.helpers.InterfaceEditHelper">
- <param name="semanticHint" value="2003"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.component.Package_3200"
- name="%metatype.name.Package_3200"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Package"
- edithelper="org.eclipse.papyrus.diagram.component.edit.helpers.PackageEditHelper">
- <param name="semanticHint" value="3200"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.component.Comment_3201"
- name="%metatype.name.Comment_3201"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Comment"
- edithelper="org.eclipse.papyrus.diagram.component.edit.helpers.CommentEditHelper">
- <param name="semanticHint" value="3201"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.component.Comment_3199"
- name="%metatype.name.Constraint_3199"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Constraint"
- edithelper="org.eclipse.papyrus.diagram.component.edit.helpers.ConstraintEditHelper">
- <param name="semanticHint" value="3199"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.component.Port_3069"
- name="%metatype.name.Port_3069"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Port"
- edithelper="org.eclipse.papyrus.diagram.component.edit.helpers.PortEditHelper">
- <param name="semanticHint" value="3069"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.diagram.component.Component_3070"
- name="%metatype.name.Component_3070"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.diagram.component.Component_2002"/>
- <param name="semanticHint" value="3070"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.diagram.component.Component_3071"
- name="%metatype.name.Component_3071"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.diagram.component.Component_2002"/>
- <param name="semanticHint" value="3071"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.diagram.component.Interface_3072"
- name="%metatype.name.Interface_3072"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.diagram.component.Interface_2003"/>
- <param name="semanticHint" value="3072"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.diagram.component.Comment_3074"
- name="%metatype.name.Comment_3074"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.diagram.component.Comment_3201"/>
- <param name="semanticHint" value="3074"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.diagram.component.Constraint_3075"
- name="%metatype.name.Constraint_3075"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.diagram.component.Comment_3199"/>
- <param name="semanticHint" value="3075"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.component.Usage_4001"
- name="%metatype.name.Usage_4001"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Usage"
- edithelper="org.eclipse.papyrus.diagram.component.edit.helpers.UsageEditHelper">
- <param name="semanticHint" value="4001"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.component.InterfaceRealization_4006"
- name="%metatype.name.InterfaceRealization_4006"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="InterfaceRealization"
- edithelper="org.eclipse.papyrus.diagram.component.edit.helpers.InterfaceRealizationEditHelper">
- <param name="semanticHint" value="4006"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.component.Generalization_4003"
- name="%metatype.name.Generalization_4003"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Generalization"
- edithelper="org.eclipse.papyrus.diagram.component.edit.helpers.GeneralizationEditHelper">
- <param name="semanticHint" value="4003"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.component.Substitution_4012"
- name="%metatype.name.Substitution_4012"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Substitution"
- edithelper="org.eclipse.papyrus.diagram.component.edit.helpers.SubstitutionEditHelper">
- <param name="semanticHint" value="4012"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.component.Manifestation_4014"
- name="%metatype.name.Manifestation_4014"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Manifestation"
- edithelper="org.eclipse.papyrus.diagram.component.edit.helpers.ManifestationEditHelper">
- <param name="semanticHint" value="4014"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.component.ComponentRealization_4007"
- name="%metatype.name.ComponentRealization_4007"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="ComponentRealization"
- edithelper="org.eclipse.papyrus.diagram.component.edit.helpers.ComponentRealizationEditHelper">
- <param name="semanticHint" value="4007"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.component.Abstraction_4013"
- name="%metatype.name.Abstraction_4013"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Abstraction"
- edithelper="org.eclipse.papyrus.diagram.component.edit.helpers.AbstractionEditHelper">
- <param name="semanticHint" value="4013"/>
- </metamodelType>
- </metamodel>
- <specializationType
- id="org.eclipse.papyrus.diagram.component.Link_4016"
- name="%metatype.name.Link_4016"
- kind="org.eclipse.gmf.runtime.diagram.ui.util.INotationType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4016"/>
- </specializationType>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.diagram.component.CommentAnnotatedElement_4008"
- name="%metatype.name.CommentAnnotatedElement_4015"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4015"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.diagram.component.ConstraintConstrainedElement_4009"
- name="%metatype.name.ConstraintConstrainedElement_4009"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4009"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.component.Dependency_4010"
- name="%metatype.name.Dependency_4010"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Dependency"
- edithelper="org.eclipse.papyrus.diagram.component.edit.helpers.DependencyEditHelper">
- <param name="semanticHint" value="4010"/>
- </metamodelType>
- </metamodel>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
- <?gmfgen generated="true"?>
- <clientContext id="org.eclipse.papyrus.diagram.component.TypeContext">
- <enablement>
- <test
- property="org.eclipse.gmf.runtime.emf.core.editingDomain"
- value="org.eclipse.papyrus.diagram.component.EditingDomain"/>
- </enablement>
- </clientContext>
- <binding context="org.eclipse.papyrus.diagram.component.TypeContext">
- <elementType ref="org.eclipse.papyrus.diagram.component.Model_1000"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Component_2002"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Interface_2003"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Package_3200"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Comment_3201"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Comment_3199"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Port_3069"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Component_3070"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Component_3071"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Interface_3072"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Comment_3074"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Constraint_3075"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Usage_4001"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.InterfaceRealization_4006"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Generalization_4003"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Substitution_4012"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Manifestation_4014"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.ComponentRealization_4007"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Abstraction_4013"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Link_4016"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.CommentAnnotatedElement_4008"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.ConstraintConstrainedElement_4009"/>
- <elementType ref="org.eclipse.papyrus.diagram.component.Dependency_4010"/>
- <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
- </binding>
- </extension>
-
-
-
- <extension point="org.eclipse.ui.commands" id="update-cmd">
- <?gmfgen generated="true"?>
- <command
- categoryId="org.eclipse.ui.category.edit"
- defaultHandler="org.eclipse.papyrus.diagram.component.part.UMLDiagramUpdateCommand"
- description="%update.diagram.description"
- id="org.eclipse.papyrus.diagram.component.updateDiagram"
- name="%update.diagram.name"/>
- </extension>
-
- <extension point="org.eclipse.ui.bindings" id="update-cmd-binding">
- <?gmfgen generated="true"?>
- <key
- commandId="org.eclipse.papyrus.diagram.component.updateDiagram"
- contextId="org.eclipse.papyrus.diagram.component.ui.diagramContext"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="F5"/>
- </extension>
-
- <extension point="org.eclipse.ui.menus" id="context-menus">
- <?gmfgen generated="true"?>
- <!-- menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=">
- </menuContribution>
- <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=">
- </menuContribution -->
- <menuContribution locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu">
- <command commandId="org.eclipse.papyrus.diagram.component.LoadResourceAction">
- <visibleWhen>
- <and>
- <with variable="activePartId"><equals value="org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorID"/></with>
- <with variable="selection"><iterate ifEmpty="false">
- <instanceof value="org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart"/>
- </iterate></with>
- </and>
- </visibleWhen>
- </command>
- </menuContribution>
- </extension>
-
- <extension point="org.eclipse.ui.commands" id="menu-commands">
- <?gmfgen generated="true"?>
- <category id="org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorID" name="%cmdcategory.name" description="%cmdcategory.desc"/>
- <command id="org.eclipse.papyrus.diagram.component.LoadResourceAction"
- name="Load Resource"
- categoryId="org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorID"
- defaultHandler="org.eclipse.papyrus.diagram.component.part.LoadResourceAction"/>
- </extension>
-
- <extension point="org.eclipse.ui.handlers" id="menu-handlers">
- <?gmfgen generated="true"?>
- </extension>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<extension
- id="Papyrus Component Diagram (Incubation).palettedefinition"
- name="Papyrus Component Diagram (Incubation) Predefined Entries"
- point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
-
- <?gmfgen generated="true"?>
- <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
- <Priority name="Lowest"/>
- <contribution
- factoryClass="org.eclipse.papyrus.diagram.component.part.UMLPaletteFactory">
- <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
- <entry
- defineOnly="true"
- description="Create a Package"
- id="component.tool.package"
- kind="tool"
- label="Package"
- large_icon="icons/obj16/Package.gif"
- path=""
- small_icon="icons/obj16/Package.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Component"
- id="component.tool.component"
- kind="tool"
- label="Component"
- large_icon="icons/obj16/Component.gif"
- path=""
- small_icon="icons/obj16/Component.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create an Interface"
- id="component.tool.interface"
- kind="tool"
- label="Interface"
- large_icon="icons/obj16/InterfaceAsCercle.gif"
- path=""
- small_icon="icons/obj16/InterfaceAsCercle.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Port"
- id="component.tool.port"
- kind="tool"
- label="Port"
- large_icon="icons/obj16/Port.gif"
- path=""
- small_icon="icons/obj16/Port.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Comment"
- id="component.tool.comment"
- kind="tool"
- label="Comment"
- large_icon="icons/obj16/Comment.gif"
- path=""
- small_icon="icons/obj16/Comment.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Constraint"
- id="component.tool.constraint"
- kind="tool"
- label="Constraint"
- large_icon="icons/obj16/Constraint.gif"
- path=""
- small_icon="icons/obj16/Constraint.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Link (Comment / Constraint)"
- id="component.tool.link"
- kind="tool"
- label="Link"
- large_icon="icons/obj16/Link.gif"
- path=""
- small_icon="icons/obj16/Link.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Dependency"
- id="component.tool.dependency"
- kind="tool"
- label="Dependency"
- large_icon="icons/obj16/Dependency.gif"
- path=""
- small_icon="icons/obj16/Dependency.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create an Abstraction"
- id="component.tool.abstraction"
- kind="tool"
- label="Abstraction"
- large_icon="icons/obj16/Abstraction.gif"
- path=""
- small_icon="icons/obj16/Abstraction.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Manifestation"
- id="component.tool.manifestation"
- kind="tool"
- label="Manifestation"
- large_icon="icons/obj16/Manifestation.gif"
- path=""
- small_icon="icons/obj16/Manifestation.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Generalization link"
- id="component.tool.generalization"
- kind="tool"
- label="Generalization"
- large_icon="icons/obj16/Generalization.gif"
- path=""
- small_icon="icons/obj16/Generalization.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create an Usage"
- id="component.tool.usage"
- kind="tool"
- label="Usage"
- large_icon="icons/obj16/Usage.gif"
- path=""
- small_icon="icons/obj16/Usage.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Substitution"
- id="component.tool.substitution"
- kind="tool"
- label="Substitution"
- large_icon="icons/obj16/Substitution.gif"
- path=""
- small_icon="icons/obj16/Substitution.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create an Interface Realization"
- id="component.tool.interfaceRealization"
- kind="tool"
- label="Interface Realization"
- large_icon="icons/obj16/InterfaceRealization.gif"
- path=""
- small_icon="icons/obj16/InterfaceRealization.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Component Realization"
- id="component.tool.componentRealization"
- kind="tool"
- label="Component Realization"
- large_icon="icons/obj16/ComponentRealization.gif"
- path=""
- small_icon="icons/obj16/ComponentRealization.gif">
- </entry>
-
- </contribution>
- </paletteProvider>
-
- </extension>
-
-<extension
- id="Papyrus Component Diagram (Incubation).standard"
- name="Papyrus Component Diagram (Incubation) Standard Palette"
- point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
-
- <?gmfgen generated="true"?>
- <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
- <Priority name="Low"/>
- <contribution
- factoryClass="org.eclipse.papyrus.diagram.component.part.UMLPaletteFactory">
- <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
- <entry
- description="Diagram Nodes"
- id="component.group.nodes"
- kind="drawer"
- label="Nodes"
- large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- path="/"
- small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
- <expand
- force="true">
- </expand>
- </entry>
-
- <predefinedEntry
- id="component.tool.package"
- path="/component.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.component"
- path="/component.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.interface"
- path="/component.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.port"
- path="/component.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.comment"
- path="/component.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.constraint"
- path="/component.group.nodes">
- </predefinedEntry>
-
- <entry
- description="Diagram Links"
- id="component.group.links"
- kind="drawer"
- label="Links"
- large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- path="/"
- small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
- <expand
- force="true">
- </expand>
- </entry>
-
- <predefinedEntry
- id="component.tool.link"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.dependency"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.abstraction"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.manifestation"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.generalization"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.usage"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.substitution"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.interfaceRealization"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.componentRealization"
- path="/component.group.links">
- </predefinedEntry>
-
-
- </contribution>
- <editor id="org.eclipse.papyrus.diagram.component"/>
- </paletteProvider>
-
- </extension>
-
-<extension point="org.eclipse.ui.preferencePages">
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.InterfacePreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.InterfacePreferencePage"
- name="Interface Node" />
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.PortPreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.PortPreferencePage"
- name="Port Node" />
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.ConstraintPreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.ConstraintPreferencePage"
- name="Constraint Node" />
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.CommentPreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.CommentPreferencePage"
- name="Comment Node" />
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.PackagePreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.PackagePreferencePage"
- name="Package Node" />
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.ComponentPreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.ComponentPreferencePage"
- name="Component Node" />
-
-
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.ConstraintConstrainedElementPreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.ConstraintConstrainedElementPreferencePage"
- name="ConstraintConstrainedElement Link" />
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.AbstractionPreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.AbstractionPreferencePage"
- name="Abstraction Link" />
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.CommentAnnotatedElementPreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.CommentAnnotatedElementPreferencePage"
- name="CommentAnnotatedElement Link" />
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.SubstitutionPreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.SubstitutionPreferencePage"
- name="Substitution Link" />
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.ManifestationPreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.ManifestationPreferencePage"
- name="Manifestation Link" />
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.GeneralizationPreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.GeneralizationPreferencePage"
- name="Generalization Link" />
-
-
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.DependencyPreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.DependencyPreferencePage"
- name="Dependency Link" />
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.ComponentRealizationPreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.ComponentRealizationPreferencePage"
- name="ComponentRealization Link" />
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.InterfaceRealizationPreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.InterfaceRealizationPreferencePage"
- name="InterfaceRealization Link" />
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.diagram.component.preferences.UsagePreferencePage"
- id="org.eclipse.papyrus.diagram.component.preferences.UsagePreferencePage"
- name="Usage Link" />
-
-
-</extension>
-<extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider">
- <?gmfgen generated="true"?>
- <ParserProvider class="org.eclipse.papyrus.diagram.component.providers.UMLParserProvider">
- <Priority name="Lowest"/>
- </ParserProvider>
- </extension>
-<extension
- point="org.eclipse.gmf.runtime.diagram.ui.editpolicyProviders">
- <editpolicyProvider
- class="org.eclipse.papyrus.diagram.component.custom.providers.CustomEditPolicyProvider">
- <Priority
- name="Lowest">
- </Priority>
- </editpolicyProvider>
-</extension>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <!-- optionally, specify keybindings -->
-</plugin>
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/AbstractionCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/AbstractionCreateCommand.java
deleted file mode 100644
index b79b1990df5..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/AbstractionCreateCommand.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Abstraction;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class AbstractionCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
-
- /**
- * @generated
- */
- protected Package container;
-
- /**
- * @generated
- */
- public AbstractionCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- container = deduceContainer(source, target);
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof NamedElement) {
- return false;
- }
- if(target != null && false == target instanceof NamedElement) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- if(getContainer() == null) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateAbstraction_4013(getContainer(), getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- Abstraction newElement = UMLFactory.eINSTANCE.createAbstraction();
- getContainer().getPackagedElements().add(newElement);
- newElement.getClients().add(getSource());
- newElement.getSuppliers().add(getTarget());
- ElementInitializers.getInstance().init_Abstraction_4013(newElement);
- doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
-
- }
-
-
- /**
- * @generated
- */
- protected void doConfigure(Abstraction newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
- configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected NamedElement getSource() {
- return (NamedElement)source;
- }
-
- /**
- * @generated
- */
- protected NamedElement getTarget() {
- return (NamedElement)target;
- }
-
- /**
- * @generated
- */
- public Package getContainer() {
- return container;
- }
-
- /**
- * Default approach is to traverse ancestors of the source to find instance of container.
- * Modify with appropriate logic.
- * @generated
- */
- protected Package deduceContainer(EObject source, EObject target) {
- // Find container element for the new link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Package) {
- return (Package)element;
- }
- }
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/AbstractionReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/AbstractionReorientCommand.java
deleted file mode 100644
index 744c0e9c692..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/AbstractionReorientCommand.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Abstraction;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-
-/**
- * @generated
- */
-public class AbstractionReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public AbstractionReorientCommand(ReorientRelationshipRequest request) {
- super(request.getLabel(), request.getRelationship(), request);
- reorientDirection = request.getDirection();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == getElementToEdit() instanceof Abstraction) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getSuppliers().size() != 1) {
- return false;
- }
- NamedElement target = (NamedElement)getLink().getSuppliers().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistAbstraction_4013(container, getLink(), getNewSource(), target);
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getClients().size() != 1) {
- return false;
- }
- NamedElement source = (NamedElement)getLink().getClients().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistAbstraction_4013(container, getLink(), source, getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getLink().getClients().remove(getOldSource());
- getLink().getClients().add(getNewSource());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getLink().getSuppliers().remove(getOldTarget());
- getLink().getSuppliers().add(getNewTarget());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected Abstraction getLink() {
- return (Abstraction)getElementToEdit();
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldSource() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewSource() {
- return (NamedElement)newEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldTarget() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewTarget() {
- return (NamedElement)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentAnnotatedElementCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentAnnotatedElementCreateCommand.java
deleted file mode 100644
index 4ac9d56d840..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentAnnotatedElementCreateCommand.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * @generated
- */
-public class CommentAnnotatedElementCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
- /**
- * @generated
- */
- public CommentAnnotatedElementCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof Comment) {
- return false;
- }
- if(target != null && false == target instanceof Element) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateCommentAnnotatedElement_4015(getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- if(getSource() != null && getTarget() != null) {
- getSource().getAnnotatedElements().add(getTarget());
- }
- return CommandResult.newOKCommandResult();
-
- }
-
-
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected Comment getSource() {
- return (Comment)source;
- }
-
- /**
- * @generated
- */
- protected Element getTarget() {
- return (Element)target;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentAnnotatedElementReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentAnnotatedElementReorientCommand.java
deleted file mode 100644
index 6a6fc8e9ba9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentAnnotatedElementReorientCommand.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * @generated
- */
-public class CommentAnnotatedElementReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject referenceOwner;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public CommentAnnotatedElementReorientCommand(ReorientReferenceRelationshipRequest request) {
- super(request.getLabel(), null, request);
- reorientDirection = request.getDirection();
- referenceOwner = request.getReferenceOwner();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == referenceOwner instanceof Comment) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof Element && newEnd instanceof Comment)) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistCommentAnnotatedElement_4015(getNewSource(), getOldTarget());
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistCommentAnnotatedElement_4015(getOldSource(), getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getOldSource().getAnnotatedElements().remove(getOldTarget());
- getNewSource().getAnnotatedElements().add(getOldTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getOldSource().getAnnotatedElements().remove(getOldTarget());
- getOldSource().getAnnotatedElements().add(getNewTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected Comment getOldSource() {
- return (Comment)referenceOwner;
- }
-
- /**
- * @generated
- */
- protected Comment getNewSource() {
- return (Comment)newEnd;
- }
-
- /**
- * @generated
- */
- protected Element getOldTarget() {
- return (Element)oldEnd;
- }
-
- /**
- * @generated
- */
- protected Element getNewTarget() {
- return (Element)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentCreateCommand.java
deleted file mode 100644
index d94121ec895..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentCreateCommand.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class CommentCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public CommentCreateCommand(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static CommentCreateCommand create(CreateElementRequest req, EObject eObject) {
- return new CommentCreateCommand(req, eObject);
- }
-
- /**
- * @generated
- */
- public CommentCreateCommand(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
- // Creation constraint for TopLevelNodes
- if(!(getElementToEdit() instanceof Package)) {
- return false;
- }
-
- return true;
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Comment newElement = UMLFactory.eINSTANCE.createComment();
-
- Element owner = (Element)getElementToEdit();
- owner.getOwnedComments().add(newElement);
-
-
- ElementInitializers.getInstance().init_Comment_3201(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Comment newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentCreateCommandPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentCreateCommandPCN.java
deleted file mode 100644
index 140bb4f514a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/CommentCreateCommandPCN.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class CommentCreateCommandPCN extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public CommentCreateCommandPCN(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static CommentCreateCommandPCN create(CreateElementRequest req, EObject eObject) {
- return new CommentCreateCommandPCN(req, eObject);
- }
-
- /**
- * @generated
- */
- public CommentCreateCommandPCN(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
-
- return true;
-
-
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Comment newElement = UMLFactory.eINSTANCE.createComment();
-
- Element owner = (Element)getElementToEdit();
- owner.getOwnedComments().add(newElement);
-
-
- ElementInitializers.getInstance().init_Comment_3074(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Comment newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentCreateCommand.java
deleted file mode 100644
index 4bcf469605f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentCreateCommand.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Component;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ComponentCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public ComponentCreateCommand(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static ComponentCreateCommand create(CreateElementRequest req, EObject eObject) {
- return new ComponentCreateCommand(req, eObject);
- }
-
- /**
- * @generated
- */
- public ComponentCreateCommand(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
- // Creation constraint for TopLevelNodes
- if(!(getElementToEdit() instanceof Package)) {
- return false;
- }
-
- return true;
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Component newElement = UMLFactory.eINSTANCE.createComponent();
-
- Package owner = (Package)getElementToEdit();
- owner.getPackagedElements().add(newElement);
-
-
- ElementInitializers.getInstance().init_Component_2002(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Component newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentCreateCommandCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentCreateCommandCN.java
deleted file mode 100644
index 64bc2ae7431..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentCreateCommandCN.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.Component;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ComponentCreateCommandCN extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public ComponentCreateCommandCN(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static ComponentCreateCommandCN create(CreateElementRequest req, EObject eObject) {
- return new ComponentCreateCommandCN(req, eObject);
- }
-
- /**
- * @generated
- */
- public ComponentCreateCommandCN(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
-
- return true;
-
-
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Component newElement = UMLFactory.eINSTANCE.createComponent();
-
- Class owner = (Class)getElementToEdit();
- owner.getNestedClassifiers().add(newElement);
-
-
- ElementInitializers.getInstance().init_Component_3070(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Component newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentCreateCommandPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentCreateCommandPCN.java
deleted file mode 100644
index a62173a7087..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentCreateCommandPCN.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Component;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ComponentCreateCommandPCN extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public ComponentCreateCommandPCN(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static ComponentCreateCommandPCN create(CreateElementRequest req, EObject eObject) {
- return new ComponentCreateCommandPCN(req, eObject);
- }
-
- /**
- * @generated
- */
- public ComponentCreateCommandPCN(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
-
- return true;
-
-
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Component newElement = UMLFactory.eINSTANCE.createComponent();
-
- Package owner = (Package)getElementToEdit();
- owner.getPackagedElements().add(newElement);
-
-
- ElementInitializers.getInstance().init_Component_3071(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Component newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentRealizationCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentRealizationCreateCommand.java
deleted file mode 100644
index 7897674a028..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentRealizationCreateCommand.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.ComponentRealization;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ComponentRealizationCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
-
- /**
- * @generated
- */
- protected Package container;
-
- /**
- * @generated
- */
- public ComponentRealizationCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- container = deduceContainer(source, target);
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof NamedElement) {
- return false;
- }
- if(target != null && false == target instanceof NamedElement) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- if(getContainer() == null) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateComponentRealization_4007(getContainer(), getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- ComponentRealization newElement = UMLFactory.eINSTANCE.createComponentRealization();
- getContainer().getPackagedElements().add(newElement);
- newElement.getClients().add(getSource());
- newElement.getSuppliers().add(getTarget());
- ElementInitializers.getInstance().init_ComponentRealization_4007(newElement);
- doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
-
- }
-
-
- /**
- * @generated
- */
- protected void doConfigure(ComponentRealization newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
- configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected NamedElement getSource() {
- return (NamedElement)source;
- }
-
- /**
- * @generated
- */
- protected NamedElement getTarget() {
- return (NamedElement)target;
- }
-
- /**
- * @generated
- */
- public Package getContainer() {
- return container;
- }
-
- /**
- * Default approach is to traverse ancestors of the source to find instance of container.
- * Modify with appropriate logic.
- * @generated
- */
- protected Package deduceContainer(EObject source, EObject target) {
- // Find container element for the new link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Package) {
- return (Package)element;
- }
- }
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentRealizationReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentRealizationReorientCommand.java
deleted file mode 100644
index c7618c34251..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ComponentRealizationReorientCommand.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.ComponentRealization;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-
-/**
- * @generated
- */
-public class ComponentRealizationReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public ComponentRealizationReorientCommand(ReorientRelationshipRequest request) {
- super(request.getLabel(), request.getRelationship(), request);
- reorientDirection = request.getDirection();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == getElementToEdit() instanceof ComponentRealization) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getSuppliers().size() != 1) {
- return false;
- }
- NamedElement target = (NamedElement)getLink().getSuppliers().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistComponentRealization_4007(container, getLink(), getNewSource(), target);
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getClients().size() != 1) {
- return false;
- }
- NamedElement source = (NamedElement)getLink().getClients().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistComponentRealization_4007(container, getLink(), source, getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getLink().getClients().remove(getOldSource());
- getLink().getClients().add(getNewSource());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getLink().getSuppliers().remove(getOldTarget());
- getLink().getSuppliers().add(getNewTarget());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected ComponentRealization getLink() {
- return (ComponentRealization)getElementToEdit();
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldSource() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewSource() {
- return (NamedElement)newEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldTarget() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewTarget() {
- return (NamedElement)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintConstrainedElementCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintConstrainedElementCreateCommand.java
deleted file mode 100644
index 9773ebdf477..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintConstrainedElementCreateCommand.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * @generated
- */
-public class ConstraintConstrainedElementCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
- /**
- * @generated
- */
- public ConstraintConstrainedElementCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof Constraint) {
- return false;
- }
- if(target != null && false == target instanceof Element) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateConstraintConstrainedElement_4009(getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- if(getSource() != null && getTarget() != null) {
- getSource().getConstrainedElements().add(getTarget());
- }
- return CommandResult.newOKCommandResult();
-
- }
-
-
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected Constraint getSource() {
- return (Constraint)source;
- }
-
- /**
- * @generated
- */
- protected Element getTarget() {
- return (Element)target;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintConstrainedElementReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintConstrainedElementReorientCommand.java
deleted file mode 100644
index 328d6a2372a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintConstrainedElementReorientCommand.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * @generated
- */
-public class ConstraintConstrainedElementReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject referenceOwner;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public ConstraintConstrainedElementReorientCommand(ReorientReferenceRelationshipRequest request) {
- super(request.getLabel(), null, request);
- reorientDirection = request.getDirection();
- referenceOwner = request.getReferenceOwner();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == referenceOwner instanceof Constraint) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof Element && newEnd instanceof Constraint)) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistConstraintConstrainedElement_4009(getNewSource(), getOldTarget());
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistConstraintConstrainedElement_4009(getOldSource(), getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getOldSource().getConstrainedElements().remove(getOldTarget());
- getNewSource().getConstrainedElements().add(getOldTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getOldSource().getConstrainedElements().remove(getOldTarget());
- getOldSource().getConstrainedElements().add(getNewTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected Constraint getOldSource() {
- return (Constraint)referenceOwner;
- }
-
- /**
- * @generated
- */
- protected Constraint getNewSource() {
- return (Constraint)newEnd;
- }
-
- /**
- * @generated
- */
- protected Element getOldTarget() {
- return (Element)oldEnd;
- }
-
- /**
- * @generated
- */
- protected Element getNewTarget() {
- return (Element)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintCreateCommand.java
deleted file mode 100644
index 2131a5189c1..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintCreateCommand.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Namespace;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ConstraintCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public ConstraintCreateCommand(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static ConstraintCreateCommand create(CreateElementRequest req, EObject eObject) {
- return new ConstraintCreateCommand(req, eObject);
- }
-
- /**
- * @generated
- */
- public ConstraintCreateCommand(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
- // Creation constraint for TopLevelNodes
- if(!(getElementToEdit() instanceof Package)) {
- return false;
- }
-
- return true;
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Constraint newElement = UMLFactory.eINSTANCE.createConstraint();
-
- Namespace owner = (Namespace)getElementToEdit();
- owner.getOwnedRules().add(newElement);
-
-
- ElementInitializers.getInstance().init_Constraint_3199(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Constraint newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintCreateCommandPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintCreateCommandPCN.java
deleted file mode 100644
index 924048d1681..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ConstraintCreateCommandPCN.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Namespace;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ConstraintCreateCommandPCN extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public ConstraintCreateCommandPCN(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static ConstraintCreateCommandPCN create(CreateElementRequest req, EObject eObject) {
- return new ConstraintCreateCommandPCN(req, eObject);
- }
-
- /**
- * @generated
- */
- public ConstraintCreateCommandPCN(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
-
- return true;
-
-
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Constraint newElement = UMLFactory.eINSTANCE.createConstraint();
-
- Namespace owner = (Namespace)getElementToEdit();
- owner.getOwnedRules().add(newElement);
-
-
- ElementInitializers.getInstance().init_Constraint_3075(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Constraint newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/DependencyCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/DependencyCreateCommand.java
deleted file mode 100644
index 6023a19158d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/DependencyCreateCommand.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class DependencyCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
-
- /**
- * @generated
- */
- protected Package container;
-
- /**
- * @generated
- */
- public DependencyCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- container = deduceContainer(source, target);
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof NamedElement) {
- return false;
- }
- if(target != null && false == target instanceof NamedElement) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- if(getContainer() == null) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateDependency_4010(getContainer(), getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- Dependency newElement = UMLFactory.eINSTANCE.createDependency();
- getContainer().getPackagedElements().add(newElement);
- newElement.getClients().add(getSource());
- newElement.getSuppliers().add(getTarget());
- ElementInitializers.getInstance().init_Dependency_4010(newElement);
- doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
-
- }
-
-
- /**
- * @generated
- */
- protected void doConfigure(Dependency newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
- configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected NamedElement getSource() {
- return (NamedElement)source;
- }
-
- /**
- * @generated
- */
- protected NamedElement getTarget() {
- return (NamedElement)target;
- }
-
- /**
- * @generated
- */
- public Package getContainer() {
- return container;
- }
-
- /**
- * Default approach is to traverse ancestors of the source to find instance of container.
- * Modify with appropriate logic.
- * @generated
- */
- protected Package deduceContainer(EObject source, EObject target) {
- // Find container element for the new link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Package) {
- return (Package)element;
- }
- }
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/DependencyReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/DependencyReorientCommand.java
deleted file mode 100644
index 8b955d17b79..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/DependencyReorientCommand.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-
-/**
- * @generated
- */
-public class DependencyReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public DependencyReorientCommand(ReorientRelationshipRequest request) {
- super(request.getLabel(), request.getRelationship(), request);
- reorientDirection = request.getDirection();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == getElementToEdit() instanceof Dependency) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getSuppliers().size() != 1) {
- return false;
- }
- NamedElement target = (NamedElement)getLink().getSuppliers().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistDependency_4010(container, getLink(), getNewSource(), target);
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getClients().size() != 1) {
- return false;
- }
- NamedElement source = (NamedElement)getLink().getClients().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistDependency_4010(container, getLink(), source, getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getLink().getClients().remove(getOldSource());
- getLink().getClients().add(getNewSource());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getLink().getSuppliers().remove(getOldTarget());
- getLink().getSuppliers().add(getNewTarget());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected Dependency getLink() {
- return (Dependency)getElementToEdit();
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldSource() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewSource() {
- return (NamedElement)newEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldTarget() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewTarget() {
- return (NamedElement)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/GeneralizationCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/GeneralizationCreateCommand.java
deleted file mode 100644
index e3c91599ac5..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/GeneralizationCreateCommand.java
+++ /dev/null
@@ -1,154 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Generalization;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class GeneralizationCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
-
- /**
- * @generated
- */
- protected Classifier container;
-
- /**
- * @generated
- */
- public GeneralizationCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- container = deduceContainer(source, target);
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof Classifier) {
- return false;
- }
- if(target != null && false == target instanceof Classifier) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- if(getContainer() == null) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateGeneralization_4003(getContainer(), getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- Generalization newElement = UMLFactory.eINSTANCE.createGeneralization();
- getContainer().getGeneralizations().add(newElement);
- newElement.setSpecific(getSource());
- newElement.setGeneral(getTarget());
- doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
-
- }
-
-
- /**
- * @generated
- */
- protected void doConfigure(Generalization newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
- configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected Classifier getSource() {
- return (Classifier)source;
- }
-
- /**
- * @generated
- */
- protected Classifier getTarget() {
- return (Classifier)target;
- }
-
- /**
- * @generated
- */
- public Classifier getContainer() {
- return container;
- }
-
- /**
- * Default approach is to traverse ancestors of the source to find instance of container.
- * Modify with appropriate logic.
- * @generated
- */
- protected Classifier deduceContainer(EObject source, EObject target) {
- // Find container element for the new link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Classifier) {
- return (Classifier)element;
- }
- }
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/GeneralizationReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/GeneralizationReorientCommand.java
deleted file mode 100644
index cafa64ea095..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/GeneralizationReorientCommand.java
+++ /dev/null
@@ -1,156 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Generalization;
-
-/**
- * @generated
- */
-public class GeneralizationReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public GeneralizationReorientCommand(ReorientRelationshipRequest request) {
- super(request.getLabel(), request.getRelationship(), request);
- reorientDirection = request.getDirection();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == getElementToEdit() instanceof Generalization) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof Classifier && newEnd instanceof Classifier)) {
- return false;
- }
- Classifier target = getLink().getGeneral();
- if(!(getLink().eContainer() instanceof Classifier)) {
- return false;
- }
- Classifier container = (Classifier)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistGeneralization_4003(container, getLink(), getNewSource(), target);
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Classifier && newEnd instanceof Classifier)) {
- return false;
- }
- Classifier source = getLink().getSpecific();
- if(!(getLink().eContainer() instanceof Classifier)) {
- return false;
- }
- Classifier container = (Classifier)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistGeneralization_4003(container, getLink(), source, getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getLink().setSpecific(getNewSource());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getLink().setGeneral(getNewTarget());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected Generalization getLink() {
- return (Generalization)getElementToEdit();
- }
-
- /**
- * @generated
- */
- protected Classifier getOldSource() {
- return (Classifier)oldEnd;
- }
-
- /**
- * @generated
- */
- protected Classifier getNewSource() {
- return (Classifier)newEnd;
- }
-
- /**
- * @generated
- */
- protected Classifier getOldTarget() {
- return (Classifier)oldEnd;
- }
-
- /**
- * @generated
- */
- protected Classifier getNewTarget() {
- return (Classifier)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceCreateCommand.java
deleted file mode 100644
index 61c0fe03bd7..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceCreateCommand.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class InterfaceCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public InterfaceCreateCommand(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static InterfaceCreateCommand create(CreateElementRequest req, EObject eObject) {
- return new InterfaceCreateCommand(req, eObject);
- }
-
- /**
- * @generated
- */
- public InterfaceCreateCommand(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
- // Creation constraint for TopLevelNodes
- if(!(getElementToEdit() instanceof Package)) {
- return false;
- }
-
- return true;
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Interface newElement = UMLFactory.eINSTANCE.createInterface();
-
- Package owner = (Package)getElementToEdit();
- owner.getPackagedElements().add(newElement);
-
-
- ElementInitializers.getInstance().init_Interface_2003(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Interface newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceCreateCommandPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceCreateCommandPCN.java
deleted file mode 100644
index 28585bdf300..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceCreateCommandPCN.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class InterfaceCreateCommandPCN extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public InterfaceCreateCommandPCN(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static InterfaceCreateCommandPCN create(CreateElementRequest req, EObject eObject) {
- return new InterfaceCreateCommandPCN(req, eObject);
- }
-
- /**
- * @generated
- */
- public InterfaceCreateCommandPCN(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
-
- return true;
-
-
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Interface newElement = UMLFactory.eINSTANCE.createInterface();
-
- Package owner = (Package)getElementToEdit();
- owner.getPackagedElements().add(newElement);
-
-
- ElementInitializers.getInstance().init_Interface_3072(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Interface newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceRealizationCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceRealizationCreateCommand.java
deleted file mode 100644
index 4f9dac54e38..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceRealizationCreateCommand.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.InterfaceRealization;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class InterfaceRealizationCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
-
- /**
- * @generated
- */
- protected Package container;
-
- /**
- * @generated
- */
- public InterfaceRealizationCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- container = deduceContainer(source, target);
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof NamedElement) {
- return false;
- }
- if(target != null && false == target instanceof NamedElement) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- if(getContainer() == null) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateInterfaceRealization_4006(getContainer(), getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- InterfaceRealization newElement = UMLFactory.eINSTANCE.createInterfaceRealization();
- getContainer().getPackagedElements().add(newElement);
- newElement.getClients().add(getSource());
- newElement.getSuppliers().add(getTarget());
- ElementInitializers.getInstance().init_InterfaceRealization_4006(newElement);
- doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
-
- }
-
-
- /**
- * @generated
- */
- protected void doConfigure(InterfaceRealization newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
- configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected NamedElement getSource() {
- return (NamedElement)source;
- }
-
- /**
- * @generated
- */
- protected NamedElement getTarget() {
- return (NamedElement)target;
- }
-
- /**
- * @generated
- */
- public Package getContainer() {
- return container;
- }
-
- /**
- * Default approach is to traverse ancestors of the source to find instance of container.
- * Modify with appropriate logic.
- * @generated
- */
- protected Package deduceContainer(EObject source, EObject target) {
- // Find container element for the new link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Package) {
- return (Package)element;
- }
- }
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceRealizationReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceRealizationReorientCommand.java
deleted file mode 100644
index d9a0415ddb7..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/InterfaceRealizationReorientCommand.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.InterfaceRealization;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-
-/**
- * @generated
- */
-public class InterfaceRealizationReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public InterfaceRealizationReorientCommand(ReorientRelationshipRequest request) {
- super(request.getLabel(), request.getRelationship(), request);
- reorientDirection = request.getDirection();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == getElementToEdit() instanceof InterfaceRealization) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getSuppliers().size() != 1) {
- return false;
- }
- NamedElement target = (NamedElement)getLink().getSuppliers().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistInterfaceRealization_4006(container, getLink(), getNewSource(), target);
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getClients().size() != 1) {
- return false;
- }
- NamedElement source = (NamedElement)getLink().getClients().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistInterfaceRealization_4006(container, getLink(), source, getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getLink().getClients().remove(getOldSource());
- getLink().getClients().add(getNewSource());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getLink().getSuppliers().remove(getOldTarget());
- getLink().getSuppliers().add(getNewTarget());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected InterfaceRealization getLink() {
- return (InterfaceRealization)getElementToEdit();
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldSource() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewSource() {
- return (NamedElement)newEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldTarget() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewTarget() {
- return (NamedElement)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ManifestationCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ManifestationCreateCommand.java
deleted file mode 100644
index d09c9a17782..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ManifestationCreateCommand.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Manifestation;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ManifestationCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
-
- /**
- * @generated
- */
- protected Package container;
-
- /**
- * @generated
- */
- public ManifestationCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- container = deduceContainer(source, target);
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof NamedElement) {
- return false;
- }
- if(target != null && false == target instanceof NamedElement) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- if(getContainer() == null) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateManifestation_4014(getContainer(), getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- Manifestation newElement = UMLFactory.eINSTANCE.createManifestation();
- getContainer().getPackagedElements().add(newElement);
- newElement.getClients().add(getSource());
- newElement.getSuppliers().add(getTarget());
- ElementInitializers.getInstance().init_Manifestation_4014(newElement);
- doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
-
- }
-
-
- /**
- * @generated
- */
- protected void doConfigure(Manifestation newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
- configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected NamedElement getSource() {
- return (NamedElement)source;
- }
-
- /**
- * @generated
- */
- protected NamedElement getTarget() {
- return (NamedElement)target;
- }
-
- /**
- * @generated
- */
- public Package getContainer() {
- return container;
- }
-
- /**
- * Default approach is to traverse ancestors of the source to find instance of container.
- * Modify with appropriate logic.
- * @generated
- */
- protected Package deduceContainer(EObject source, EObject target) {
- // Find container element for the new link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Package) {
- return (Package)element;
- }
- }
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ManifestationReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ManifestationReorientCommand.java
deleted file mode 100644
index 83886915e89..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/ManifestationReorientCommand.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Manifestation;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-
-/**
- * @generated
- */
-public class ManifestationReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public ManifestationReorientCommand(ReorientRelationshipRequest request) {
- super(request.getLabel(), request.getRelationship(), request);
- reorientDirection = request.getDirection();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == getElementToEdit() instanceof Manifestation) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getSuppliers().size() != 1) {
- return false;
- }
- NamedElement target = (NamedElement)getLink().getSuppliers().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistManifestation_4014(container, getLink(), getNewSource(), target);
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getClients().size() != 1) {
- return false;
- }
- NamedElement source = (NamedElement)getLink().getClients().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistManifestation_4014(container, getLink(), source, getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getLink().getClients().remove(getOldSource());
- getLink().getClients().add(getNewSource());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getLink().getSuppliers().remove(getOldTarget());
- getLink().getSuppliers().add(getNewTarget());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected Manifestation getLink() {
- return (Manifestation)getElementToEdit();
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldSource() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewSource() {
- return (NamedElement)newEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldTarget() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewTarget() {
- return (NamedElement)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/PackageCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/PackageCreateCommand.java
deleted file mode 100644
index 74854f8838d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/PackageCreateCommand.java
+++ /dev/null
@@ -1,126 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class PackageCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public PackageCreateCommand(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static PackageCreateCommand create(CreateElementRequest req, EObject eObject) {
- return new PackageCreateCommand(req, eObject);
- }
-
- /**
- * @generated
- */
- public PackageCreateCommand(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
- // Creation constraint for TopLevelNodes
- if(!(getElementToEdit() instanceof Package)) {
- return false;
- }
-
- return true;
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Package newElement = UMLFactory.eINSTANCE.createPackage();
-
- Package owner = (Package)getElementToEdit();
- owner.getPackagedElements().add(newElement);
-
-
- ElementInitializers.getInstance().init_Package_3200(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Package newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/PortCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/PortCreateCommand.java
deleted file mode 100644
index a438ff31a74..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/PortCreateCommand.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.StructuredClassifier;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class PortCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public PortCreateCommand(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static PortCreateCommand create(CreateElementRequest req, EObject eObject) {
- return new PortCreateCommand(req, eObject);
- }
-
- /**
- * @generated
- */
- public PortCreateCommand(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
-
- return true;
-
-
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Port newElement = UMLFactory.eINSTANCE.createPort();
-
- StructuredClassifier owner = (StructuredClassifier)getElementToEdit();
- owner.getOwnedAttributes().add(newElement);
-
-
- ElementInitializers.getInstance().init_Port_3069(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Port newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/SubstitutionCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/SubstitutionCreateCommand.java
deleted file mode 100644
index 566ca968265..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/SubstitutionCreateCommand.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Substitution;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class SubstitutionCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
-
- /**
- * @generated
- */
- protected Package container;
-
- /**
- * @generated
- */
- public SubstitutionCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- container = deduceContainer(source, target);
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof NamedElement) {
- return false;
- }
- if(target != null && false == target instanceof NamedElement) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- if(getContainer() == null) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateSubstitution_4012(getContainer(), getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- Substitution newElement = UMLFactory.eINSTANCE.createSubstitution();
- getContainer().getPackagedElements().add(newElement);
- newElement.getClients().add(getSource());
- newElement.getSuppliers().add(getTarget());
- ElementInitializers.getInstance().init_Substitution_4012(newElement);
- doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
-
- }
-
-
- /**
- * @generated
- */
- protected void doConfigure(Substitution newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
- configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected NamedElement getSource() {
- return (NamedElement)source;
- }
-
- /**
- * @generated
- */
- protected NamedElement getTarget() {
- return (NamedElement)target;
- }
-
- /**
- * @generated
- */
- public Package getContainer() {
- return container;
- }
-
- /**
- * Default approach is to traverse ancestors of the source to find instance of container.
- * Modify with appropriate logic.
- * @generated
- */
- protected Package deduceContainer(EObject source, EObject target) {
- // Find container element for the new link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Package) {
- return (Package)element;
- }
- }
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/SubstitutionReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/SubstitutionReorientCommand.java
deleted file mode 100644
index c1641366c5e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/SubstitutionReorientCommand.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Substitution;
-
-/**
- * @generated
- */
-public class SubstitutionReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public SubstitutionReorientCommand(ReorientRelationshipRequest request) {
- super(request.getLabel(), request.getRelationship(), request);
- reorientDirection = request.getDirection();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == getElementToEdit() instanceof Substitution) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getSuppliers().size() != 1) {
- return false;
- }
- NamedElement target = (NamedElement)getLink().getSuppliers().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistSubstitution_4012(container, getLink(), getNewSource(), target);
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getClients().size() != 1) {
- return false;
- }
- NamedElement source = (NamedElement)getLink().getClients().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistSubstitution_4012(container, getLink(), source, getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getLink().getClients().remove(getOldSource());
- getLink().getClients().add(getNewSource());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getLink().getSuppliers().remove(getOldTarget());
- getLink().getSuppliers().add(getNewTarget());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected Substitution getLink() {
- return (Substitution)getElementToEdit();
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldSource() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewSource() {
- return (NamedElement)newEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldTarget() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewTarget() {
- return (NamedElement)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/UsageCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/UsageCreateCommand.java
deleted file mode 100644
index 73f56b097ab..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/UsageCreateCommand.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-import org.eclipse.uml2.uml.Usage;
-
-/**
- * @generated
- */
-public class UsageCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
-
- /**
- * @generated
- */
- protected Package container;
-
- /**
- * @generated
- */
- public UsageCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- container = deduceContainer(source, target);
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof NamedElement) {
- return false;
- }
- if(target != null && false == target instanceof NamedElement) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- if(getContainer() == null) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateUsage_4001(getContainer(), getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- Usage newElement = UMLFactory.eINSTANCE.createUsage();
- getContainer().getPackagedElements().add(newElement);
- newElement.getClients().add(getSource());
- newElement.getSuppliers().add(getTarget());
- ElementInitializers.getInstance().init_Usage_4001(newElement);
- doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
-
- }
-
-
- /**
- * @generated
- */
- protected void doConfigure(Usage newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
- configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected NamedElement getSource() {
- return (NamedElement)source;
- }
-
- /**
- * @generated
- */
- protected NamedElement getTarget() {
- return (NamedElement)target;
- }
-
- /**
- * @generated
- */
- public Package getContainer() {
- return container;
- }
-
- /**
- * Default approach is to traverse ancestors of the source to find instance of container.
- * Modify with appropriate logic.
- * @generated
- */
- protected Package deduceContainer(EObject source, EObject target) {
- // Find container element for the new link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Package) {
- return (Package)element;
- }
- }
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/UsageReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/UsageReorientCommand.java
deleted file mode 100644
index d4dba162a17..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/commands/UsageReorientCommand.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Usage;
-
-/**
- * @generated
- */
-public class UsageReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public UsageReorientCommand(ReorientRelationshipRequest request) {
- super(request.getLabel(), request.getRelationship(), request);
- reorientDirection = request.getDirection();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == getElementToEdit() instanceof Usage) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getSuppliers().size() != 1) {
- return false;
- }
- NamedElement target = (NamedElement)getLink().getSuppliers().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistUsage_4001(container, getLink(), getNewSource(), target);
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getClients().size() != 1) {
- return false;
- }
- NamedElement source = (NamedElement)getLink().getClients().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistUsage_4001(container, getLink(), source, getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getLink().getClients().remove(getOldSource());
- getLink().getClients().add(getNewSource());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getLink().getSuppliers().remove(getOldTarget());
- getLink().getSuppliers().add(getNewTarget());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected Usage getLink() {
- return (Usage)getElementToEdit();
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldSource() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewSource() {
- return (NamedElement)newEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldTarget() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewTarget() {
- return (NamedElement)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/AbstractionEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/AbstractionEditHelper.java
deleted file mode 100644
index 9baa633ac56..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/AbstractionEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class AbstractionEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/CommentEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/CommentEditHelper.java
deleted file mode 100644
index 96cd7f0e2ba..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/CommentEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class CommentEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ComponentEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ComponentEditHelper.java
deleted file mode 100644
index 1baba540f0a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ComponentEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class ComponentEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ComponentRealizationEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ComponentRealizationEditHelper.java
deleted file mode 100644
index 1c0a08024f8..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ComponentRealizationEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class ComponentRealizationEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ConstraintEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ConstraintEditHelper.java
deleted file mode 100644
index 8f8387d4421..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ConstraintEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class ConstraintEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/DependencyEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/DependencyEditHelper.java
deleted file mode 100644
index 2e1eecd8140..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/DependencyEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class DependencyEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/GeneralizationEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/GeneralizationEditHelper.java
deleted file mode 100644
index 93d02cb5380..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/GeneralizationEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class GeneralizationEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/InterfaceEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/InterfaceEditHelper.java
deleted file mode 100644
index 05984223e14..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/InterfaceEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class InterfaceEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/InterfaceRealizationEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/InterfaceRealizationEditHelper.java
deleted file mode 100644
index 35fc1aafdde..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/InterfaceRealizationEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class InterfaceRealizationEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ManifestationEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ManifestationEditHelper.java
deleted file mode 100644
index efa3e21648b..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ManifestationEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class ManifestationEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ModelEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ModelEditHelper.java
deleted file mode 100644
index cf185c349ac..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/ModelEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class ModelEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/PackageEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/PackageEditHelper.java
deleted file mode 100644
index 769f3c09f29..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/PackageEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class PackageEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/PortEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/PortEditHelper.java
deleted file mode 100644
index 25fd1e96b44..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/PortEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class PortEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/SubstitutionEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/SubstitutionEditHelper.java
deleted file mode 100644
index e637799657b..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/SubstitutionEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class SubstitutionEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/UMLBaseEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/UMLBaseEditHelper.java
deleted file mode 100644
index a81b499c409..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/UMLBaseEditHelper.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-/**
- * @generated
- */
-public class UMLBaseEditHelper extends AbstractEditHelper {
-
- /**
- * @generated
- */
- public static final String EDIT_POLICY_COMMAND = "edit policy command"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final String CONTEXT_ELEMENT_TYPE = "context element type"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- protected IEditHelperAdvice[] getEditHelperAdvice(IEditCommandRequest req) {
- if(req.getParameter(CONTEXT_ELEMENT_TYPE) instanceof IElementType) {
- return ElementTypeRegistry.getInstance().getEditHelperAdvice((IElementType)req.getParameter(CONTEXT_ELEMENT_TYPE));
- }
- return super.getEditHelperAdvice(req);
- }
-
- /**
- * @generated
- */
- protected ICommand getInsteadCommand(IEditCommandRequest req) {
- ICommand epCommand = (ICommand)req.getParameter(EDIT_POLICY_COMMAND);
- req.setParameter(EDIT_POLICY_COMMAND, null);
- ICommand ehCommand = super.getInsteadCommand(req);
- if(epCommand == null) {
- return ehCommand;
- }
- if(ehCommand == null) {
- return epCommand;
- }
- CompositeCommand command = new CompositeCommand(null);
- command.add(epCommand);
- command.add(ehCommand);
- return command;
- }
-
- /**
- * @generated
- */
- protected ICommand getCreateCommand(CreateElementRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected ICommand getCreateRelationshipCommand(CreateRelationshipRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected ICommand getDestroyElementCommand(DestroyElementRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected ICommand getDestroyReferenceCommand(DestroyReferenceRequest req) {
- return null;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/UsageEditHelper.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/UsageEditHelper.java
deleted file mode 100644
index d96849ae803..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/helpers/UsageEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class UsageEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/AbstractionAppliedStereotypeEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/AbstractionAppliedStereotypeEditPart.java
deleted file mode 100644
index 0cfc4d22f4c..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/AbstractionAppliedStereotypeEditPart.java
+++ /dev/null
@@ -1,723 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class AbstractionAppliedStereotypeEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 6021;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.AbstractionAppliedStereotypeEditPart.VISUAL_ID), new Point(0, 30));
- }
-
- /**
- * @generated
- */
- public AbstractionAppliedStereotypeEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Abstraction_4013, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.AbstractionAppliedStereotypeEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/AbstractionEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/AbstractionEditPart.java
deleted file mode 100644
index bebf2293a8f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/AbstractionEditPart.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeAbstractionLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.edge.DashedEdgeFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.AbstractionItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class AbstractionEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4013;
-
- /**
- * @generated
- */
- public AbstractionEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AbstractionItemSemanticEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeAbstractionLabelDisplayEditPolicy());
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof AbstractionNameEditPart) {
- ((AbstractionNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
- if(childEditPart instanceof AbstractionAppliedStereotypeEditPart) {
- ((AbstractionAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof AbstractionNameEditPart) {
- return true;
- }
- if(childEditPart instanceof AbstractionAppliedStereotypeEditPart) {
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new DashedEdgeFigure();
- }
-
- /**
- * @generated
- */
- public DashedEdgeFigure getPrimaryShape() {
- return (DashedEdgeFigure)getFigure();
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/AbstractionNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/AbstractionNameEditPart.java
deleted file mode 100644
index ff49c4b9c2d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/AbstractionNameEditPart.java
+++ /dev/null
@@ -1,723 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class AbstractionNameEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 6007;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.AbstractionNameEditPart.VISUAL_ID), new Point(0, 60));
- }
-
- /**
- * @generated
- */
- public AbstractionNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Abstraction_4013, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.AbstractionNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentAnnotatedElementEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentAnnotatedElementEditPart.java
deleted file mode 100644
index 18e586abba8..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentAnnotatedElementEditPart.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.edit.policies.CommentAnnotatedElementItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class CommentAnnotatedElementEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4015;
-
- /**
- * @generated
- */
- public CommentAnnotatedElementEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CommentAnnotatedElementItemSemanticEditPolicy());
- }
-
-
-
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
-
- protected Connection createConnectionFigure() {
- return new CommentLinkDescriptor();
- }
-
- /**
- * @generated
- */
- public CommentLinkDescriptor getPrimaryShape() {
- return (CommentLinkDescriptor)getFigure();
- }
-
-
- /**
- * @generated
- */
- public class CommentLinkDescriptor extends PolylineConnectionEx {
-
-
-
-
- /**
- * @generated
- */
- public CommentLinkDescriptor() {
- this.setLineStyle(Graphics.LINE_DASH);
-
- }
-
-
-
-
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentBodyEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentBodyEditPart.java
deleted file mode 100644
index 3cad45bc763..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentBodyEditPart.java
+++ /dev/null
@@ -1,768 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class CommentBodyEditPart extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5255;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public CommentBodyEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(HTMLCornerBentFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Comment_3201, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.CommentBodyEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentBodyEditPartPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentBodyEditPartPCN.java
deleted file mode 100644
index 3405dd1ad76..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentBodyEditPartPCN.java
+++ /dev/null
@@ -1,768 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class CommentBodyEditPartPCN extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5258;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public CommentBodyEditPartPCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(HTMLCornerBentFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Comment_3074, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.CommentBodyEditPartPCN.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentEditPart.java
deleted file mode 100644
index 12bb83d4f84..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentEditPart.java
+++ /dev/null
@@ -1,417 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editparts.AbstractCommentEditPart;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.component.edit.policies.CommentItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class CommentEditPart extends
-
-
-AbstractCommentEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3201;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public CommentEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CommentItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
- /**
- *Papyrus codeGen
- *@generated
- **/
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new HTMLCornerBentFigure();
- }
-
- /**
- * @generated
- */
- public HTMLCornerBentFigure getPrimaryShape() {
- return (HTMLCornerBentFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPart) {
- ((CommentBodyEditPart)childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
- return true;
- }
-
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPart) {
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Comment";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(CommentBodyEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof CommentEditPartPCN) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4015) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Comment_3074);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(2);
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4015) {
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Comment_3074);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Comment", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Comment", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Comment", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Comment", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentEditPartPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentEditPartPCN.java
deleted file mode 100644
index 3729991d705..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/CommentEditPartPCN.java
+++ /dev/null
@@ -1,419 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editparts.AbstractCommentEditPart;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.component.edit.policies.CommentItemSemanticEditPolicyPCN;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class CommentEditPartPCN extends
-
-
-AbstractCommentEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3074;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public CommentEditPartPCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CommentItemSemanticEditPolicyPCN());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
- /**
- *Papyrus codeGen
- *@generated
- **/
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new HTMLCornerBentFigure();
- }
-
- /**
- * @generated
- */
- public HTMLCornerBentFigure getPrimaryShape() {
- return (HTMLCornerBentFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPartPCN) {
- ((CommentBodyEditPartPCN)childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
- return true;
- }
-
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPartPCN) {
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Comment";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(CommentBodyEditPartPCN.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof CommentEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPartPCN) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4015) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Comment_3074);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(2);
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4015) {
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Comment_3074);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Comment", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Comment", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Comment", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Comment", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentCompositeCompartmentEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentCompositeCompartmentEditPart.java
deleted file mode 100644
index 7e919e51238..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentCompositeCompartmentEditPart.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.diagram.component.edit.policies.ComponentCompositeCompartmentItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.Messages;
-
-/**
- * @generated
- */
-public class ComponentCompositeCompartmentEditPart
-
-
-
-extends ShapeCompartmentEditPart
-
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 7001;
-
- /**
- * @generated
- */
- public ComponentCompositeCompartmentEditPart(View view) {
- super(view);
- }
-
-
- /**
- * @generated
- */
- public String getCompartmentName() {
- return Messages.ComponentCompositeCompartmentEditPart_title;
- }
-
- /**
- * @generated
- */
- public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setTitleVisibility(false);
- return result;
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ComponentCompositeCompartmentItemSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.component.edit.policies.ComponentCompositeCompartmentCanonicalEditPolicy());
-
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
- }
-
-
-
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- /**
- * @generated
- */
- protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentCompositeCompartmentEditPartCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentCompositeCompartmentEditPartCN.java
deleted file mode 100644
index 439ece985b5..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentCompositeCompartmentEditPartCN.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.diagram.component.edit.policies.ComponentCompositeCompartmentItemSemanticEditPolicyCN;
-import org.eclipse.papyrus.diagram.component.part.Messages;
-
-/**
- * @generated
- */
-public class ComponentCompositeCompartmentEditPartCN
-
-
-
-extends ShapeCompartmentEditPart
-
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 7003;
-
- /**
- * @generated
- */
- public ComponentCompositeCompartmentEditPartCN(View view) {
- super(view);
- }
-
-
- /**
- * @generated
- */
- public String getCompartmentName() {
- return Messages.ComponentCompositeCompartmentEditPartCN_title;
- }
-
- /**
- * @generated
- */
- public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setTitleVisibility(false);
- return result;
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ComponentCompositeCompartmentItemSemanticEditPolicyCN());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.component.edit.policies.ComponentCompositeCompartmentCanonicalEditPolicyCN());
-
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
- }
-
-
-
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- /**
- * @generated
- */
- protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentCompositeCompartmentEditPartPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentCompositeCompartmentEditPartPCN.java
deleted file mode 100644
index 12a938e764a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentCompositeCompartmentEditPartPCN.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.diagram.component.edit.policies.ComponentCompositeCompartmentItemSemanticEditPolicyPCN;
-import org.eclipse.papyrus.diagram.component.part.Messages;
-
-/**
- * @generated
- */
-public class ComponentCompositeCompartmentEditPartPCN
-
-
-
-extends ShapeCompartmentEditPart
-
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 7004;
-
- /**
- * @generated
- */
- public ComponentCompositeCompartmentEditPartPCN(View view) {
- super(view);
- }
-
-
- /**
- * @generated
- */
- public String getCompartmentName() {
- return Messages.ComponentCompositeCompartmentEditPartPCN_title;
- }
-
- /**
- * @generated
- */
- public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setTitleVisibility(false);
- return result;
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ComponentCompositeCompartmentItemSemanticEditPolicyPCN());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.component.edit.policies.ComponentCompositeCompartmentCanonicalEditPolicyPCN());
-
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
- }
-
-
-
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- /**
- * @generated
- */
- protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentDiagramEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentDiagramEditPart.java
deleted file mode 100644
index 9e1f9b7b3c1..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentDiagramEditPart.java
+++ /dev/null
@@ -1,199 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IClippingStrategy;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.BorderedNodeFigure;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.diagram.common.providers.ViewInfo;
-import org.eclipse.papyrus.diagram.common.util.MDTUtil;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.component.edit.policies.ComponentDiagramItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-
-/**
- * @generated
- */
-public class ComponentDiagramEditPart extends DiagramEditPart {
-
- /**
- * @generated
- */
- public final static String MODEL_ID = "PapyrusUMLComponentDiagram"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 1000;
-
-
-
- /**
- * @generated
- */
- public ComponentDiagramEditPart(View view) {
- super(view);
-
-
- getFigure().setClippingStrategy(new IClippingStrategy() {
-
- public Rectangle[] getClip(IFigure childFigure) {
- // very inefficient, since it implies several tree traversals. Bit handles modifications of the tree structure
- // It's a workaround instead of the better solution to fix BorderedNodeFigure (overload and let it return
- // getExtendedBounds)
- // See bug 313985 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=313985) for more details
- applyClippingStrategy(childFigure);
- if(childFigure instanceof BorderedNodeFigure) {
- return new Rectangle[]{ ((BorderedNodeFigure)childFigure).getExtendedBounds() };
-
- } else {
- return new Rectangle[]{ childFigure.getBounds() };
- }
- }
- });
- }
-
- /**
- * @generated
- */
- public void applyClippingStrategy(IFigure fig) {
- boolean hasBorderedNodeChild = false;
- for(Object child : fig.getChildren()) {
- if(child instanceof IFigure) {
- applyClippingStrategy((IFigure)child);
- if(child instanceof BorderedNodeFigure) {
- hasBorderedNodeChild = true;
- }
- }
- }
- if(hasBorderedNodeChild && (fig.getClippingStrategy() == null)) {
- fig.setClippingStrategy(new IClippingStrategy() {
-
- public Rectangle[] getClip(IFigure childFigure) {
- if(childFigure instanceof BorderedNodeFigure) {
- return new Rectangle[]{ ((BorderedNodeFigure)childFigure).getExtendedBounds() };
- } else {
- return new Rectangle[]{ childFigure.getBounds() };
- }
- }
- });
- }
-
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ComponentDiagramItemSemanticEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.component.edit.policies.ModelCanonicalEditPolicy());
-
-
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
- }
-
-
- /**
- * @generated
- */
- /*package-local*/static class NodeLabelDragPolicy extends NonResizableEditPolicy {
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List createSelectionHandles() {
- MoveHandle h = new MoveHandle((GraphicalEditPart)getHost());
- h.setBorder(null);
- return Collections.singletonList(h);
- }
-
- /**
- * @generated
- */
- public Command getCommand(Request request) {
- return null;
- }
-
- /**
- * @generated
- */
- public boolean understandsRequest(Request request) {
- return false;
- }
- }
-
-
- /**
- * @generated
- */
- /*package-local*/static class LinkLabelDragPolicy extends NonResizableLabelEditPolicy {
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
-
- super.handleNotificationEvent(event);
- if(event.getNotifier() instanceof EAnnotation) {
- EAnnotation eAnnotation = (EAnnotation)event.getNotifier();
- if(eAnnotation.getSource() != null && eAnnotation.getSource().equals(MDTUtil.FilterViewAndLabelsSource)) {
- //modification form MOSKitt approach, canonical policies are not called
- MDTUtil.filterDiagramViews(this.getDiagramView());
- }
- }
- }
-
-
- /**
- * @generated
- */
- public Object getAdapter(Class adapter) {
-
- if(adapter != null && adapter.equals(ViewInfo.class)) {
- return UMLVisualIDRegistry.getDiagramViewInfo();
- }
- return super.getAdapter(adapter);
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentEditPart.java
deleted file mode 100644
index 4d4247ba484..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentEditPart.java
+++ /dev/null
@@ -1,799 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editpolicies.AffixedNodeAlignmentEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.BorderItemResizableEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.component.custom.figure.nodes.CompositeFigure;
-import org.eclipse.papyrus.diagram.component.custom.locators.PortPositionLocator;
-import org.eclipse.papyrus.diagram.component.edit.policies.ComponentItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class ComponentEditPart extends
-
-AbstractBorderedShapeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 2002;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public ComponentEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ComponentItemSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.component.edit.policies.ComponentCanonicalEditPolicy());
-
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy(AffixedNodeAlignmentEditPolicy.AFFIXED_CHILD_ALIGNMENT_ROLE, new AffixedNodeAlignmentEditPolicy());
- installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY, new ShowHideClassifierContentsEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
- case PortEditPart.VISUAL_ID:
-
- return new BorderItemResizableEditPolicy();
-
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new CompositeFigure();
- }
-
- /**
- * @generated
- */
- public CompositeFigure getPrimaryShape() {
- return (CompositeFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ComponentNameEditPart) {
- ((ComponentNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- if(childEditPart instanceof ComponentCompositeCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((ComponentCompositeCompartmentEditPart)childEditPart).getFigure());
- return true;
- }
-
-
-
-
-
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
- IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
- return true;
- }
-
-
-
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ComponentNameEditPart) {
- return true;
- }
- if(childEditPart instanceof ComponentCompositeCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((ComponentCompositeCompartmentEditPart)childEditPart).getFigure());
- return true;
- }
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ComponentCompositeCompartmentEditPart) {
- return getPrimaryShape().getCompositeCompartmentFigure();
- }
- if(editPart instanceof IBorderItemEditPart) {
- return getBorderedFigure().getBorderItemContainer();
- }
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Component";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createMainFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(ComponentNameEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(8);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(10);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4015) {
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Comment_3074);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Component", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Component", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Component", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Component", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentEditPartCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentEditPartCN.java
deleted file mode 100644
index 86a0080f96e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentEditPartCN.java
+++ /dev/null
@@ -1,799 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editpolicies.AffixedNodeAlignmentEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.BorderItemResizableEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.component.custom.figure.nodes.CompositeFigure;
-import org.eclipse.papyrus.diagram.component.custom.locators.PortPositionLocator;
-import org.eclipse.papyrus.diagram.component.edit.policies.ComponentItemSemanticEditPolicyCN;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class ComponentEditPartCN extends
-
-AbstractBorderedShapeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3070;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public ComponentEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ComponentItemSemanticEditPolicyCN());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.component.edit.policies.ComponentCanonicalEditPolicyCN());
-
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy(AffixedNodeAlignmentEditPolicy.AFFIXED_CHILD_ALIGNMENT_ROLE, new AffixedNodeAlignmentEditPolicy());
- installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY, new ShowHideClassifierContentsEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
- case PortEditPart.VISUAL_ID:
-
- return new BorderItemResizableEditPolicy();
-
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new CompositeFigure();
- }
-
- /**
- * @generated
- */
- public CompositeFigure getPrimaryShape() {
- return (CompositeFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ComponentNameEditPartCN) {
- ((ComponentNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- if(childEditPart instanceof ComponentCompositeCompartmentEditPartCN) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((ComponentCompositeCompartmentEditPartCN)childEditPart).getFigure());
- return true;
- }
-
-
-
-
-
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
- IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
- return true;
- }
-
-
-
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ComponentNameEditPartCN) {
- return true;
- }
- if(childEditPart instanceof ComponentCompositeCompartmentEditPartCN) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((ComponentCompositeCompartmentEditPartCN)childEditPart).getFigure());
- return true;
- }
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ComponentCompositeCompartmentEditPartCN) {
- return getPrimaryShape().getCompositeCompartmentFigure();
- }
- if(editPart instanceof IBorderItemEditPart) {
- return getBorderedFigure().getBorderItemContainer();
- }
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Component";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createMainFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(ComponentNameEditPartCN.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(8);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(10);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4015) {
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Comment_3074);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Component", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Component", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Component", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Component", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentEditPartPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentEditPartPCN.java
deleted file mode 100644
index 464b32d5695..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentEditPartPCN.java
+++ /dev/null
@@ -1,799 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editpolicies.AffixedNodeAlignmentEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.BorderItemResizableEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.component.custom.figure.nodes.CompositeFigure;
-import org.eclipse.papyrus.diagram.component.custom.locators.PortPositionLocator;
-import org.eclipse.papyrus.diagram.component.edit.policies.ComponentItemSemanticEditPolicyPCN;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class ComponentEditPartPCN extends
-
-AbstractBorderedShapeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3071;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public ComponentEditPartPCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ComponentItemSemanticEditPolicyPCN());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.component.edit.policies.ComponentCanonicalEditPolicyPCN());
-
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy(AffixedNodeAlignmentEditPolicy.AFFIXED_CHILD_ALIGNMENT_ROLE, new AffixedNodeAlignmentEditPolicy());
- installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY, new ShowHideClassifierContentsEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
- case PortEditPart.VISUAL_ID:
-
- return new BorderItemResizableEditPolicy();
-
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new CompositeFigure();
- }
-
- /**
- * @generated
- */
- public CompositeFigure getPrimaryShape() {
- return (CompositeFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ComponentNameEditPartPCN) {
- ((ComponentNameEditPartPCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- if(childEditPart instanceof ComponentCompositeCompartmentEditPartPCN) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((ComponentCompositeCompartmentEditPartPCN)childEditPart).getFigure());
- return true;
- }
-
-
-
-
-
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
- IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
- return true;
- }
-
-
-
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ComponentNameEditPartPCN) {
- return true;
- }
- if(childEditPart instanceof ComponentCompositeCompartmentEditPartPCN) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((ComponentCompositeCompartmentEditPartPCN)childEditPart).getFigure());
- return true;
- }
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ComponentCompositeCompartmentEditPartPCN) {
- return getPrimaryShape().getCompositeCompartmentFigure();
- }
- if(editPart instanceof IBorderItemEditPart) {
- return getBorderedFigure().getBorderItemContainer();
- }
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Component";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createMainFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(ComponentNameEditPartPCN.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(8);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(10);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4015) {
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Comment_3074);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Component", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Component", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Component", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Component", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentNameEditPart.java
deleted file mode 100644
index ec26c2664f3..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentNameEditPart.java
+++ /dev/null
@@ -1,786 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.umlutils.ui.VisualInformationPapyrusConstant;
-import org.eclipse.papyrus.umlutils.ui.helper.NameLabelIconHelper;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ComponentNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5004;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public ComponentNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return UMLElementTypes.getImage(parserElement.eClass());
- }
- }
- return null;
-
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Component_2002, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.ComponentNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstant.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
- refreshLabel();
- }
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentNameEditPartCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentNameEditPartCN.java
deleted file mode 100644
index 3fb19141681..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentNameEditPartCN.java
+++ /dev/null
@@ -1,786 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.umlutils.ui.VisualInformationPapyrusConstant;
-import org.eclipse.papyrus.umlutils.ui.helper.NameLabelIconHelper;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ComponentNameEditPartCN extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5256;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public ComponentNameEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return UMLElementTypes.getImage(parserElement.eClass());
- }
- }
- return null;
-
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Component_3070, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.ComponentNameEditPartCN.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstant.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
- refreshLabel();
- }
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentNameEditPartPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentNameEditPartPCN.java
deleted file mode 100644
index e39505eb254..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentNameEditPartPCN.java
+++ /dev/null
@@ -1,767 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ComponentNameEditPartPCN extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5257;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public ComponentNameEditPartPCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Component_3071, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.ComponentNameEditPartPCN.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentRealizationAppliedStereotypeEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentRealizationAppliedStereotypeEditPart.java
deleted file mode 100644
index 4b4fc8d6cd1..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentRealizationAppliedStereotypeEditPart.java
+++ /dev/null
@@ -1,715 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ComponentRealizationAppliedStereotypeEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationAppliedStereotypeEditPart.VISUAL_ID), new Point(0, 30));
- }
-
- /**
- * @generated
- */
- public ComponentRealizationAppliedStereotypeEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return false;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.ComponentRealization_4007, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationAppliedStereotypeEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- // The label is read-only (defined in GMFGen model)
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentRealizationEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentRealizationEditPart.java
deleted file mode 100644
index 4f2729b1f1c..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentRealizationEditPart.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.edge.InterfaceRealizationFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.ComponentRealizationItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class ComponentRealizationEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4007;
-
- /**
- * @generated
- */
- public ComponentRealizationEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ComponentRealizationItemSemanticEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ComponentRealizationNameEditPart) {
- ((ComponentRealizationNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
- if(childEditPart instanceof ComponentRealizationAppliedStereotypeEditPart) {
- ((ComponentRealizationAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ComponentRealizationNameEditPart) {
- return true;
- }
- if(childEditPart instanceof ComponentRealizationAppliedStereotypeEditPart) {
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new InterfaceRealizationFigure();
- }
-
- /**
- * @generated
- */
- public InterfaceRealizationFigure getPrimaryShape() {
- return (InterfaceRealizationFigure)getFigure();
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentRealizationNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentRealizationNameEditPart.java
deleted file mode 100644
index 2fbfd34ca5b..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ComponentRealizationNameEditPart.java
+++ /dev/null
@@ -1,723 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ComponentRealizationNameEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationNameEditPart.VISUAL_ID), new Point(0, 60));
- }
-
- /**
- * @generated
- */
- public ComponentRealizationNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.ComponentRealization_4007, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintConstrainedElementEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintConstrainedElementEditPart.java
deleted file mode 100644
index 84a0df95790..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintConstrainedElementEditPart.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.edit.policies.ConstraintConstrainedElementItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class ConstraintConstrainedElementEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4009;
-
- /**
- * @generated
- */
- public ConstraintConstrainedElementEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ConstraintConstrainedElementItemSemanticEditPolicy());
- }
-
-
-
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
-
- protected Connection createConnectionFigure() {
- return new CommentLinkDescriptor();
- }
-
- /**
- * @generated
- */
- public CommentLinkDescriptor getPrimaryShape() {
- return (CommentLinkDescriptor)getFigure();
- }
-
-
- /**
- * @generated
- */
- public class CommentLinkDescriptor extends PolylineConnectionEx {
-
-
-
-
- /**
- * @generated
- */
- public CommentLinkDescriptor() {
- this.setLineStyle(Graphics.LINE_DASH);
-
- }
-
-
-
-
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintEditPart.java
deleted file mode 100644
index 13b1f901316..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintEditPart.java
+++ /dev/null
@@ -1,767 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editparts.AbstractConstraintEditPart;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ConstraintFigure;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.component.edit.policies.ConstraintItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class ConstraintEditPart extends
-
-
-AbstractConstraintEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3199;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public ConstraintEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ConstraintItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
- /**
- *Papyrus codeGen
- *@generated
- **/
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new ConstraintFigure();
- }
-
- /**
- * @generated
- */
- public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPart) {
- ((ConstraintNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
- if(childEditPart instanceof ConstraintSpecificationEditPart) {
- ((ConstraintSpecificationEditPart)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
- return true;
- }
-
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPart) {
- return true;
- }
- if(childEditPart instanceof ConstraintSpecificationEditPart) {
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Constraint";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(ConstraintNameEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(8);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof CommentEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof CommentEditPartPCN) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Comment_3074);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(9);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4015) {
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Comment_3074);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintEditPartPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintEditPartPCN.java
deleted file mode 100644
index d796aa3ed30..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintEditPartPCN.java
+++ /dev/null
@@ -1,769 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editparts.AbstractConstraintEditPart;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ConstraintFigure;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.component.edit.policies.ConstraintItemSemanticEditPolicyPCN;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class ConstraintEditPartPCN extends
-
-
-AbstractConstraintEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3075;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public ConstraintEditPartPCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ConstraintItemSemanticEditPolicyPCN());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
- /**
- *Papyrus codeGen
- *@generated
- **/
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new ConstraintFigure();
- }
-
- /**
- * @generated
- */
- public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPartPCN) {
- ((ConstraintNameEditPartPCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
- if(childEditPart instanceof ConstraintSpecificationEditPartPCN) {
- ((ConstraintSpecificationEditPartPCN)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
- return true;
- }
-
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPartPCN) {
- return true;
- }
- if(childEditPart instanceof ConstraintSpecificationEditPartPCN) {
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Constraint";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(ConstraintNameEditPartPCN.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(8);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof CommentEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof CommentEditPartPCN) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Comment_3074);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(9);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4015) {
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Comment_3074);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintNameEditPart.java
deleted file mode 100644
index 6d676963c81..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintNameEditPart.java
+++ /dev/null
@@ -1,786 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.umlutils.ui.VisualInformationPapyrusConstant;
-import org.eclipse.papyrus.umlutils.ui.helper.NameLabelIconHelper;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ConstraintNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5252;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public ConstraintNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return UMLElementTypes.getImage(parserElement.eClass());
- }
- }
- return null;
-
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3199, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.ConstraintNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstant.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
- refreshLabel();
- }
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintNameEditPartPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintNameEditPartPCN.java
deleted file mode 100644
index 516661fe9ed..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintNameEditPartPCN.java
+++ /dev/null
@@ -1,786 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.umlutils.ui.VisualInformationPapyrusConstant;
-import org.eclipse.papyrus.umlutils.ui.helper.NameLabelIconHelper;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ConstraintNameEditPartPCN extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5259;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public ConstraintNameEditPartPCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return UMLElementTypes.getImage(parserElement.eClass());
- }
- }
- return null;
-
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3075, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.ConstraintNameEditPartPCN.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstant.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
- refreshLabel();
- }
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintSpecificationEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintSpecificationEditPart.java
deleted file mode 100644
index 710817388cb..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintSpecificationEditPart.java
+++ /dev/null
@@ -1,787 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ConstraintFigure;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.umlutils.ui.VisualInformationPapyrusConstant;
-import org.eclipse.papyrus.umlutils.ui.helper.NameLabelIconHelper;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ConstraintSpecificationEditPart extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5253;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public ConstraintSpecificationEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(ConstraintFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return UMLElementTypes.getImage(parserElement.eClass());
- }
- }
- return null;
-
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3199, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.ConstraintSpecificationEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstant.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
- refreshLabel();
- }
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintSpecificationEditPartPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintSpecificationEditPartPCN.java
deleted file mode 100644
index 4148cf1015e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ConstraintSpecificationEditPartPCN.java
+++ /dev/null
@@ -1,787 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ConstraintFigure;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.umlutils.ui.VisualInformationPapyrusConstant;
-import org.eclipse.papyrus.umlutils.ui.helper.NameLabelIconHelper;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ConstraintSpecificationEditPartPCN extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5260;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public ConstraintSpecificationEditPartPCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(ConstraintFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return UMLElementTypes.getImage(parserElement.eClass());
- }
- }
- return null;
-
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3075, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.ConstraintSpecificationEditPartPCN.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstant.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
- refreshLabel();
- }
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/DependencyAppliedStereotypeEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/DependencyAppliedStereotypeEditPart.java
deleted file mode 100644
index 0abceda5081..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/DependencyAppliedStereotypeEditPart.java
+++ /dev/null
@@ -1,715 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class DependencyAppliedStereotypeEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 6023;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.DependencyAppliedStereotypeEditPart.VISUAL_ID), new Point(0, 60));
- }
-
- /**
- * @generated
- */
- public DependencyAppliedStereotypeEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return false;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Dependency_4010, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.DependencyAppliedStereotypeEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- // The label is read-only (defined in GMFGen model)
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/DependencyEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/DependencyEditPart.java
deleted file mode 100644
index 93970bbbe40..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/DependencyEditPart.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.edge.DashedEdgeFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.DependencyItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class DependencyEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4010;
-
- /**
- * @generated
- */
- public DependencyEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DependencyItemSemanticEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DependencyNameEditPart) {
- ((DependencyNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
- if(childEditPart instanceof DependencyAppliedStereotypeEditPart) {
- ((DependencyAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DependencyNameEditPart) {
- return true;
- }
- if(childEditPart instanceof DependencyAppliedStereotypeEditPart) {
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new DashedEdgeFigure();
- }
-
- /**
- * @generated
- */
- public DashedEdgeFigure getPrimaryShape() {
- return (DashedEdgeFigure)getFigure();
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/DependencyNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/DependencyNameEditPart.java
deleted file mode 100644
index ae545552881..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/DependencyNameEditPart.java
+++ /dev/null
@@ -1,723 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class DependencyNameEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 6009;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.DependencyNameEditPart.VISUAL_ID), new Point(0, 60));
- }
-
- /**
- * @generated
- */
- public DependencyNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Dependency_4010, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.DependencyNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/GeneralizationAppliedStereotypeEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/GeneralizationAppliedStereotypeEditPart.java
deleted file mode 100644
index ecc2d9ed5a9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/GeneralizationAppliedStereotypeEditPart.java
+++ /dev/null
@@ -1,715 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class GeneralizationAppliedStereotypeEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 2;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.GeneralizationAppliedStereotypeEditPart.VISUAL_ID), new Point(0, 60));
- }
-
- /**
- * @generated
- */
- public GeneralizationAppliedStereotypeEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return false;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Generalization_4003, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.GeneralizationAppliedStereotypeEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- // The label is read-only (defined in GMFGen model)
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/GeneralizationEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/GeneralizationEditPart.java
deleted file mode 100644
index 44af81dd346..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/GeneralizationEditPart.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.edge.GeneralizationFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.GeneralizationItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class GeneralizationEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4003;
-
- /**
- * @generated
- */
- public GeneralizationEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new GeneralizationItemSemanticEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof GeneralizationAppliedStereotypeEditPart) {
- ((GeneralizationAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof GeneralizationAppliedStereotypeEditPart) {
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new GeneralizationFigure();
- }
-
- /**
- * @generated
- */
- public GeneralizationFigure getPrimaryShape() {
- return (GeneralizationFigure)getFigure();
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceEditPart.java
deleted file mode 100644
index b4f3f2463c3..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceEditPart.java
+++ /dev/null
@@ -1,739 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Ellipse;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.editpolicies.ResizableEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.common.locator.ExternalLabelPositionLocator;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.component.edit.policies.InterfaceItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class InterfaceEditPart extends
-
-AbstractBorderedShapeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 2003;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public InterfaceEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new InterfaceItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
- case InterfaceNameEditPart.VISUAL_ID:
- return new BorderItemSelectionEditPolicy() {
-
- protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
- };
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new InterfaceAsCercle();
- }
-
- /**
- * @generated
- */
- public InterfaceAsCercle getPrimaryShape() {
- return (InterfaceAsCercle)primaryShape;
- }
-
-
- /**
- * @generated
- */
- protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof InterfaceNameEditPart) {
- IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else {
- super.addBorderItem(borderItemContainer, borderItemEditPart);
- }
- }
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Interface";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
- /**
- * @generated
- */
- public EditPolicy getPrimaryDragEditPolicy() {
- EditPolicy result = super.getPrimaryDragEditPolicy();
- if(result instanceof ResizableEditPolicy) {
- ResizableEditPolicy ep = (ResizableEditPolicy)result;
- ep.setResizeDirections(PositionConstants.NONE);
- }
- return result;
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createMainFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(InterfaceNameEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(8);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(10);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4015) {
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Comment_3074);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- public class InterfaceAsCercle extends Ellipse {
-
-
-
-
- /**
- * @generated
- */
- public InterfaceAsCercle() {
- this.setFill(false);
- this.setForegroundColor(ColorConstants.black);
- }
-
-
-
-
-
- }
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Interface", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Interface", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Interface", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Interface", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceEditPartPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceEditPartPCN.java
deleted file mode 100644
index a8dc1abd3ba..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceEditPartPCN.java
+++ /dev/null
@@ -1,741 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Ellipse;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.editpolicies.ResizableEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.common.locator.ExternalLabelPositionLocator;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.component.edit.policies.InterfaceItemSemanticEditPolicyPCN;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class InterfaceEditPartPCN extends
-
-AbstractBorderedShapeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3072;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public InterfaceEditPartPCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new InterfaceItemSemanticEditPolicyPCN());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
- case InterfaceNameEditPartPCN.VISUAL_ID:
- return new BorderItemSelectionEditPolicy() {
-
- protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
- };
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new InterfaceAsCercle();
- }
-
- /**
- * @generated
- */
- public InterfaceAsCercle getPrimaryShape() {
- return (InterfaceAsCercle)primaryShape;
- }
-
-
- /**
- * @generated
- */
- protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof InterfaceNameEditPartPCN) {
- IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else {
- super.addBorderItem(borderItemContainer, borderItemEditPart);
- }
- }
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Interface";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
- /**
- * @generated
- */
- public EditPolicy getPrimaryDragEditPolicy() {
- EditPolicy result = super.getPrimaryDragEditPolicy();
- if(result instanceof ResizableEditPolicy) {
- ResizableEditPolicy ep = (ResizableEditPolicy)result;
- ep.setResizeDirections(PositionConstants.NONE);
- }
- return result;
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createMainFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(InterfaceNameEditPartPCN.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(8);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(10);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4015) {
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Comment_3074);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- public class InterfaceAsCercle extends Ellipse {
-
-
-
-
- /**
- * @generated
- */
- public InterfaceAsCercle() {
- this.setFill(false);
- this.setForegroundColor(ColorConstants.black);
- }
-
-
-
-
-
- }
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Interface", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Interface", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Interface", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Interface", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceNameEditPart.java
deleted file mode 100644
index a1f3f0e7cf1..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceNameEditPart.java
+++ /dev/null
@@ -1,774 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class InterfaceNameEditPart
-
-
-extends LabelEditPart
-
-
-implements ITextAwareEditPart, IBorderItemEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5005;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.InterfaceNameEditPart.VISUAL_ID), new Point(0, 0));
- }
-
- /**
- * @generated
- */
- public InterfaceNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- }
-
- /**
- * @generated
- */
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
- }
- return null;
- }
-
- /**
- * @generated
- */
- public void refreshBounds() {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Interface_2003, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.InterfaceNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- /**
- * @generated
- */
- protected IFigure createFigurePrim() {
- return new InterfaceAsCercle_nameLabel();
- }
-
-
- /**
- * @generated
- */
- public class InterfaceAsCercle_nameLabel extends WrappingLabel {
-
-
-
-
- /**
- * @generated
- */
- public InterfaceAsCercle_nameLabel() {
- this.setText("");
- }
-
-
-
-
-
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceNameEditPartPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceNameEditPartPCN.java
deleted file mode 100644
index 3a501c030d2..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceNameEditPartPCN.java
+++ /dev/null
@@ -1,774 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class InterfaceNameEditPartPCN
-
-
-extends LabelEditPart
-
-
-implements ITextAwareEditPart, IBorderItemEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 0;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.InterfaceNameEditPartPCN.VISUAL_ID), new Point(0, 0));
- }
-
- /**
- * @generated
- */
- public InterfaceNameEditPartPCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- }
-
- /**
- * @generated
- */
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
- }
- return null;
- }
-
- /**
- * @generated
- */
- public void refreshBounds() {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Interface_3072, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.InterfaceNameEditPartPCN.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- /**
- * @generated
- */
- protected IFigure createFigurePrim() {
- return new InterfaceAsCercle_nameLabel();
- }
-
-
- /**
- * @generated
- */
- public class InterfaceAsCercle_nameLabel extends WrappingLabel {
-
-
-
-
- /**
- * @generated
- */
- public InterfaceAsCercle_nameLabel() {
- this.setText("");
- }
-
-
-
-
-
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceRealizationEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceRealizationEditPart.java
deleted file mode 100644
index da8c5779d48..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/InterfaceRealizationEditPart.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.edit.policies.InterfaceRealizationItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class InterfaceRealizationEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4006;
-
- /**
- * @generated
- */
- public InterfaceRealizationEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new InterfaceRealizationItemSemanticEditPolicy());
- }
-
-
-
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
-
- protected Connection createConnectionFigure() {
- return new SimpleDependency();
- }
-
- /**
- * @generated
- */
- public SimpleDependency getPrimaryShape() {
- return (SimpleDependency)getFigure();
- }
-
-
- /**
- * @generated
- */
- public class SimpleDependency extends PolylineConnectionEx {
-
-
-
-
- /**
- * @generated
- */
- public SimpleDependency() {
- this.setForegroundColor(ColorConstants.black);
-
- }
-
-
-
-
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/LinkDescriptorEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/LinkDescriptorEditPart.java
deleted file mode 100644
index cd07ae2f2a6..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/LinkDescriptorEditPart.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ViewComponentEditPolicy;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * @generated
- */
-public class LinkDescriptorEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4016;
-
- /**
- * @generated
- */
- public LinkDescriptorEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.COMPONENT_ROLE, new ViewComponentEditPolicy());
- removeEditPolicy(EditPolicyRoles.SEMANTIC_ROLE);
- }
-
-
-
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
-
- protected Connection createConnectionFigure() {
- return new LinkDescriptor();
- }
-
- /**
- * @generated
- */
- public LinkDescriptor getPrimaryShape() {
- return (LinkDescriptor)getFigure();
- }
-
-
- /**
- * @generated
- */
- public class LinkDescriptor extends PolylineConnectionEx {
-
-
-
-
- /**
- * @generated
- */
- public LinkDescriptor() {
- this.setLineWidth(1);
- this.setLineStyle(Graphics.LINE_DASH);
-
- }
-
-
-
-
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ManifestationAppliedStereotypeEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ManifestationAppliedStereotypeEditPart.java
deleted file mode 100644
index fbd267f0219..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ManifestationAppliedStereotypeEditPart.java
+++ /dev/null
@@ -1,723 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ManifestationAppliedStereotypeEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 6022;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.ManifestationAppliedStereotypeEditPart.VISUAL_ID), new Point(0, 30));
- }
-
- /**
- * @generated
- */
- public ManifestationAppliedStereotypeEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Manifestation_4014, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.ManifestationAppliedStereotypeEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ManifestationEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ManifestationEditPart.java
deleted file mode 100644
index 05591667bf8..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ManifestationEditPart.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeManifestationLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.edge.DashedEdgeFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.ManifestationItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class ManifestationEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4014;
-
- /**
- * @generated
- */
- public ManifestationEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ManifestationItemSemanticEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeManifestationLabelDisplayEditPolicy());
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ManifestationNameEditPart) {
- ((ManifestationNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
- if(childEditPart instanceof ManifestationAppliedStereotypeEditPart) {
- ((ManifestationAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ManifestationNameEditPart) {
- return true;
- }
- if(childEditPart instanceof ManifestationAppliedStereotypeEditPart) {
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new DashedEdgeFigure();
- }
-
- /**
- * @generated
- */
- public DashedEdgeFigure getPrimaryShape() {
- return (DashedEdgeFigure)getFigure();
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ManifestationNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ManifestationNameEditPart.java
deleted file mode 100644
index 706fdbf7464..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/ManifestationNameEditPart.java
+++ /dev/null
@@ -1,723 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ManifestationNameEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 6008;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.ManifestationNameEditPart.VISUAL_ID), new Point(0, 60));
- }
-
- /**
- * @generated
- */
- public ManifestationNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Manifestation_4014, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.ManifestationNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PackageEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PackageEditPart.java
deleted file mode 100644
index accdd1b1f6c..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PackageEditPart.java
+++ /dev/null
@@ -1,720 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.PackageFigure;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.component.edit.policies.PackageItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class PackageEditPart extends
-
-ShapeNodeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3200;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public PackageEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new PackageItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new PackageFigure();
- }
-
- /**
- * @generated
- */
- public PackageFigure getPrimaryShape() {
- return (PackageFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof PackageNameEditPart) {
- ((PackageNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- if(childEditPart instanceof PackagePackageableElementCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getPackageableElementFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((PackagePackageableElementCompartmentEditPart)childEditPart).getFigure());
- return true;
- }
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof PackageNameEditPart) {
- return true;
- }
- if(childEditPart instanceof PackagePackageableElementCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getPackageableElementFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((PackagePackageableElementCompartmentEditPart)childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof PackagePackageableElementCompartmentEditPart) {
- return getPrimaryShape().getPackageableElementFigure();
- }
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Package";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(PackageNameEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(7);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.PackageEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.PackageEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.PackageEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.PackageEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.PackageEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.PackageEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.PackageEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PortEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(9);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4015) {
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Comment_3074);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Package", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Package", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Package", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Package", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PackageNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PackageNameEditPart.java
deleted file mode 100644
index f6808fb014d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PackageNameEditPart.java
+++ /dev/null
@@ -1,786 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.umlutils.ui.VisualInformationPapyrusConstant;
-import org.eclipse.papyrus.umlutils.ui.helper.NameLabelIconHelper;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class PackageNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5254;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public PackageNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return UMLElementTypes.getImage(parserElement.eClass());
- }
- }
- return null;
-
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Package_3200, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.PackageNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstant.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
- refreshLabel();
- }
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PackagePackageableElementCompartmentEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PackagePackageableElementCompartmentEditPart.java
deleted file mode 100644
index c35866d81d1..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PackagePackageableElementCompartmentEditPart.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.diagram.component.edit.policies.PackagePackageableElementCompartmentItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.Messages;
-
-/**
- * @generated
- */
-public class PackagePackageableElementCompartmentEditPart
-
-
-
-extends ShapeCompartmentEditPart
-
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 7002;
-
- /**
- * @generated
- */
- public PackagePackageableElementCompartmentEditPart(View view) {
- super(view);
- }
-
-
- /**
- * @generated
- */
- public String getCompartmentName() {
- return Messages.PackagePackageableElementCompartmentEditPart_title;
- }
-
- /**
- * @generated
- */
- public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setTitleVisibility(false);
- return result;
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new PackagePackageableElementCompartmentItemSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.component.edit.policies.PackagePackageableElementCompartmentCanonicalEditPolicy());
-
- }
-
-
-
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- /**
- * @generated
- */
- protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PortAppliedStereotypeEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PortAppliedStereotypeEditPart.java
deleted file mode 100644
index deea332d832..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PortAppliedStereotypeEditPart.java
+++ /dev/null
@@ -1,746 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeExternalNodeEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.AppliedStereotypeWrappingLabelFigure;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class PortAppliedStereotypeEditPart
-
-
-extends LabelEditPart
-
-
-implements ITextAwareEditPart, IBorderItemEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5007;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.PortAppliedStereotypeEditPart.VISUAL_ID), new Point(0, 0));
- }
-
- /**
- * @generated
- */
- public PortAppliedStereotypeEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeExternalNodeEditPolicy());
- }
-
- /**
- * @generated
- */
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
- }
- return null;
- }
-
- /**
- * @generated
- */
- public void refreshBounds() {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return false;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Port_3069, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.PortAppliedStereotypeEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- // The label is read-only (defined in GMFGen model)
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- /**
- * @generated
- */
- protected IFigure createFigurePrim() {
- return new AppliedStereotypeWrappingLabelFigure();
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PortEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PortEditPart.java
deleted file mode 100644
index 5a5c91cce0a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PortEditPart.java
+++ /dev/null
@@ -1,707 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editparts.AbstractBorderEditPart;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeIconlDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.common.locator.ExternalLabelPositionLocator;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.GraphicalNodeEditPolicy;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.PortLayoutEditPolicy;
-import org.eclipse.papyrus.diagram.component.custom.figure.nodes.PortFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.PortItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class PortEditPart extends
-
-
-AbstractBorderEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3069;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public PortEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new PortItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new org.eclipse.papyrus.diagram.component.custom.edit.policies.PortItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new GraphicalNodeEditPolicy());
- installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeIconlDisplayEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, new PortLayoutEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
- /**
- *Papyrus codeGen
- *@generated
- **/
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
- case PortNameEditPart.VISUAL_ID:
- case PortAppliedStereotypeEditPart.VISUAL_ID:
- return new BorderItemSelectionEditPolicy() {
-
- protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
- };
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new PortFigure();
- }
-
- /**
- * @generated
- */
- public PortFigure getPrimaryShape() {
- return (PortFigure)primaryShape;
- }
-
-
- /**
- * @generated
- */
- protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof PortAppliedStereotypeEditPart) {
- BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
- locator.setBorderItemOffset(new Dimension(-20, -20));
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else if(borderItemEditPart instanceof PortNameEditPart) {
- IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else {
- super.addBorderItem(borderItemContainer, borderItemEditPart);
- }
- }
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Port";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
-
- //FIXME: workaround for #154536
- result.getBounds().setSize(result.getPreferredSize());
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createMainFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(PortNameEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(7);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Usage_4001);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.InterfaceRealization_4006);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Substitution_4012);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Manifestation_4014);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.ComponentRealization_4007);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Abstraction_4013);
- }
- if(targetEditPart instanceof ComponentEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof PackageEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- types.add(UMLElementTypes.Dependency_4010);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(9);
- types.add(UMLElementTypes.Usage_4001);
- types.add(UMLElementTypes.InterfaceRealization_4006);
- types.add(UMLElementTypes.Substitution_4012);
- types.add(UMLElementTypes.Manifestation_4014);
- types.add(UMLElementTypes.ComponentRealization_4007);
- types.add(UMLElementTypes.Abstraction_4013);
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Dependency_4010);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Usage_4001) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.InterfaceRealization_4006) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Substitution_4012) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Manifestation_4014) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.ComponentRealization_4007) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Abstraction_4013) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4015) {
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Comment_3074);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Constraint_3075);
- } else if(relationshipType == UMLElementTypes.Dependency_4010) {
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Port_3069);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Constraint_3075);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Port", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Port", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Port", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Port", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PortNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PortNameEditPart.java
deleted file mode 100644
index 4202afd8961..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/PortNameEditPart.java
+++ /dev/null
@@ -1,752 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.custom.edit.policies.PropertyLabelEditPolicy;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class PortNameEditPart
-
-
-extends LabelEditPart
-
-
-implements ITextAwareEditPart, IBorderItemEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5006;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.PortNameEditPart.VISUAL_ID), new Point(0, 0));
- }
-
- /**
- * @generated
- */
- public PortNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new PropertyLabelEditPolicy());
- }
-
- /**
- * @generated
- */
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
- }
- return null;
- }
-
- /**
- * @generated
- */
- public void refreshBounds() {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Port_3069, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.PortNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- /**
- * @generated
- */
- protected IFigure createFigurePrim() {
- return new WrappingLabel();
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/SubstitutionAppliedStereotypeEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/SubstitutionAppliedStereotypeEditPart.java
deleted file mode 100644
index 36be1f143ed..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/SubstitutionAppliedStereotypeEditPart.java
+++ /dev/null
@@ -1,723 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class SubstitutionAppliedStereotypeEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 6020;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionAppliedStereotypeEditPart.VISUAL_ID), new Point(0, 30));
- }
-
- /**
- * @generated
- */
- public SubstitutionAppliedStereotypeEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Substitution_4012, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionAppliedStereotypeEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/SubstitutionEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/SubstitutionEditPart.java
deleted file mode 100644
index 79372039262..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/SubstitutionEditPart.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeSubstitutionLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.edge.InterfaceRealizationFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.SubstitutionItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class SubstitutionEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4012;
-
- /**
- * @generated
- */
- public SubstitutionEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new SubstitutionItemSemanticEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeSubstitutionLabelDisplayEditPolicy());
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof SubstitutionNameEditPart) {
- ((SubstitutionNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
- if(childEditPart instanceof SubstitutionAppliedStereotypeEditPart) {
- ((SubstitutionAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof SubstitutionNameEditPart) {
- return true;
- }
- if(childEditPart instanceof SubstitutionAppliedStereotypeEditPart) {
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new InterfaceRealizationFigure();
- }
-
- /**
- * @generated
- */
- public InterfaceRealizationFigure getPrimaryShape() {
- return (InterfaceRealizationFigure)getFigure();
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/SubstitutionNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/SubstitutionNameEditPart.java
deleted file mode 100644
index f85f0a25356..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/SubstitutionNameEditPart.java
+++ /dev/null
@@ -1,723 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.component.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class SubstitutionNameEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 6006;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionNameEditPart.VISUAL_ID), new Point(0, 60));
- }
-
- /**
- * @generated
- */
- public SubstitutionNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ComponentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Substitution_4012, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/UMLEditPartFactory.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/UMLEditPartFactory.java
deleted file mode 100644
index c7456696878..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/UMLEditPartFactory.java
+++ /dev/null
@@ -1,353 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.papyrus.diagram.common.figure.node.IMultilineEditableFigure;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @generated
- */
-public class UMLEditPartFactory implements EditPartFactory {
-
- /**
- * @generated
- */
- public EditPart createEditPart(EditPart context, Object model) {
- if(model instanceof View) {
- View view = (View)model;
- switch(UMLVisualIDRegistry.getVisualID(view)) {
-
- case ComponentDiagramEditPart.VISUAL_ID:
- return new ComponentDiagramEditPart(view);
-
- case ComponentEditPart.VISUAL_ID:
- return new ComponentEditPart(view);
-
- case ComponentNameEditPart.VISUAL_ID:
- return new ComponentNameEditPart(view);
-
- case InterfaceEditPart.VISUAL_ID:
- return new InterfaceEditPart(view);
-
- case InterfaceNameEditPart.VISUAL_ID:
- return new InterfaceNameEditPart(view);
-
- case PackageEditPart.VISUAL_ID:
- return new PackageEditPart(view);
-
- case PackageNameEditPart.VISUAL_ID:
- return new PackageNameEditPart(view);
-
- case CommentEditPart.VISUAL_ID:
- return new CommentEditPart(view);
-
- case CommentBodyEditPart.VISUAL_ID:
- return new CommentBodyEditPart(view);
-
- case ConstraintEditPart.VISUAL_ID:
- return new ConstraintEditPart(view);
-
- case ConstraintNameEditPart.VISUAL_ID:
- return new ConstraintNameEditPart(view);
-
- case ConstraintSpecificationEditPart.VISUAL_ID:
- return new ConstraintSpecificationEditPart(view);
-
- case PortEditPart.VISUAL_ID:
- return new PortEditPart(view);
-
- case PortNameEditPart.VISUAL_ID:
- return new PortNameEditPart(view);
-
- case PortAppliedStereotypeEditPart.VISUAL_ID:
- return new PortAppliedStereotypeEditPart(view);
-
- case ComponentEditPartCN.VISUAL_ID:
- return new ComponentEditPartCN(view);
-
- case ComponentNameEditPartCN.VISUAL_ID:
- return new ComponentNameEditPartCN(view);
-
- case ComponentEditPartPCN.VISUAL_ID:
- return new ComponentEditPartPCN(view);
-
- case ComponentNameEditPartPCN.VISUAL_ID:
- return new ComponentNameEditPartPCN(view);
-
- case InterfaceEditPartPCN.VISUAL_ID:
- return new InterfaceEditPartPCN(view);
-
- case InterfaceNameEditPartPCN.VISUAL_ID:
- return new InterfaceNameEditPartPCN(view);
-
- case CommentEditPartPCN.VISUAL_ID:
- return new CommentEditPartPCN(view);
-
- case CommentBodyEditPartPCN.VISUAL_ID:
- return new CommentBodyEditPartPCN(view);
-
- case ConstraintEditPartPCN.VISUAL_ID:
- return new ConstraintEditPartPCN(view);
-
- case ConstraintNameEditPartPCN.VISUAL_ID:
- return new ConstraintNameEditPartPCN(view);
-
- case ConstraintSpecificationEditPartPCN.VISUAL_ID:
- return new ConstraintSpecificationEditPartPCN(view);
-
- case ComponentCompositeCompartmentEditPart.VISUAL_ID:
- return new ComponentCompositeCompartmentEditPart(view);
-
- case PackagePackageableElementCompartmentEditPart.VISUAL_ID:
- return new PackagePackageableElementCompartmentEditPart(view);
-
- case ComponentCompositeCompartmentEditPartCN.VISUAL_ID:
- return new ComponentCompositeCompartmentEditPartCN(view);
-
- case ComponentCompositeCompartmentEditPartPCN.VISUAL_ID:
- return new ComponentCompositeCompartmentEditPartPCN(view);
-
- case UsageEditPart.VISUAL_ID:
- return new UsageEditPart(view);
-
-
- case InterfaceRealizationEditPart.VISUAL_ID:
- return new InterfaceRealizationEditPart(view);
-
-
- case GeneralizationEditPart.VISUAL_ID:
- return new GeneralizationEditPart(view);
-
- case GeneralizationAppliedStereotypeEditPart.VISUAL_ID:
- return new GeneralizationAppliedStereotypeEditPart(view);
-
-
- case SubstitutionEditPart.VISUAL_ID:
- return new SubstitutionEditPart(view);
-
- case SubstitutionNameEditPart.VISUAL_ID:
- return new SubstitutionNameEditPart(view);
-
- case SubstitutionAppliedStereotypeEditPart.VISUAL_ID:
- return new SubstitutionAppliedStereotypeEditPart(view);
-
-
- case ManifestationEditPart.VISUAL_ID:
- return new ManifestationEditPart(view);
-
- case ManifestationNameEditPart.VISUAL_ID:
- return new ManifestationNameEditPart(view);
-
- case ManifestationAppliedStereotypeEditPart.VISUAL_ID:
- return new ManifestationAppliedStereotypeEditPart(view);
-
-
- case ComponentRealizationEditPart.VISUAL_ID:
- return new ComponentRealizationEditPart(view);
-
- case ComponentRealizationNameEditPart.VISUAL_ID:
- return new ComponentRealizationNameEditPart(view);
-
- case ComponentRealizationAppliedStereotypeEditPart.VISUAL_ID:
- return new ComponentRealizationAppliedStereotypeEditPart(view);
-
-
- case AbstractionEditPart.VISUAL_ID:
- return new AbstractionEditPart(view);
-
- case AbstractionNameEditPart.VISUAL_ID:
- return new AbstractionNameEditPart(view);
-
- case AbstractionAppliedStereotypeEditPart.VISUAL_ID:
- return new AbstractionAppliedStereotypeEditPart(view);
-
-
- case LinkDescriptorEditPart.VISUAL_ID:
- return new LinkDescriptorEditPart(view);
-
-
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return new CommentAnnotatedElementEditPart(view);
-
-
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return new ConstraintConstrainedElementEditPart(view);
-
-
- case DependencyEditPart.VISUAL_ID:
- return new DependencyEditPart(view);
-
- case DependencyNameEditPart.VISUAL_ID:
- return new DependencyNameEditPart(view);
-
- case DependencyAppliedStereotypeEditPart.VISUAL_ID:
- return new DependencyAppliedStereotypeEditPart(view);
-
- }
- }
- return createUnrecognizedEditPart(context, model);
- }
-
- /**
- * @generated
- */
- private EditPart createUnrecognizedEditPart(EditPart context, Object model) {
- // Handle creation of unrecognized child node EditParts here
- return null;
- }
-
- /**
- * @generated
- */
- public static CellEditorLocator getTextCellEditorLocator(ITextAwareEditPart source) {
- if(source.getFigure() instanceof IMultilineEditableFigure)
- return new MultilineCellEditorLocator((IMultilineEditableFigure)source.getFigure());
- else if(source.getFigure() instanceof WrappingLabel)
- return new TextCellEditorLocator((WrappingLabel)source.getFigure());
- else {
- return new LabelCellEditorLocator((Label)source.getFigure());
- }
- }
-
-
- /**
- * @generated
- */
- static private class MultilineCellEditorLocator implements CellEditorLocator {
-
- /**
- * @generated
- */
- private IMultilineEditableFigure multilineEditableFigure;
-
- /**
- * @generated
- */
- public MultilineCellEditorLocator(IMultilineEditableFigure figure) {
- this.multilineEditableFigure = figure;
- }
-
- /**
- * @generated
- */
- public IMultilineEditableFigure getMultilineEditableFigure() {
- return multilineEditableFigure;
- }
-
- /**
- * @generated
- */
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- Rectangle rect = getMultilineEditableFigure().getBounds().getCopy();
- rect.x = getMultilineEditableFigure().getEditionLocation().x;
- rect.y = getMultilineEditableFigure().getEditionLocation().y;
- getMultilineEditableFigure().translateToAbsolute(rect);
- if(getMultilineEditableFigure().getText().length() > 0) {
- rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
- }
- if(!rect.equals(new Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
- }
-
-
- /**
- * @generated
- */
- static private class TextCellEditorLocator implements CellEditorLocator {
-
- /**
- * @generated
- */
- private WrappingLabel wrapLabel;
-
- /**
- * @generated
- */
- public TextCellEditorLocator(WrappingLabel wrapLabel) {
- this.wrapLabel = wrapLabel;
- }
-
- /**
- * @generated
- */
- public WrappingLabel getWrapLabel() {
- return wrapLabel;
- }
-
- /**
- * @generated
- */
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- Rectangle rect = getWrapLabel().getTextBounds().getCopy();
- getWrapLabel().translateToAbsolute(rect);
- if(!text.getFont().isDisposed()) {
- if(getWrapLabel().isTextWrapOn() && getWrapLabel().getText().length() > 0) {
- rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
- } else {
- int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
- rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
- }
- }
- if(!rect.equals(new Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
- }
-
- /**
- * @generated
- */
- private static class LabelCellEditorLocator implements CellEditorLocator {
-
- /**
- * @generated
- */
- private Label label;
-
- /**
- * @generated
- */
- public LabelCellEditorLocator(Label label) {
- this.label = label;
- }
-
- /**
- * @generated
- */
- public Label getLabel() {
- return label;
- }
-
- /**
- * @generated
- */
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- Rectangle rect = getLabel().getTextBounds().getCopy();
- getLabel().translateToAbsolute(rect);
- if(!text.getFont().isDisposed()) {
- int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
- rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
- }
- if(!rect.equals(new Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/UsageEditPart.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/UsageEditPart.java
deleted file mode 100644
index fc05d13677c..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/parts/UsageEditPart.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.custom.figure.edges.UsageDecoration;
-import org.eclipse.papyrus.diagram.component.edit.policies.UsageItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class UsageEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4001;
-
- /**
- * @generated
- */
- public UsageEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new UsageItemSemanticEditPolicy());
- }
-
-
-
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new UsageDecoration();
- }
-
- /**
- * @generated
- */
- public UsageDecoration getPrimaryShape() {
- return (UsageDecoration)getFigure();
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/AbstractionItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/AbstractionItemSemanticEditPolicy.java
deleted file mode 100644
index 9db64abe9c6..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/AbstractionItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class AbstractionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public AbstractionItemSemanticEditPolicy() {
- super(UMLElementTypes.Abstraction_4013);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java
deleted file mode 100644
index 13c708ae31e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class CommentAnnotatedElementItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public CommentAnnotatedElementItemSemanticEditPolicy() {
- super(UMLElementTypes.CommentAnnotatedElement_4015);
- }
-
- /**
- * @generated
- */
- protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
- return getGEFWrapper(new DestroyReferenceCommand(req));
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/CommentItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/CommentItemSemanticEditPolicy.java
deleted file mode 100644
index c521934a90e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/CommentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class CommentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public CommentItemSemanticEditPolicy() {
- super(UMLElementTypes.Comment_3201);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/CommentItemSemanticEditPolicyPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/CommentItemSemanticEditPolicyPCN.java
deleted file mode 100644
index 24f3ef3df5f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/CommentItemSemanticEditPolicyPCN.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class CommentItemSemanticEditPolicyPCN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public CommentItemSemanticEditPolicyPCN() {
- super(UMLElementTypes.Comment_3074);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCanonicalEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCanonicalEditPolicy.java
deleted file mode 100644
index bef2894c39e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCanonicalEditPolicy.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.component.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ComponentCanonicalEditPolicy extends CanonicalEditPolicy {
-
-
- /**
- * @generated
- */
- protected EStructuralFeature getFeatureToSynchronize() {
- return UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute();
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getComponent_2002SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- return PortEditPart.VISUAL_ID == UMLVisualIDRegistry.getVisualID(view);
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getComponent_2002SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCanonicalEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCanonicalEditPolicyCN.java
deleted file mode 100644
index 1a315c72934..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCanonicalEditPolicyCN.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.component.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ComponentCanonicalEditPolicyCN extends CanonicalEditPolicy {
-
-
- /**
- * @generated
- */
- protected EStructuralFeature getFeatureToSynchronize() {
- return UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute();
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getComponent_3070SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- return PortEditPart.VISUAL_ID == UMLVisualIDRegistry.getVisualID(view);
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getComponent_3070SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCanonicalEditPolicyPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCanonicalEditPolicyPCN.java
deleted file mode 100644
index a05dd5f98e0..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCanonicalEditPolicyPCN.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.component.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ComponentCanonicalEditPolicyPCN extends CanonicalEditPolicy {
-
-
- /**
- * @generated
- */
- protected EStructuralFeature getFeatureToSynchronize() {
- return UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute();
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getComponent_3071SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- return PortEditPart.VISUAL_ID == UMLVisualIDRegistry.getVisualID(view);
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getComponent_3071SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentCanonicalEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentCanonicalEditPolicy.java
deleted file mode 100644
index d973b569ee2..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentCanonicalEditPolicy.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.component.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ComponentCompositeCompartmentCanonicalEditPolicy extends CanonicalEditPolicy {
-
-
- /**
- * @generated
- */
- protected EStructuralFeature getFeatureToSynchronize() {
- return UMLPackage.eINSTANCE.getClass_NestedClassifier();
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getComponentCompositeCompartment_7001SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- return ComponentEditPartCN.VISUAL_ID == UMLVisualIDRegistry.getVisualID(view);
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getComponentCompositeCompartment_7001SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentCanonicalEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentCanonicalEditPolicyCN.java
deleted file mode 100644
index 88d31f6d6c5..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentCanonicalEditPolicyCN.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.component.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ComponentCompositeCompartmentCanonicalEditPolicyCN extends CanonicalEditPolicy {
-
-
- /**
- * @generated
- */
- protected EStructuralFeature getFeatureToSynchronize() {
- return UMLPackage.eINSTANCE.getClass_NestedClassifier();
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getComponentCompositeCompartmentCN_7003SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- return ComponentEditPartCN.VISUAL_ID == UMLVisualIDRegistry.getVisualID(view);
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getComponentCompositeCompartmentCN_7003SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentCanonicalEditPolicyPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentCanonicalEditPolicyPCN.java
deleted file mode 100644
index 72c7c1613aa..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentCanonicalEditPolicyPCN.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.component.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ComponentCompositeCompartmentCanonicalEditPolicyPCN extends CanonicalEditPolicy {
-
-
- /**
- * @generated
- */
- protected EStructuralFeature getFeatureToSynchronize() {
- return UMLPackage.eINSTANCE.getClass_NestedClassifier();
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getComponentCompositeCompartmentPCN_7004SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- return ComponentEditPartCN.VISUAL_ID == UMLVisualIDRegistry.getVisualID(view);
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getComponentCompositeCompartmentPCN_7004SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentItemSemanticEditPolicy.java
deleted file mode 100644
index d6ee2b96e1b..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentCreateCommandCN;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class ComponentCompositeCompartmentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ComponentCompositeCompartmentItemSemanticEditPolicy() {
- super(UMLElementTypes.Component_2002);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Component_3070 == req.getElementType()) {
- return getGEFWrapper(new ComponentCreateCommandCN(req));
- }
- return super.getCreateCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentItemSemanticEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentItemSemanticEditPolicyCN.java
deleted file mode 100644
index df34a219ee9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentItemSemanticEditPolicyCN.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentCreateCommandCN;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class ComponentCompositeCompartmentItemSemanticEditPolicyCN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ComponentCompositeCompartmentItemSemanticEditPolicyCN() {
- super(UMLElementTypes.Component_3070);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Component_3070 == req.getElementType()) {
- return getGEFWrapper(new ComponentCreateCommandCN(req));
- }
- return super.getCreateCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentItemSemanticEditPolicyPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentItemSemanticEditPolicyPCN.java
deleted file mode 100644
index ea9dc0d6edf..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentCompositeCompartmentItemSemanticEditPolicyPCN.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentCreateCommandCN;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class ComponentCompositeCompartmentItemSemanticEditPolicyPCN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ComponentCompositeCompartmentItemSemanticEditPolicyPCN() {
- super(UMLElementTypes.Component_3071);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Component_3070 == req.getElementType()) {
- return getGEFWrapper(new ComponentCreateCommandCN(req));
- }
- return super.getCreateCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentDiagramItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentDiagramItemSemanticEditPolicy.java
deleted file mode 100644
index 515575b0001..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentDiagramItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.papyrus.diagram.common.commands.DuplicateNamedElementCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.PackageCreateCommand;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class ComponentDiagramItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ComponentDiagramItemSemanticEditPolicy() {
- super(UMLElementTypes.Model_1000);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Component_2002 == req.getElementType()) {
- return getGEFWrapper(new ComponentCreateCommand(req));
- }
- if(UMLElementTypes.Interface_2003 == req.getElementType()) {
- return getGEFWrapper(new InterfaceCreateCommand(req));
- }
- if(UMLElementTypes.Package_3200 == req.getElementType()) {
- return getGEFWrapper(new PackageCreateCommand(req));
- }
- if(UMLElementTypes.Comment_3201 == req.getElementType()) {
- return getGEFWrapper(new CommentCreateCommand(req));
- }
- if(UMLElementTypes.Constraint_3199 == req.getElementType()) {
- return getGEFWrapper(new ConstraintCreateCommand(req));
- }
- return super.getCreateCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getDuplicateCommand(DuplicateElementsRequest req) {
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- Diagram currentDiagram = null;
- if(getHost() instanceof IGraphicalEditPart) {
- currentDiagram = ((IGraphicalEditPart)getHost()).getNotationView().getDiagram();
- }
- return getGEFWrapper(new DuplicateAnythingCommand(editingDomain, req, currentDiagram));
- }
-
- /**
- * @generated
- */
- private static class DuplicateAnythingCommand extends DuplicateNamedElementCommand {
-
- /**
- * @generated
- */
- private Diagram diagram;
-
- /**
- * @generated
- */
- public DuplicateAnythingCommand(TransactionalEditingDomain editingDomain, DuplicateElementsRequest req, Diagram currentDiagram) {
- super(editingDomain, req.getLabel(), req.getElementsToBeDuplicated(), req.getAllDuplicatedElementsMap(), currentDiagram);
- this.diagram = currentDiagram;
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentItemSemanticEditPolicy.java
deleted file mode 100644
index 6873d96c6eb..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,211 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.GeneralizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.PortCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class ComponentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ComponentItemSemanticEditPolicy() {
- super(UMLElementTypes.Component_2002);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Port_3069 == req.getElementType()) {
- return getGEFWrapper(new PortCreateCommand(req));
- }
- return super.getCreateCommand(req);
- }
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentItemSemanticEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentItemSemanticEditPolicyCN.java
deleted file mode 100644
index e8a54f68ac4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentItemSemanticEditPolicyCN.java
+++ /dev/null
@@ -1,211 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.GeneralizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.PortCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class ComponentItemSemanticEditPolicyCN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ComponentItemSemanticEditPolicyCN() {
- super(UMLElementTypes.Component_3070);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Port_3069 == req.getElementType()) {
- return getGEFWrapper(new PortCreateCommand(req));
- }
- return super.getCreateCommand(req);
- }
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentItemSemanticEditPolicyPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentItemSemanticEditPolicyPCN.java
deleted file mode 100644
index 2fb48a22115..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentItemSemanticEditPolicyPCN.java
+++ /dev/null
@@ -1,211 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.GeneralizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.PortCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class ComponentItemSemanticEditPolicyPCN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ComponentItemSemanticEditPolicyPCN() {
- super(UMLElementTypes.Component_3071);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Port_3069 == req.getElementType()) {
- return getGEFWrapper(new PortCreateCommand(req));
- }
- return super.getCreateCommand(req);
- }
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentRealizationItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentRealizationItemSemanticEditPolicy.java
deleted file mode 100644
index 97621389256..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ComponentRealizationItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class ComponentRealizationItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ComponentRealizationItemSemanticEditPolicy() {
- super(UMLElementTypes.ComponentRealization_4007);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ConstraintConstrainedElementItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ConstraintConstrainedElementItemSemanticEditPolicy.java
deleted file mode 100644
index 7713bf314b4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ConstraintConstrainedElementItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class ConstraintConstrainedElementItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ConstraintConstrainedElementItemSemanticEditPolicy() {
- super(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
-
- /**
- * @generated
- */
- protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
- return getGEFWrapper(new DestroyReferenceCommand(req));
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ConstraintItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ConstraintItemSemanticEditPolicy.java
deleted file mode 100644
index 87950452c77..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ConstraintItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class ConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ConstraintItemSemanticEditPolicy() {
- super(UMLElementTypes.Constraint_3199);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ConstraintItemSemanticEditPolicyPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ConstraintItemSemanticEditPolicyPCN.java
deleted file mode 100644
index 4deb98642ce..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ConstraintItemSemanticEditPolicyPCN.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class ConstraintItemSemanticEditPolicyPCN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ConstraintItemSemanticEditPolicyPCN() {
- super(UMLElementTypes.Constraint_3075);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/DependencyItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/DependencyItemSemanticEditPolicy.java
deleted file mode 100644
index f3952b93040..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/DependencyItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,192 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.DeleteCommand;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.common.command.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class DependencyItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public DependencyItemSemanticEditPolicy() {
- super(UMLElementTypes.Dependency_4010);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new DeleteCommand(getEditingDomain(), todestroy)));
- return getGEFWrapper(cmd.reduce());
- //return getGEFWrapper(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/GeneralizationItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/GeneralizationItemSemanticEditPolicy.java
deleted file mode 100644
index 2b560bed344..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/GeneralizationItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class GeneralizationItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public GeneralizationItemSemanticEditPolicy() {
- super(UMLElementTypes.Generalization_4003);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/InterfaceItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/InterfaceItemSemanticEditPolicy.java
deleted file mode 100644
index 91ad1160eb4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/InterfaceItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,199 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.GeneralizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class InterfaceItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public InterfaceItemSemanticEditPolicy() {
- super(UMLElementTypes.Interface_2003);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/InterfaceItemSemanticEditPolicyPCN.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/InterfaceItemSemanticEditPolicyPCN.java
deleted file mode 100644
index 1511219ac9d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/InterfaceItemSemanticEditPolicyPCN.java
+++ /dev/null
@@ -1,199 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.GeneralizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class InterfaceItemSemanticEditPolicyPCN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public InterfaceItemSemanticEditPolicyPCN() {
- super(UMLElementTypes.Interface_3072);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/InterfaceRealizationItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/InterfaceRealizationItemSemanticEditPolicy.java
deleted file mode 100644
index 9362789c47f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/InterfaceRealizationItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class InterfaceRealizationItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public InterfaceRealizationItemSemanticEditPolicy() {
- super(UMLElementTypes.InterfaceRealization_4006);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ManifestationItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ManifestationItemSemanticEditPolicy.java
deleted file mode 100644
index 9e130598d90..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ManifestationItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class ManifestationItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ManifestationItemSemanticEditPolicy() {
- super(UMLElementTypes.Manifestation_4014);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ModelCanonicalEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ModelCanonicalEditPolicy.java
deleted file mode 100644
index dac0cf2b2f4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/ModelCanonicalEditPolicy.java
+++ /dev/null
@@ -1,504 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.LinkDescriptorEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PackageEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.component.part.UMLLinkDescriptor;
-import org.eclipse.papyrus.diagram.component.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ModelCanonicalEditPolicy extends CanonicalEditPolicy {
-
-
-
- /**
- * @generated
- */
- private Set<EStructuralFeature> myFeaturesToSynchronize;
-
-
- /**
- * @generated
- */
- protected Set getFeaturesToSynchronize() {
- if(myFeaturesToSynchronize == null) {
- myFeaturesToSynchronize = new HashSet<EStructuralFeature>();
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getPackage_PackagedElement());
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getElement_OwnedComment());
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getNamespace_OwnedRule());
- }
- return myFeaturesToSynchronize;
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getModel_1000SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- int visualID = UMLVisualIDRegistry.getVisualID(view);
- switch(visualID) {
- case ComponentEditPart.VISUAL_ID:
- case InterfaceEditPart.VISUAL_ID:
- case PackageEditPart.VISUAL_ID:
- case CommentEditPart.VISUAL_ID:
- case ConstraintEditPart.VISUAL_ID:
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getModel_1000SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
-
- Collection<IAdaptable> createdConnectionViews = refreshConnections();
-
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- createdViews.addAll(createdConnectionViews);
-
- makeViewsImmutable(createdViews);
- }
-
- /**
- * @generated
- */
- private Collection<IAdaptable> refreshConnections() {
- Map<EObject, View> domain2NotationMap = new HashMap<EObject, View>();
- Collection<UMLLinkDescriptor> linkDescriptors = collectAllLinks(getDiagram(), domain2NotationMap);
- Collection existingLinks = new LinkedList(getDiagram().getEdges());
- for(Iterator linksIterator = existingLinks.iterator(); linksIterator.hasNext();) {
- Edge nextDiagramLink = (Edge)linksIterator.next();
- int diagramLinkVisualID = UMLVisualIDRegistry.getVisualID(nextDiagramLink);
- if(diagramLinkVisualID == -1 || diagramLinkVisualID == LinkDescriptorEditPart.VISUAL_ID) {
- if(nextDiagramLink.getSource() != null && nextDiagramLink.getTarget() != null) {
- linksIterator.remove();
- }
- continue;
- }
- EObject diagramLinkObject = nextDiagramLink.getElement();
- EObject diagramLinkSrc = nextDiagramLink.getSource().getElement();
- EObject diagramLinkDst = nextDiagramLink.getTarget().getElement();
- for(Iterator<UMLLinkDescriptor> linkDescriptorsIterator = linkDescriptors.iterator(); linkDescriptorsIterator.hasNext();) {
- UMLLinkDescriptor nextLinkDescriptor = linkDescriptorsIterator.next();
- if(diagramLinkObject == nextLinkDescriptor.getModelElement() && diagramLinkSrc == nextLinkDescriptor.getSource() && diagramLinkDst == nextLinkDescriptor.getDestination() && diagramLinkVisualID == nextLinkDescriptor.getVisualID()) {
- linksIterator.remove();
- linkDescriptorsIterator.remove();
- break;
- }
- }
- }
- deleteViews(existingLinks.iterator());
- return createConnections(linkDescriptors, domain2NotationMap);
- }
-
- /**
- * @generated
- */
- private Collection<UMLLinkDescriptor> collectAllLinks(View view, Map<EObject, View> domain2NotationMap) {
- if(!ComponentDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view))) {
- return Collections.emptyList();
- }
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- switch(UMLVisualIDRegistry.getVisualID(view)) {
- case ComponentDiagramEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getModel_1000ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ComponentEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getComponent_2002ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case InterfaceEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getInterface_2003ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case PackageEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getPackage_3200ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case CommentEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getComment_3201ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ConstraintEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getConstraint_3199ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case PortEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getPort_3069ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ComponentEditPartCN.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getComponent_3070ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ComponentEditPartPCN.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getComponent_3071ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case InterfaceEditPartPCN.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getInterface_3072ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case CommentEditPartPCN.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getComment_3074ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ConstraintEditPartPCN.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getConstraint_3075ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case UsageEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getUsage_4001ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case InterfaceRealizationEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getInterfaceRealization_4006ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case GeneralizationEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getGeneralization_4003ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case SubstitutionEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getSubstitution_4012ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ManifestationEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getManifestation_4014ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ComponentRealizationEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getComponentRealization_4007ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case AbstractionEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getAbstraction_4013ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case DependencyEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getDependency_4010ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- }
- for(Iterator children = view.getChildren().iterator(); children.hasNext();) {
- result.addAll(collectAllLinks((View)children.next(), domain2NotationMap));
- }
- for(Iterator edges = view.getSourceEdges().iterator(); edges.hasNext();) {
- result.addAll(collectAllLinks((View)edges.next(), domain2NotationMap));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private Collection<IAdaptable> createConnections(Collection<UMLLinkDescriptor> linkDescriptors, Map<EObject, View> domain2NotationMap) {
- LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
- for(UMLLinkDescriptor nextLinkDescriptor : linkDescriptors) {
- EditPart sourceEditPart = getEditPart(nextLinkDescriptor.getSource(), domain2NotationMap);
- EditPart targetEditPart = getEditPart(nextLinkDescriptor.getDestination(), domain2NotationMap);
- if(sourceEditPart == null || targetEditPart == null) {
- continue;
- }
- CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(nextLinkDescriptor.getSemanticAdapter(), UMLVisualIDRegistry.getType(nextLinkDescriptor.getVisualID()), ViewUtil.APPEND, false, ((IGraphicalEditPart)getHost()).getDiagramPreferencesHint());
- CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(descriptor);
- ccr.setType(RequestConstants.REQ_CONNECTION_START);
- ccr.setSourceEditPart(sourceEditPart);
- sourceEditPart.getCommand(ccr);
- ccr.setTargetEditPart(targetEditPart);
- ccr.setType(RequestConstants.REQ_CONNECTION_END);
- Command cmd = targetEditPart.getCommand(ccr);
- if(cmd != null && cmd.canExecute()) {
- executeCommand(cmd);
- IAdaptable viewAdapter = (IAdaptable)ccr.getNewObject();
- if(viewAdapter != null) {
- adapters.add(viewAdapter);
- }
- }
- }
- return adapters;
- }
-
- /**
- * @generated
- */
- private EditPart getEditPart(EObject domainModelElement, Map<EObject, View> domain2NotationMap) {
- View view = (View)domain2NotationMap.get(domainModelElement);
- if(view != null) {
- return (EditPart)getHost().getViewer().getEditPartRegistry().get(view);
- }
- return null;
- }
-
- /**
- * @generated
- */
- private Diagram getDiagram() {
- return ((View)getHost().getModel()).getDiagram();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PackageItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PackageItemSemanticEditPolicy.java
deleted file mode 100644
index af6cae41ce0..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PackageItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class PackageItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public PackageItemSemanticEditPolicy() {
- super(UMLElementTypes.Package_3200);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PackagePackageableElementCompartmentCanonicalEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PackagePackageableElementCompartmentCanonicalEditPolicy.java
deleted file mode 100644
index 0e2f57aedb3..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PackagePackageableElementCompartmentCanonicalEditPolicy.java
+++ /dev/null
@@ -1,170 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.component.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class PackagePackageableElementCompartmentCanonicalEditPolicy extends CanonicalEditPolicy {
-
- /**
- * @generated
- */
- private Set<EStructuralFeature> myFeaturesToSynchronize;
-
-
- /**
- * @generated
- */
- protected Set getFeaturesToSynchronize() {
- if(myFeaturesToSynchronize == null) {
- myFeaturesToSynchronize = new HashSet<EStructuralFeature>();
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getPackage_PackagedElement());
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getElement_OwnedComment());
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getNamespace_OwnedRule());
- }
- return myFeaturesToSynchronize;
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getPackagePackageableElementCompartment_7002SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- int visualID = UMLVisualIDRegistry.getVisualID(view);
- switch(visualID) {
- case InterfaceEditPartPCN.VISUAL_ID:
- case CommentEditPartPCN.VISUAL_ID:
- case ConstraintEditPartPCN.VISUAL_ID:
- case ComponentEditPartPCN.VISUAL_ID:
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getPackagePackageableElementCompartment_7002SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PackagePackageableElementCompartmentItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PackagePackageableElementCompartmentItemSemanticEditPolicy.java
deleted file mode 100644
index b0a0952f2ab..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PackagePackageableElementCompartmentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentCreateCommandPCN;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentCreateCommandPCN;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintCreateCommandPCN;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceCreateCommandPCN;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class PackagePackageableElementCompartmentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public PackagePackageableElementCompartmentItemSemanticEditPolicy() {
- super(UMLElementTypes.Package_3200);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Interface_3072 == req.getElementType()) {
- return getGEFWrapper(new InterfaceCreateCommandPCN(req));
- }
- if(UMLElementTypes.Comment_3074 == req.getElementType()) {
- return getGEFWrapper(new CommentCreateCommandPCN(req));
- }
- if(UMLElementTypes.Constraint_3075 == req.getElementType()) {
- return getGEFWrapper(new ConstraintCreateCommandPCN(req));
- }
- if(UMLElementTypes.Component_3071 == req.getElementType()) {
- return getGEFWrapper(new ComponentCreateCommandPCN(req));
- }
- return super.getCreateCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PortItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PortItemSemanticEditPolicy.java
deleted file mode 100644
index 2e315a424a0..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/PortItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class PortItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public PortItemSemanticEditPolicy() {
- super(UMLElementTypes.Port_3069);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/SubstitutionItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/SubstitutionItemSemanticEditPolicy.java
deleted file mode 100644
index 517f020facc..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/SubstitutionItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,192 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.DeleteCommand;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.common.command.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class SubstitutionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public SubstitutionItemSemanticEditPolicy() {
- super(UMLElementTypes.Substitution_4012);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new DeleteCommand(getEditingDomain(), todestroy)));
- return getGEFWrapper(cmd.reduce());
- //return getGEFWrapper(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UMLBaseItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UMLBaseItemSemanticEditPolicy.java
deleted file mode 100644
index c1c86c61d7a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UMLBaseItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,564 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.MoveElementsCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-import org.eclipse.papyrus.diagram.component.expressions.UMLOCLFactory;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.uml2.uml.Abstraction;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.ComponentRealization;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Generalization;
-import org.eclipse.uml2.uml.InterfaceRealization;
-import org.eclipse.uml2.uml.Manifestation;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Substitution;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.Usage;
-
-/**
- * @generated
- */
-public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
-
- /**
- * Extended request data key to hold editpart visual id.
- * @generated
- */
- public static final String VISUAL_ID_KEY = "visual_id"; //$NON-NLS-1$
-
- /**
- * Extended request data key to hold the edge view during a reconnect request.
- * @generated
- */
- public static final String GRAPHICAL_RECONNECTED_EDGE = "graphical_edge"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final IElementType myElementType;
-
- /**
- * @generated
- */
- protected UMLBaseItemSemanticEditPolicy(IElementType elementType) {
- myElementType = elementType;
- }
-
- /**
- * Extended request data key to hold editpart visual id.
- * Add visual id of edited editpart to extended data of the request
- * so command switch can decide what kind of diagram element is being edited.
- * It is done in those cases when it's not possible to deduce diagram
- * element kind from domain element.
- * Add the reoriented view to the request extended data so that the view
- * currently edited can be distinguished from other views of the same element
- * and these latter possibly removed if they become inconsistent after reconnect
- *
- * @generated
- */
- @SuppressWarnings("unchecked")
- public Command getCommand(Request request) {
- if(request instanceof ReconnectRequest) {
- Object view = ((ReconnectRequest)request).getConnectionEditPart().getModel();
- if(view instanceof View) {
- Integer id = new Integer(UMLVisualIDRegistry.getVisualID((View)view));
- request.getExtendedData().put(VISUAL_ID_KEY, id);
- request.getExtendedData().put(GRAPHICAL_RECONNECTED_EDGE, (View)view);
- }
- }
- return super.getCommand(request);
- }
-
- /**
- * Returns visual id from request parameters.
- * @generated
- */
- protected int getVisualID(IEditCommandRequest request) {
- Object id = request.getParameter(VISUAL_ID_KEY);
- return id instanceof Integer ? ((Integer)id).intValue() : -1;
- }
-
- /**
- * @generated
- */
- protected Command getSemanticCommand(IEditCommandRequest request) {
- IEditCommandRequest completedRequest = completeRequest(request);
- Command semanticCommand = getSemanticCommandSwitch(completedRequest);
- semanticCommand = getEditHelperCommand(completedRequest, semanticCommand);
- if(completedRequest instanceof DestroyRequest) {
- DestroyRequest destroyRequest = (DestroyRequest)completedRequest;
- return shouldProceed(destroyRequest) ? addDeleteViewCommand(semanticCommand, destroyRequest) : null;
- }
- return semanticCommand;
- }
-
- /**
- * @generated
- */
- protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View)getHost().getModel()));
- return mainCommand == null ? deleteViewCommand : mainCommand.chain(deleteViewCommand);
- }
-
- /**
- * @generated
- */
- private Command getEditHelperCommand(IEditCommandRequest request, Command editPolicyCommand) {
- if(editPolicyCommand != null) {
- ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy)editPolicyCommand).getICommand() : new CommandProxy(editPolicyCommand);
- request.setParameter(UMLBaseEditHelper.EDIT_POLICY_COMMAND, command);
- }
- IElementType requestContextElementType = getContextElementType(request);
- request.setParameter(UMLBaseEditHelper.CONTEXT_ELEMENT_TYPE, requestContextElementType);
- ICommand command = requestContextElementType.getEditCommand(request);
- request.setParameter(UMLBaseEditHelper.EDIT_POLICY_COMMAND, null);
- request.setParameter(UMLBaseEditHelper.CONTEXT_ELEMENT_TYPE, null);
- if(command != null) {
- if(!(command instanceof CompositeTransactionalCommand)) {
- command = new CompositeTransactionalCommand(getEditingDomain(), command.getLabel()).compose(command);
- }
- return new ICommandProxy(command);
- }
- return editPolicyCommand;
- }
-
- /**
- * @generated
- */
- protected IElementType getContextElementType(IEditCommandRequest request) {
- IElementType requestContextElementType = UMLElementTypes.getElementType(getVisualID(request));
- return requestContextElementType != null ? requestContextElementType : myElementType;
- }
-
- /**
- * @generated
- */
- protected Command getSemanticCommandSwitch(IEditCommandRequest req) {
- if(req instanceof CreateRelationshipRequest) {
- return getCreateRelationshipCommand((CreateRelationshipRequest)req);
- } else if(req instanceof CreateElementRequest) {
- return getCreateCommand((CreateElementRequest)req);
- } else if(req instanceof ConfigureRequest) {
- return getConfigureCommand((ConfigureRequest)req);
- } else if(req instanceof DestroyElementRequest) {
- return getDestroyElementCommand((DestroyElementRequest)req);
- } else if(req instanceof DestroyReferenceRequest) {
- return getDestroyReferenceCommand((DestroyReferenceRequest)req);
- } else if(req instanceof DuplicateElementsRequest) {
- return getDuplicateCommand((DuplicateElementsRequest)req);
- } else if(req instanceof GetEditContextRequest) {
- return getEditContextCommand((GetEditContextRequest)req);
- } else if(req instanceof MoveRequest) {
- return getMoveCommand((MoveRequest)req);
- } else if(req instanceof ReorientReferenceRelationshipRequest) {
- return getReorientReferenceRelationshipCommand((ReorientReferenceRelationshipRequest)req);
- } else if(req instanceof ReorientRelationshipRequest) {
- return getReorientRelationshipCommand((ReorientRelationshipRequest)req);
- } else if(req instanceof SetRequest) {
- return getSetCommand((SetRequest)req);
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getConfigureCommand(ConfigureRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getSetCommand(SetRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getEditContextCommand(GetEditContextRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getDuplicateCommand(DuplicateElementsRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getMoveCommand(MoveRequest req) {
-
-
- return getGEFWrapper(new MoveElementsCommand(req));
-
-
- }
-
- /**
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected final Command getGEFWrapper(ICommand cmd) {
- return new ICommandProxy(cmd);
- }
-
- /**
- * Returns editing domain from the host edit part.
- * @generated
- */
- protected TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
- }
-
- /**
- * Clean all shortcuts to the host element from the same diagram
- * @generated
- */
- protected void addDestroyShortcutsCommand(ICompositeCommand cmd, View view) {
- assert view.getEAnnotation("Shortcut") == null; //$NON-NLS-1$
- for(Iterator it = view.getDiagram().getChildren().iterator(); it.hasNext();) {
- View nextView = (View)it.next();
- if(nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { //$NON-NLS-1$
- continue;
- }
- cmd.add(new DeleteCommand(getEditingDomain(), nextView));
- }
- }
-
-
- /**
- * @generated
- */
- public static LinkConstraints getLinkConstraints() {
- LinkConstraints cached = UMLDiagramEditorPlugin.getInstance().getLinkConstraints();
- if(cached == null) {
- UMLDiagramEditorPlugin.getInstance().setLinkConstraints(cached = new LinkConstraints());
- }
- return cached;
- }
-
-
- /**
- * @generated
- */
- public static class LinkConstraints {
-
- /**
- * @generated
- */
- public LinkConstraints() {
- // use static method #getLinkConstraints() to access instance
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateUsage_4001(Package container, NamedElement source, NamedElement target) {
- return canExistUsage_4001(container, null, source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateInterfaceRealization_4006(Package container, NamedElement source, NamedElement target) {
- return canExistInterfaceRealization_4006(container, null, source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateGeneralization_4003(Classifier container, Classifier source, Classifier target) {
- return canExistGeneralization_4003(container, null, source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateSubstitution_4012(Package container, NamedElement source, NamedElement target) {
- return canExistSubstitution_4012(container, null, source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateManifestation_4014(Package container, NamedElement source, NamedElement target) {
- return canExistManifestation_4014(container, null, source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateComponentRealization_4007(Package container, NamedElement source, NamedElement target) {
- return canExistComponentRealization_4007(container, null, source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateAbstraction_4013(Package container, NamedElement source, NamedElement target) {
- return canExistAbstraction_4013(container, null, source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateLink_4016() {
- return canExistLink_4016();
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateCommentAnnotatedElement_4015(Comment source, Element target) {
- if(source != null) {
- if(source.getAnnotatedElements().contains(target)) {
- return false;
- }
- }
-
- return canExistCommentAnnotatedElement_4015(source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateConstraintConstrainedElement_4009(Constraint source, Element target) {
- if(source != null) {
- if(source.getConstrainedElements().contains(target)) {
- return false;
- }
- }
-
- return canExistConstraintConstrainedElement_4009(source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateDependency_4010(Package container, NamedElement source, NamedElement target) {
- return canExistDependency_4010(container, null, source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canExistUsage_4001(Package container, Usage linkInstance, NamedElement source, NamedElement target) {
- try {
- if(source == null) {
- return true;
- } else {
- Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getNamedElement()); //$NON-NLS-1$
- Object sourceVal = UMLOCLFactory.getExpression(7, UMLPackage.eINSTANCE.getNamedElement(), env).evaluate(source, Collections.singletonMap("oppositeEnd", target)); //$NON-NLS-1$
- if(false == sourceVal instanceof Boolean || !((Boolean)sourceVal).booleanValue()) {
- return false;
- } // else fall-through
- }
- if(target == null) {
- return true;
- } else {
- Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getNamedElement()); //$NON-NLS-1$
- Object targetVal = UMLOCLFactory.getExpression(6, UMLPackage.eINSTANCE.getNamedElement(), env).evaluate(target, Collections.singletonMap("oppositeEnd", source)); //$NON-NLS-1$
- if(false == targetVal instanceof Boolean || !((Boolean)targetVal).booleanValue()) {
- return false;
- } // else fall-through
- }
- return true;
- } catch (Exception e) {
- UMLDiagramEditorPlugin.getInstance().logError("Link constraint evaluation error", e); //$NON-NLS-1$
- return false;
- }
- }
-
- /**
- * @generated
- */
- public boolean canExistInterfaceRealization_4006(Package container, InterfaceRealization linkInstance, NamedElement source, NamedElement target) {
- try {
- if(source == null) {
- return true;
- } else {
- Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getNamedElement()); //$NON-NLS-1$
- Object sourceVal = UMLOCLFactory.getExpression(7, UMLPackage.eINSTANCE.getNamedElement(), env).evaluate(source, Collections.singletonMap("oppositeEnd", target)); //$NON-NLS-1$
- if(false == sourceVal instanceof Boolean || !((Boolean)sourceVal).booleanValue()) {
- return false;
- } // else fall-through
- }
- if(target == null) {
- return true;
- } else {
- Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getNamedElement()); //$NON-NLS-1$
- Object targetVal = UMLOCLFactory.getExpression(6, UMLPackage.eINSTANCE.getNamedElement(), env).evaluate(target, Collections.singletonMap("oppositeEnd", source)); //$NON-NLS-1$
- if(false == targetVal instanceof Boolean || !((Boolean)targetVal).booleanValue()) {
- return false;
- } // else fall-through
- }
- return true;
- } catch (Exception e) {
- UMLDiagramEditorPlugin.getInstance().logError("Link constraint evaluation error", e); //$NON-NLS-1$
- return false;
- }
- }
-
- /**
- * @generated
- */
- public boolean canExistGeneralization_4003(Classifier container, Generalization linkInstance, Classifier source, Classifier target) {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistSubstitution_4012(Package container, Substitution linkInstance, NamedElement source, NamedElement target) {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistManifestation_4014(Package container, Manifestation linkInstance, NamedElement source, NamedElement target) {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistComponentRealization_4007(Package container, ComponentRealization linkInstance, NamedElement source, NamedElement target) {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistAbstraction_4013(Package container, Abstraction linkInstance, NamedElement source, NamedElement target) {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistLink_4016() {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistCommentAnnotatedElement_4015(Comment source, Element target) {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistConstraintConstrainedElement_4009(Constraint source, Element target) {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistDependency_4010(Package container, Dependency linkInstance, NamedElement source, NamedElement target) {
- return true;
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UMLTextNonResizableEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UMLTextNonResizableEditPolicy.java
deleted file mode 100644
index 176877e769e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UMLTextNonResizableEditPolicy.java
+++ /dev/null
@@ -1,224 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-
-/**
- * @generated
- */
-public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx {
-
-
- /**
- * @generated
- */
- private IFigure selectionFeedbackFigure;
-
- /**
- * @generated
- */
- private IFigure focusFeedbackFigure;
-
- /**
- * @generated
- */
- private FigureListener hostPositionListener;
-
- /**
- * @generated
- */
- protected void showPrimarySelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- showSelection();
- showFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- hideSelection();
- addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
- getHostFigure().addFigureListener(getHostPositionListener());
- refreshSelectionFeedback();
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void hideSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(false);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(selectionFeedbackFigure != null) {
- removeFeedback(selectionFeedbackFigure);
- getHostFigure().removeFigureListener(getHostPositionListener());
- selectionFeedbackFigure = null;
- }
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- hideFocus();
- addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
- refreshFocusFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void hideFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(focusFeedbackFigure != null) {
- removeFeedback(focusFeedbackFigure);
- focusFeedbackFigure = null;
- }
- }
- }
-
- /**
- * @generated
- */
- protected Rectangle getFeedbackBounds() {
- Rectangle bounds;
- if(getHostFigure() instanceof Label) {
- bounds = ((Label)getHostFigure()).getTextBounds();
- bounds.intersect(getHostFigure().getBounds());
- } else {
- bounds = getHostFigure().getBounds().getCopy();
- }
- getHostFigure().getParent().translateToAbsolute(bounds);
- getFeedbackLayer().translateToRelative(bounds);
- return bounds;
- }
-
- /**
- * @generated
- */
- protected IFigure createSelectionFeedbackFigure() {
- if(getHostFigure() instanceof Label) {
- Label feedbackFigure = new Label();
- feedbackFigure.setOpaque(true);
- feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
- feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
- return feedbackFigure;
- } else {
- RectangleFigure feedbackFigure = new RectangleFigure();
- feedbackFigure.setFill(false);
- return feedbackFigure;
- }
- }
-
- /**
- * @generated
- */
- protected IFigure createFocusFeedbackFigure() {
- return new Figure() {
-
- protected void paintFigure(Graphics graphics) {
- graphics.drawFocus(getBounds().getResized(-1, -1));
- }
- };
- }
-
- /**
- * @generated
- */
- protected void updateLabel(Label target) {
- Label source = (Label)getHostFigure();
- target.setText(source.getText());
- target.setTextAlignment(source.getTextAlignment());
- target.setFont(source.getFont());
- }
-
- /**
- * @generated
- */
- protected void refreshSelectionFeedback() {
- if(selectionFeedbackFigure != null) {
- if(selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)selectionFeedbackFigure);
- selectionFeedbackFigure.setBounds(getFeedbackBounds());
- } else {
- selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFocusFeedback() {
- if(focusFeedbackFigure != null) {
- focusFeedbackFigure.setBounds(getFeedbackBounds());
- }
- }
-
- /**
- * @generated
- */
- public void refreshFeedback() {
- refreshSelectionFeedback();
- refreshFocusFeedback();
- }
-
- /**
- * @generated
- */
- private FigureListener getHostPositionListener() {
- if(hostPositionListener == null) {
- hostPositionListener = new FigureListener() {
-
- public void figureMoved(IFigure source) {
- refreshFeedback();
- }
- };
- }
- return hostPositionListener;
- }
-
- /**
- * @generated
- */
- protected List createSelectionHandles() {
- MoveHandle moveHandle = new MoveHandle((GraphicalEditPart)getHost());
- moveHandle.setBorder(null);
- moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
- return Collections.singletonList(moveHandle);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UMLTextSelectionEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UMLTextSelectionEditPolicy.java
deleted file mode 100644
index acb730a4d53..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UMLTextSelectionEditPolicy.java
+++ /dev/null
@@ -1,208 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.editpolicies.SelectionEditPolicy;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-
-/**
- * @generated
- */
-public class UMLTextSelectionEditPolicy extends SelectionEditPolicy {
-
-
- /**
- * @generated
- */
- private IFigure selectionFeedbackFigure;
-
- /**
- * @generated
- */
- private IFigure focusFeedbackFigure;
-
- /**
- * @generated
- */
- private FigureListener hostPositionListener;
-
- /**
- * @generated
- */
- protected void showPrimarySelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- showSelection();
- showFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- hideSelection();
- addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
- getHostFigure().addFigureListener(getHostPositionListener());
- refreshSelectionFeedback();
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void hideSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(false);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(selectionFeedbackFigure != null) {
- removeFeedback(selectionFeedbackFigure);
- getHostFigure().removeFigureListener(getHostPositionListener());
- selectionFeedbackFigure = null;
- }
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- hideFocus();
- addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
- refreshFocusFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void hideFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(focusFeedbackFigure != null) {
- removeFeedback(focusFeedbackFigure);
- focusFeedbackFigure = null;
- }
- }
- }
-
- /**
- * @generated
- */
- protected Rectangle getFeedbackBounds() {
- Rectangle bounds;
- if(getHostFigure() instanceof Label) {
- bounds = ((Label)getHostFigure()).getTextBounds();
- bounds.intersect(getHostFigure().getBounds());
- } else {
- bounds = getHostFigure().getBounds().getCopy();
- }
- getHostFigure().getParent().translateToAbsolute(bounds);
- getFeedbackLayer().translateToRelative(bounds);
- return bounds;
- }
-
- /**
- * @generated
- */
- protected IFigure createSelectionFeedbackFigure() {
- if(getHostFigure() instanceof Label) {
- Label feedbackFigure = new Label();
- feedbackFigure.setOpaque(true);
- feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
- feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
- return feedbackFigure;
- } else {
- RectangleFigure feedbackFigure = new RectangleFigure();
- feedbackFigure.setFill(false);
- return feedbackFigure;
- }
- }
-
- /**
- * @generated
- */
- protected IFigure createFocusFeedbackFigure() {
- return new Figure() {
-
- protected void paintFigure(Graphics graphics) {
- graphics.drawFocus(getBounds().getResized(-1, -1));
- }
- };
- }
-
- /**
- * @generated
- */
- protected void updateLabel(Label target) {
- Label source = (Label)getHostFigure();
- target.setText(source.getText());
- target.setTextAlignment(source.getTextAlignment());
- target.setFont(source.getFont());
- }
-
- /**
- * @generated
- */
- protected void refreshSelectionFeedback() {
- if(selectionFeedbackFigure != null) {
- if(selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)selectionFeedbackFigure);
- selectionFeedbackFigure.setBounds(getFeedbackBounds());
- } else {
- selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFocusFeedback() {
- if(focusFeedbackFigure != null) {
- focusFeedbackFigure.setBounds(getFeedbackBounds());
- }
- }
-
- /**
- * @generated
- */
- public void refreshFeedback() {
- refreshSelectionFeedback();
- refreshFocusFeedback();
- }
-
- /**
- * @generated
- */
- private FigureListener getHostPositionListener() {
- if(hostPositionListener == null) {
- hostPositionListener = new FigureListener() {
-
- public void figureMoved(IFigure source) {
- refreshFeedback();
- }
- };
- }
- return hostPositionListener;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UsageItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UsageItemSemanticEditPolicy.java
deleted file mode 100644
index 12417b60f46..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/edit/policies/UsageItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.eclipse.papyrus.diagram.component.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.component.edit.commands.AbstractionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ComponentRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.InterfaceRealizationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.SubstitutionCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.commands.UsageCreateCommand;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class UsageItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public UsageItemSemanticEditPolicy() {
- super(UMLElementTypes.Usage_4001);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Usage_4001 == req.getElementType()) {
- return getGEFWrapper(new UsageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.InterfaceRealization_4006 == req.getElementType()) {
- return getGEFWrapper(new InterfaceRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Substitution_4012 == req.getElementType()) {
- return getGEFWrapper(new SubstitutionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4014 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ComponentRealization_4007 == req.getElementType()) {
- return getGEFWrapper(new ComponentRealizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Abstraction_4013 == req.getElementType()) {
- return getGEFWrapper(new AbstractionCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.CommentAnnotatedElement_4015 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4010 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case UsageEditPart.VISUAL_ID:
- case InterfaceRealizationEditPart.VISUAL_ID:
- case SubstitutionEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case ComponentRealizationEditPart.VISUAL_ID:
- case AbstractionEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/expressions/UMLAbstractExpression.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/expressions/UMLAbstractExpression.java
deleted file mode 100644
index c3a70febdf1..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/expressions/UMLAbstractExpression.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package org.eclipse.papyrus.diagram.component.expressions;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Collections;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public abstract class UMLAbstractExpression {
-
- /**
- * @generated
- */
- private IStatus status = Status.OK_STATUS;
-
- /**
- * @generated
- */
- protected void setStatus(int severity, String message, Throwable throwable) {
- String pluginID = UMLDiagramEditorPlugin.ID;
- this.status = new Status(severity, pluginID, -1, (message != null) ? message : "", throwable); //$NON-NLS-1$
- if(!this.status.isOK()) {
- UMLDiagramEditorPlugin.getInstance().logError("Expression problem:" + message + "body:" + body(), throwable); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * @generated
- */
- public IStatus getStatus() {
- return status;
- }
-
- /**
- * @generated
- */
- private final String myBody;
-
- /**
- * @generated
- */
- public String body() {
- return myBody;
- }
-
- /**
- * @generated
- */
- private final EClassifier myContext;
-
- /**
- * @generated
- */
- public EClassifier context() {
- return myContext;
- }
-
-
- /**
- * @generated
- */
- protected UMLAbstractExpression(String body, EClassifier context) {
- myBody = body;
- myContext = context;
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected abstract Object doEvaluate(Object context, Map env);
-
- /**
- * @generated
- */
- public Object evaluate(Object context) {
- return evaluate(context, Collections.EMPTY_MAP);
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- public Object evaluate(Object context, Map env) {
- if(context().isInstance(context)) {
- try {
- return doEvaluate(context, env);
- } catch (Exception e) {
- UMLDiagramEditorPlugin.getInstance().logError("Expression evaluation failure: " + body(), e); //$NON-NLS-1$
- }
- }
- return null;
- }
-
- /**
- * Expression may return number value which is not directly compatible with feature type (e.g. Double when Integer is expected), or EEnumLiteral meta-object when literal instance is expected
- * @generated
- */
- public static Object performCast(Object value, EDataType targetType) {
- if(targetType instanceof EEnum) {
- if(value instanceof EEnumLiteral) {
- EEnumLiteral literal = (EEnumLiteral)value;
- return (literal.getInstance() != null) ? literal.getInstance() : literal;
- }
- }
- if(false == value instanceof Number || targetType == null || targetType.getInstanceClass() == null) {
- return value;
- }
- Class<?> targetClass = targetType.getInstanceClass();
- Number num = (Number)value;
- Class<?> valClass = value.getClass();
- Class<?> targetWrapperClass = targetClass;
- if(targetClass.isPrimitive()) {
- targetWrapperClass = EcoreUtil.wrapperClassFor(targetClass);
- }
- if(valClass.equals(targetWrapperClass)) {
- return value;
- }
- if(Number.class.isAssignableFrom(targetWrapperClass)) {
- if(targetWrapperClass.equals(Byte.class))
- return new Byte(num.byteValue());
- if(targetWrapperClass.equals(Integer.class))
- return new Integer(num.intValue());
- if(targetWrapperClass.equals(Short.class))
- return new Short(num.shortValue());
- if(targetWrapperClass.equals(Long.class))
- return new Long(num.longValue());
- if(targetWrapperClass.equals(BigInteger.class))
- return BigInteger.valueOf(num.longValue());
- if(targetWrapperClass.equals(Float.class))
- return new Float(num.floatValue());
- if(targetWrapperClass.equals(Double.class))
- return new Double(num.doubleValue());
- if(targetWrapperClass.equals(BigDecimal.class))
- return new BigDecimal(num.doubleValue());
- }
- return value;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/expressions/UMLOCLFactory.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/expressions/UMLOCLFactory.java
deleted file mode 100644
index 162243fd374..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/expressions/UMLOCLFactory.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package org.eclipse.papyrus.diagram.component.expressions;
-
-import java.util.Collections;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EParameter;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.ocl.Environment;
-import org.eclipse.ocl.EvaluationEnvironment;
-import org.eclipse.ocl.ParserException;
-import org.eclipse.ocl.ecore.EcoreFactory;
-import org.eclipse.ocl.ecore.OCLExpression;
-import org.eclipse.ocl.ecore.Variable;
-import org.eclipse.ocl.ecore.OCL.Helper;
-import org.eclipse.ocl.options.ParsingOptions;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class UMLOCLFactory {
-
- /**
- * @generated
- */
- private final UMLAbstractExpression[] expressions;
-
- /**
- * @generated
- */
- protected UMLOCLFactory() {
- this.expressions = new UMLAbstractExpression[9];
- }
-
- /**
- * @generated
- */
- public static UMLAbstractExpression getExpression(int index, EClassifier context, Map<String, EClassifier> environment) {
- UMLOCLFactory cached = UMLDiagramEditorPlugin.getInstance().getUMLOCLFactory();
- if(cached == null) {
- UMLDiagramEditorPlugin.getInstance().setUMLOCLFactory(cached = new UMLOCLFactory());
- }
- if(index < 0 || index >= cached.expressions.length) {
- throw new IllegalArgumentException();
- }
- if(cached.expressions[index] == null) {
- final String[] exprBodies = new String[]{ "let base : String = \'Component\' in\r\nlet suffixes : Sequence(String) = Sequence {\'0\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in \r\nlet space : Namespace = self.namespace in\r\nlet allMissed : Sequence(String) = suffixes->\r\n select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))\r\n ) in\r\nlet firstMissed : String = allMissed->first() in \r\nlet noMisses : Boolean = firstMissed.oclIsUndefined() in\r\nlet allNames : Set(String) = \r\n if noMisses \r\n then \r\n space.member->collect(e : NamedElement | \r\n if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base\r\n then \'\' \r\n else e.name \r\n endif)->asSet()->excluding(\'\') else Set{\'not in use\'} \r\n endif in \r\nlet longestName : String = \r\n if noMisses\r\n then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() \r\n else \'not in use\' \r\n endif in \r\nif noMisses then \r\n if longestName.oclIsUndefined() \r\n then base \r\n else longestName.concat(\'1\') \r\n endif \r\nelse \r\n base.concat(firstMissed) \r\nendif ", //$NON-NLS-1$
- "let base : String = \'Port\' in\r\nlet suffixes : Sequence(String) = Sequence {\'0\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in \r\nlet space : Namespace = self.namespace in\r\nlet allMissed : Sequence(String) = suffixes->\r\n select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))\r\n ) in\r\nlet firstMissed : String = allMissed->first() in \r\nlet noMisses : Boolean = firstMissed.oclIsUndefined() in\r\nlet allNames : Set(String) = \r\n if noMisses \r\n then \r\n space.member->collect(e : NamedElement | \r\n if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base\r\n then \'\' \r\n else e.name \r\n endif)->asSet()->excluding(\'\') else Set{\'not in use\'} \r\n endif in \r\nlet longestName : String = \r\n if noMisses\r\n then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() \r\n else \'not in use\' \r\n endif in \r\nif noMisses then \r\n if longestName.oclIsUndefined() \r\n then base \r\n else longestName.concat(\'1\') \r\n endif \r\nelse \r\n base.concat(firstMissed) \r\nendif ", //$NON-NLS-1$
- "let base : String = \'Interface\' in\r\nlet suffixes : Sequence(String) = Sequence {\'0\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in \r\nlet space : Namespace = self.namespace in\r\nlet allMissed : Sequence(String) = suffixes->\r\n select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))\r\n ) in\r\nlet firstMissed : String = allMissed->first() in \r\nlet noMisses : Boolean = firstMissed.oclIsUndefined() in\r\nlet allNames : Set(String) = \r\n if noMisses \r\n then \r\n space.member->collect(e : NamedElement | \r\n if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base\r\n then \'\' \r\n else e.name \r\n endif)->asSet()->excluding(\'\') else Set{\'not in use\'} \r\n endif in \r\nlet longestName : String = \r\n if noMisses\r\n then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() \r\n else \'not in use\' \r\n endif in \r\nif noMisses then \r\n if longestName.oclIsUndefined() \r\n then base \r\n else longestName.concat(\'1\') \r\n endif \r\nelse \r\n base.concat(firstMissed) \r\nendif ", //$NON-NLS-1$
- "let base : String = \'Usage\' in\r\nlet suffixes : Sequence(String) = Sequence {\'0\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in \r\nlet space : Namespace = self.namespace in\r\nlet allMissed : Sequence(String) = suffixes->\r\n select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))\r\n ) in\r\nlet firstMissed : String = allMissed->first() in \r\nlet noMisses : Boolean = firstMissed.oclIsUndefined() in\r\nlet allNames : Set(String) = \r\n if noMisses \r\n then \r\n space.member->collect(e : NamedElement | \r\n if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base\r\n then \'\' \r\n else e.name \r\n endif)->asSet()->excluding(\'\') else Set{\'not in use\'} \r\n endif in \r\nlet longestName : String = \r\n if noMisses\r\n then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() \r\n else \'not in use\' \r\n endif in \r\nif noMisses then \r\n if longestName.oclIsUndefined() \r\n then base \r\n else longestName.concat(\'1\') \r\n endif \r\nelse \r\n base.concat(firstMissed) \r\nendif ", //$NON-NLS-1$
- "let base : String = \'InterfaceRealization\' in\r\nlet suffixes : Sequence(String) = Sequence {\'0\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in \r\nlet space : Namespace = self.namespace in\r\nlet allMissed : Sequence(String) = suffixes->\r\n select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))\r\n ) in\r\nlet firstMissed : String = allMissed->first() in \r\nlet noMisses : Boolean = firstMissed.oclIsUndefined() in\r\nlet allNames : Set(String) = \r\n if noMisses \r\n then \r\n space.member->collect(e : NamedElement | \r\n if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base\r\n then \'\' \r\n else e.name \r\n endif)->asSet()->excluding(\'\') else Set{\'not in use\'} \r\n endif in \r\nlet longestName : String = \r\n if noMisses\r\n then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() \r\n else \'not in use\' \r\n endif in \r\nif noMisses then \r\n if longestName.oclIsUndefined() \r\n then base \r\n else longestName.concat(\'1\') \r\n endif \r\nelse \r\n base.concat(firstMissed) \r\nendif ", //$NON-NLS-1$
- "let base : String = \'Package\' in\r\nlet suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in \r\nlet space : Namespace = self.namespace in\r\nlet allMissed : Sequence(String) = suffixes->\r\n select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))\r\n ) in\r\nlet firstMissed : String = allMissed->first() in \r\nlet noMisses : Boolean = firstMissed.oclIsUndefined() in\r\nlet allNames : Set(String) = \r\n if noMisses \r\n then \r\n space.member->collect(e : NamedElement | \r\n if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base\r\n then \'\' \r\n else e.name \r\n endif)->asSet()->excluding(\'\') else Set{\'not in use\'} \r\n endif in \r\nlet longestName : String = \r\n if noMisses\r\n then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() \r\n else \'not in use\' \r\n endif in \r\nif noMisses then \r\n if longestName.oclIsUndefined() \r\n then base \r\n else longestName.concat(\'1\') \r\n endif \r\nelse \r\n base.concat(firstMissed) \r\nendif ", //$NON-NLS-1$
- "self.oclIsKindOf(uml::Interface)", //$NON-NLS-1$
- "self.oclIsKindOf(uml::Component) or self.oclIsKindOf(uml::Port)", //$NON-NLS-1$
- "self.name.concat(\'.file\') ", //$NON-NLS-1$
- };
- cached.expressions[index] = getExpression(exprBodies[index], context, environment == null ? Collections.<String, EClassifier> emptyMap() : environment);
- }
- return cached.expressions[index];
- }
-
-
- /**
- * This is factory method, callers are responsible to keep reference to the return value if they want to reuse parsed expression
- * @generated
- */
- public static UMLAbstractExpression getExpression(String body, EClassifier context, Map<String, EClassifier> environment) {
- return new Expression(body, context, environment);
- }
-
- /**
- * This method will become private in the next release
- * @generated
- */
- public static UMLAbstractExpression getExpression(String body, EClassifier context) {
- return getExpression(body, context, Collections.<String, EClassifier> emptyMap());
- }
-
- /**
- * @generated
- */
- private static class Expression extends UMLAbstractExpression {
-
- /**
- * @generated
- */
- private final org.eclipse.ocl.ecore.OCL oclInstance;
-
- /**
- * @generated
- */
- private OCLExpression oclExpression;
-
- /**
- * @generated
- */
- public Expression(String body, EClassifier context, Map<String, EClassifier> environment) {
- super(body, context);
- oclInstance = org.eclipse.ocl.ecore.OCL.newInstance();
- initCustomEnv(oclInstance.getEnvironment(), environment);
- Helper oclHelper = oclInstance.createOCLHelper();
- oclHelper.setContext(context());
- try {
- oclExpression = oclHelper.createQuery(body());
- setStatus(IStatus.OK, null, null);
- } catch (ParserException e) {
- setStatus(IStatus.ERROR, e.getMessage(), e);
- }
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected Object doEvaluate(Object context, Map env) {
- if(oclExpression == null) {
- return null;
- }
- // on the first call, both evalEnvironment and extentMap are clear, for later we have finally, below.
- EvaluationEnvironment<?, ?, ?, ?, ?> evalEnv = oclInstance.getEvaluationEnvironment();
- // initialize environment
- for(Object nextKey : env.keySet()) {
- evalEnv.replace((String)nextKey, env.get(nextKey));
- }
- try {
- Object result = oclInstance.evaluate(context, oclExpression);
- return oclInstance.isInvalid(result) ? null : result;
- } finally {
- evalEnv.clear();
- oclInstance.setExtentMap(null); // clear allInstances cache, and get the oclInstance ready for the next call
- }
- }
-
- /**
- * @generated
- */
- private static void initCustomEnv(Environment<?, EClassifier, ?, ?, ?, EParameter, ?, ?, ?, ?, ?, ?> ecoreEnv, Map<String, EClassifier> environment) {
- // Use EObject as implicit root class for any object, to allow eContainer() and other EObject operations from OCL expressions
- ParsingOptions.setOption(ecoreEnv, ParsingOptions.implicitRootClass(ecoreEnv), EcorePackage.eINSTANCE.getEObject());
- for(String varName : environment.keySet()) {
- EClassifier varType = environment.get(varName);
- ecoreEnv.addElement(varName, createVar(ecoreEnv, varName, varType), false);
- }
- }
-
- /**
- * @generated
- */
- private static Variable createVar(Environment<?, EClassifier, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?> ecoreEnv, String name, EClassifier type) {
- Variable var = EcoreFactory.eINSTANCE.createVariable();
- var.setName(name);
- var.setType(ecoreEnv.getUMLReflection().getOCLType(type));
- return var;
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/parsers/AbstractParser.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/parsers/AbstractParser.java
deleted file mode 100644
index 02b2023c9d1..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/parsers/AbstractParser.java
+++ /dev/null
@@ -1,418 +0,0 @@
-package org.eclipse.papyrus.diagram.component.parsers;
-
-import java.util.Arrays;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.diagram.component.part.Messages;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public abstract class AbstractParser implements IParser {
-
- /**
- * @generated
- */
- protected final EAttribute[] features;
-
- /**
- * @generated
- */
- protected final EAttribute[] editableFeatures;
-
- /**
- * @generated
- */
- private String viewPattern;
-
- /**
- * @generated
- */
- private String editorPattern;
-
- /**
- * @generated
- */
- private String editPattern;
-
- /**
- * @generated
- */
- public AbstractParser(EAttribute[] features) {
- if(features == null || Arrays.asList(features).contains(null)) {
- throw new IllegalArgumentException();
- }
- this.editableFeatures = this.features = features;
- }
-
- /**
- * @generated
- */
- public AbstractParser(EAttribute[] features, EAttribute[] editableFeatures) {
- if(features == null || Arrays.asList(features).contains(null)) {
- throw new IllegalArgumentException();
- }
- this.features = features;
- if(editableFeatures == null || Arrays.asList(editableFeatures).contains(null)) {
- throw new IllegalArgumentException();
- }
- this.editableFeatures = editableFeatures;
- }
-
- /**
- * @generated
- */
- public String getViewPattern() {
- return viewPattern;
- }
-
- /**
- * @generated
- */
- public void setViewPattern(String viewPattern) {
- this.viewPattern = viewPattern;
- }
-
- /**
- * @generated
- */
- public String getEditorPattern() {
- return editorPattern;
- }
-
- /**
- * @generated
- */
- public void setEditorPattern(String editorPattern) {
- this.editorPattern = editorPattern;
- }
-
- /**
- * @generated
- */
- public String getEditPattern() {
- return editPattern;
- }
-
- /**
- * @generated
- */
- public void setEditPattern(String editPattern) {
- this.editPattern = editPattern;
- }
-
- /**
- * @generated
- */
- public boolean isAffectingEvent(Object event, int flags) {
- if(event instanceof Notification) {
- return isAffectingFeature(((Notification)event).getFeature());
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean isAffectingFeature(Object feature) {
- for(int i = 0; i < features.length; i++) {
- if(features[i] == feature) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Object[] getValues(EObject element) {
- Object[] values = new Object[features.length];
- for(int i = 0; i < features.length; i++) {
- values[i] = getValue(element, features[i]);
- }
- return values;
- }
-
- /**
- * @generated
- */
- protected Object[] getEditableValues(EObject element) {
- Object[] values = new Object[editableFeatures.length];
- for(int i = 0; i < editableFeatures.length; i++) {
- values[i] = getValue(element, editableFeatures[i]);
- }
- return values;
- }
-
- /**
- * @generated
- */
- protected Object getValue(EObject element, EAttribute feature) {
- Object value = element.eGet(feature);
- Class iClass = feature.getEAttributeType().getInstanceClass();
- if(String.class.equals(iClass)) {
- if(value == null) {
- value = ""; //$NON-NLS-1$
- }
- }
- return value;
- }
-
- /**
- * @generated
- */
- protected ICommand getParseCommand(IAdaptable adapter, Object[] values, int flags) {
- if(values == null || validateNewValues(values).getCode() != IParserEditStatus.EDITABLE) {
- return UnexecutableCommand.INSTANCE;
- }
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(element);
- if(editingDomain == null) {
- return UnexecutableCommand.INSTANCE;
- }
- CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values"); //$NON-NLS-1$
- for(int i = 0; i < values.length; i++) {
- command.compose(getModificationCommand(element, editableFeatures[i], values[i]));
- }
- return command;
- }
-
- /**
- * @generated
- */
- protected ICommand getModificationCommand(EObject element, EAttribute feature, Object value) {
- value = getValidNewValue(feature, value);
- if(value instanceof InvalidValue) {
- return UnexecutableCommand.INSTANCE;
- }
- SetRequest request = new SetRequest(element, feature, value);
- return new SetValueCommand(request);
- }
-
- /**
- * @generated
- */
- protected IParserEditStatus validateNewValues(Object[] values) {
- if(values.length != editableFeatures.length) {
- return ParserEditStatus.UNEDITABLE_STATUS;
- }
- for(int i = 0; i < values.length; i++) {
- Object value = getValidNewValue(editableFeatures[i], values[i]);
- if(value instanceof InvalidValue) {
- return new ParserEditStatus(UMLDiagramEditorPlugin.ID, IParserEditStatus.UNEDITABLE, value.toString());
- }
- }
- return ParserEditStatus.EDITABLE_STATUS;
- }
-
- /**
- * @generated
- */
- protected Object getValidNewValue(EAttribute feature, Object value) {
- EClassifier type = feature.getEType();
- if(type instanceof EDataType) {
- Class iClass = type.getInstanceClass();
- if(Boolean.TYPE.equals(iClass)) {
- if(value instanceof Boolean) {
- // ok
- } else if(value instanceof String) {
- value = Boolean.valueOf((String)value);
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Character.TYPE.equals(iClass)) {
- if(value instanceof Character) {
- // ok
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- value = new Character(s.charAt(0));
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Byte.TYPE.equals(iClass)) {
- if(value instanceof Byte) {
- // ok
- } else if(value instanceof Number) {
- value = new Byte(((Number)value).byteValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Byte.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Short.TYPE.equals(iClass)) {
- if(value instanceof Short) {
- // ok
- } else if(value instanceof Number) {
- value = new Short(((Number)value).shortValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Short.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Integer.TYPE.equals(iClass)) {
- if(value instanceof Integer) {
- // ok
- } else if(value instanceof Number) {
- value = new Integer(((Number)value).intValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Integer.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Long.TYPE.equals(iClass)) {
- if(value instanceof Long) {
- // ok
- } else if(value instanceof Number) {
- value = new Long(((Number)value).longValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Long.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Float.TYPE.equals(iClass)) {
- if(value instanceof Float) {
- // ok
- } else if(value instanceof Number) {
- value = new Float(((Number)value).floatValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Float.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Double.TYPE.equals(iClass)) {
- if(value instanceof Double) {
- // ok
- } else if(value instanceof Number) {
- value = new Double(((Number)value).doubleValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Double.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(type instanceof EEnum) {
- if(value instanceof String) {
- EEnumLiteral literal = ((EEnum)type).getEEnumLiteralByLiteral((String)value);
- if(literal == null) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnknownLiteral, value));
- } else {
- value = literal.getInstance();
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, String.class.getName()));
- }
- }
- }
- return value;
- }
-
- /**
- * @generated
- */
- protected class InvalidValue {
-
- /**
- * @generated
- */
- private String description;
-
- /**
- * @generated
- */
- public InvalidValue(String description) {
- this.description = description;
- }
-
- /**
- * @generated
- */
- public String toString() {
- return description;
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/parsers/MessageFormatParser.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/parsers/MessageFormatParser.java
deleted file mode 100644
index bf8487c802d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/parsers/MessageFormatParser.java
+++ /dev/null
@@ -1,192 +0,0 @@
-package org.eclipse.papyrus.diagram.component.parsers;
-
-import java.text.FieldPosition;
-import java.text.MessageFormat;
-import java.text.ParsePosition;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.diagram.component.part.Messages;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class MessageFormatParser extends AbstractParser {
-
- /**
- * @generated
- */
- private String defaultPattern;
-
- /**
- * @generated
- */
- private String defaultEditablePattern;
-
- /**
- * @generated
- */
- private MessageFormat viewProcessor;
-
- /**
- * @generated
- */
- private MessageFormat editorProcessor;
-
- /**
- * @generated
- */
- private MessageFormat editProcessor;
-
- /**
- * @generated
- */
- public MessageFormatParser(EAttribute[] features) {
- super(features);
- }
-
- /**
- * @generated
- */
- public MessageFormatParser(EAttribute[] features, EAttribute[] editableFeatures) {
- super(features, editableFeatures);
- }
-
- /**
- * @generated
- */
- protected String getDefaultPattern() {
- if(defaultPattern == null) {
- StringBuffer sb = new StringBuffer();
- for(int i = 0; i < features.length; i++) {
- if(i > 0) {
- sb.append(' ');
- }
- sb.append('{');
- sb.append(i);
- sb.append('}');
- }
- defaultPattern = sb.toString();
- }
- return defaultPattern;
- }
-
- /**
- * @generated
- */
- public void setViewPattern(String viewPattern) {
- super.setViewPattern(viewPattern);
- viewProcessor = null;
- }
-
- /**
- * @generated
- */
- public void setEditorPattern(String editorPattern) {
- super.setEditorPattern(editorPattern);
- editorProcessor = null;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getViewProcessor() {
- if(viewProcessor == null) {
- viewProcessor = new MessageFormat(getViewPattern() == null ? getDefaultPattern() : getViewPattern());
- }
- return viewProcessor;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getEditorProcessor() {
- if(editorProcessor == null) {
- editorProcessor = new MessageFormat(getEditorPattern() == null ? getDefaultEditablePattern() : getEditorPattern());
- }
- return editorProcessor;
- }
-
- /**
- * @generated
- */
- protected String getDefaultEditablePattern() {
- if(defaultEditablePattern == null) {
- StringBuffer sb = new StringBuffer();
- for(int i = 0; i < editableFeatures.length; i++) {
- if(i > 0) {
- sb.append(' ');
- }
- sb.append('{');
- sb.append(i);
- sb.append('}');
- }
- defaultEditablePattern = sb.toString();
- }
- return defaultEditablePattern;
- }
-
- /**
- * @generated
- */
- public void setEditPattern(String editPattern) {
- super.setEditPattern(editPattern);
- editProcessor = null;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getEditProcessor() {
- if(editProcessor == null) {
- editProcessor = new MessageFormat(getEditPattern() == null ? getDefaultEditablePattern() : getEditPattern());
- }
- return editProcessor;
- }
-
- /**
- * @generated
- */
- public String getEditString(IAdaptable adapter, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- return getEditorProcessor().format(getEditableValues(element), new StringBuffer(), new FieldPosition(0)).toString();
- }
-
- /**
- * @generated
- */
- public IParserEditStatus isValidEditString(IAdaptable adapter, String editString) {
- ParsePosition pos = new ParsePosition(0);
- Object[] values = getEditProcessor().parse(editString, pos);
- if(values == null) {
- return new ParserEditStatus(UMLDiagramEditorPlugin.ID, IParserEditStatus.UNEDITABLE, NLS.bind(Messages.MessageFormatParser_InvalidInputError, new Integer(pos.getErrorIndex())));
- }
- return validateNewValues(values);
- }
-
- /**
- * @generated
- */
- public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) {
- Object[] values = getEditProcessor().parse(newString, new ParsePosition(0));
- return getParseCommand(adapter, values, flags);
- }
-
- /**
- * @generated
- */
- public String getPrintString(IAdaptable adapter, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- return getViewProcessor().format(getValues(element), new StringBuffer(), new FieldPosition(0)).toString();
- }
-
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/DeleteElementAction.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/DeleteElementAction.java
deleted file mode 100644
index 8205c3b72f5..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/DeleteElementAction.java
+++ /dev/null
@@ -1,2 +0,0 @@
-//This file is not used.
-//The DeleteElementAction is removed from the plugin and replaced by DeleteFromModelAction in the plugin org.eclipse.diagram.common.
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/DiagramEditorContextMenuProvider.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/DiagramEditorContextMenuProvider.java
deleted file mode 100644
index f5d1fda86e8..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/DiagramEditorContextMenuProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService;
-import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
-import org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @generated
- */
-public class DiagramEditorContextMenuProvider extends DiagramContextMenuProvider {
-
- /**
- * @generated
- */
- private IWorkbenchPart part;
-
- /**
- * @generated
- */
- public DiagramEditorContextMenuProvider(IWorkbenchPart part, EditPartViewer viewer) {
- super(part, viewer);
- this.part = part;
-
- }
-
- /**
- * @generated
- */
- public void buildContextMenu(final IMenuManager menu) {
- getViewer().flush();
- try {
- TransactionUtil.getEditingDomain((EObject)getViewer().getContents().getModel()).runExclusive(new Runnable() {
-
- public void run() {
- ContributionItemService.getInstance().contributeToPopupMenu(DiagramEditorContextMenuProvider.this, part);
- menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL);
-
- }
- });
- } catch (Exception e) {
- UMLDiagramEditorPlugin.getInstance().logError("Error building context menu", e);
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/LoadResourceAction.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/LoadResourceAction.java
deleted file mode 100644
index fb3b37b8cde..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/LoadResourceAction.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * @generated
- */
-public class LoadResourceAction extends AbstractHandler {
-
- /**
- * @generated
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart diagramEditor = HandlerUtil.getActiveEditorChecked(event);
- Shell shell = diagramEditor.getEditorSite().getShell();
- assert diagramEditor instanceof DiagramEditor;
- TransactionalEditingDomain editingDomain = ((DiagramEditor)diagramEditor).getEditingDomain();
- org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog loadResourceDialog = new org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog(shell, editingDomain);
- loadResourceDialog.open();
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/Messages.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/Messages.java
deleted file mode 100644
index 5241d6a309e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/Messages.java
+++ /dev/null
@@ -1,473 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * @generated
- */
-public class Messages extends NLS {
-
- /**
- * @generated
- */
- static {
- NLS.initializeMessages("messages", Messages.class); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- private Messages() {
- }
-
-
-
- /**
- * @generated
- */
- public static String UMLCreationWizardTitle;
-
- /**
- * @generated
- */
- public static String UMLCreationWizard_DiagramModelFilePageTitle;
-
- /**
- * @generated
- */
- public static String UMLCreationWizard_DiagramModelFilePageDescription;
-
- /**
- * @generated
- */
- public static String UMLCreationWizard_DomainModelFilePageTitle;
-
- /**
- * @generated
- */
- public static String UMLCreationWizard_DomainModelFilePageDescription;
-
- /**
- * @generated
- */
- public static String UMLCreationWizardOpenEditorError;
-
- /**
- * @generated
- */
- public static String UMLCreationWizardCreationError;
-
- /**
- * @generated
- */
- public static String UMLCreationWizardPageExtensionError;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditorUtil_OpenModelResourceErrorDialogTitle;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditorUtil_OpenModelResourceErrorDialogMessage;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditorUtil_CreateDiagramProgressTask;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditorUtil_CreateDiagramCommandLabel;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_isModifiable;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_handleElementContentChanged;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_IncorrectInputError;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_NoDiagramInResourceError;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_DiagramLoadingError;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_UnsynchronizedFileSaveError;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_SaveDiagramTask;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_SaveNextResourceTask;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_SaveAsOperation;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_ResourceErrorDialogTitle;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_ResourceErrorDialogMessage;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_WizardTitle;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_OpenModelFileDialogTitle;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_CreationPageName;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_CreationPageTitle;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_CreationPageDescription;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageName;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageTitle;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageDescription;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_InitDiagramCommand;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_IncorrectRootError;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditor_SavingDeletedFile;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditor_SaveAsErrorTitle;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditor_SaveAsErrorMessage;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditor_SaveErrorTitle;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditor_SaveErrorMessage;
-
- /**
- * @generated
- */
- public static String UMLElementChooserDialog_SelectModelElementTitle;
-
- /**
- * @generated
- */
- public static String ModelElementSelectionPageMessage;
-
- /**
- * @generated
- */
- public static String ValidateActionMessage;
-
- /**
- * @generated
- */
- public static String createNodesGroup_title;
-
- /**
- * @generated
- */
- public static String createNodesGroup_desc;
-
- /**
- * @generated
- */
- public static String createLinksGroup_title;
-
- /**
- * @generated
- */
- public static String createLinksGroup_desc;
-
- /**
- * @generated
- */
- public static String createPackageCreationTool_title;
-
- /**
- * @generated
- */
- public static String createPackageCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createComponentCreationTool_title;
-
- /**
- * @generated
- */
- public static String createComponentCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createInterfaceCreationTool_title;
-
- /**
- * @generated
- */
- public static String createInterfaceCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createPortCreationTool_title;
-
- /**
- * @generated
- */
- public static String createPortCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createCommentCreationTool_title;
-
- /**
- * @generated
- */
- public static String createCommentCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createConstraintCreationTool_title;
-
- /**
- * @generated
- */
- public static String createConstraintCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createLinkCreationTool_title;
-
- /**
- * @generated
- */
- public static String createLinkCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createDependencyCreationTool_title;
-
- /**
- * @generated
- */
- public static String createDependencyCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createAbstractionCreationTool_title;
-
- /**
- * @generated
- */
- public static String createAbstractionCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createManifestationCreationTool_title;
-
- /**
- * @generated
- */
- public static String createManifestationCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createGeneralizationCreationTool_title;
-
- /**
- * @generated
- */
- public static String createGeneralizationCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createUsageCreationTool_title;
-
- /**
- * @generated
- */
- public static String createUsageCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createSubstitutionCreationTool_title;
-
- /**
- * @generated
- */
- public static String createSubstitutionCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createInterfaceRealizationCreationTool_title;
-
- /**
- * @generated
- */
- public static String createInterfaceRealizationCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createComponentRealizationCreationTool_title;
-
- /**
- * @generated
- */
- public static String createComponentRealizationCreationTool_desc;
-
- /**
- * @generated
- */
- public static String ComponentCompositeCompartmentEditPart_title;
-
- /**
- * @generated
- */
- public static String PackagePackageableElementCompartmentEditPart_title;
-
- /**
- * @generated
- */
- public static String ComponentCompositeCompartmentEditPartCN_title;
-
- /**
- * @generated
- */
- public static String ComponentCompositeCompartmentEditPartPCN_title;
-
-
- /**
- * @generated
- */
- public static String CommandName_OpenDiagram;
-
- /**
- * @generated
- */
- public static String AbstractParser_UnexpectedValueType;
-
- /**
- * @generated
- */
- public static String AbstractParser_WrongStringConversion;
-
- /**
- * @generated
- */
- public static String AbstractParser_UnknownLiteral;
-
-
- /**
- * @generated
- */
- public static String MessageFormatParser_InvalidInputError;
-
- /**
- * @generated
- */
- public static String UMLModelingAssistantProviderTitle;
-
- /**
- * @generated
- */
- public static String UMLModelingAssistantProviderMessage;
-
- //TODO: put accessor fields manually
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/ModelElementSelectionPage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/ModelElementSelectionPage.java
deleted file mode 100644
index 8743b0b8b68..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/ModelElementSelectionPage.java
+++ /dev/null
@@ -1,140 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.FeatureMap;
-import org.eclipse.emf.edit.provider.IWrapperItemProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * Wizard page that allows to select element from model.
- * @generated
- */
-public class ModelElementSelectionPage extends WizardPage {
-
- /**
- * @generated
- */
- protected EObject selectedModelElement;
-
- /**
- * @generated
- */
- private TreeViewer modelViewer;
-
- /**
- * @generated
- */
- public ModelElementSelectionPage(String pageName) {
- super(pageName);
- }
-
- /**
- * @generated
- */
- public EObject getModelElement() {
- return selectedModelElement;
- }
-
- /**
- * @generated
- */
- public void setModelElement(EObject modelElement) {
- selectedModelElement = modelElement;
- if(modelViewer != null) {
- if(selectedModelElement != null) {
- modelViewer.setInput(selectedModelElement.eResource());
- modelViewer.setSelection(new StructuredSelection(selectedModelElement));
- } else {
- modelViewer.setInput(null);
- }
- setPageComplete(validatePage());
- }
- }
-
- /**
- * @generated
- */
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
-
- Composite plate = new Composite(parent, SWT.NONE);
- plate.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- plate.setLayout(layout);
- setControl(plate);
-
- Label label = new Label(plate, SWT.NONE);
- label.setText(getSelectionTitle());
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- modelViewer = new TreeViewer(plate, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- GridData layoutData = new GridData(GridData.FILL_BOTH);
- layoutData.heightHint = 300;
- layoutData.widthHint = 300;
- modelViewer.getTree().setLayoutData(layoutData);
- modelViewer.setContentProvider(new AdapterFactoryContentProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()));
- modelViewer.setLabelProvider(new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()));
- if(selectedModelElement != null) {
- modelViewer.setInput(selectedModelElement.eResource());
- modelViewer.setSelection(new StructuredSelection(selectedModelElement));
- }
- modelViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- ModelElementSelectionPage.this.updateSelection((IStructuredSelection)event.getSelection());
- }
- });
-
- setPageComplete(validatePage());
- }
-
- /**
- * Override to provide custom model element description.
- * @generated
- */
- protected String getSelectionTitle() {
- return Messages.ModelElementSelectionPageMessage;
- }
-
- /**
- * @generated
- */
- protected void updateSelection(IStructuredSelection selection) {
- selectedModelElement = null;
- if(selection.size() == 1) {
- Object selectedElement = selection.getFirstElement();
- if(selectedElement instanceof IWrapperItemProvider) {
- selectedElement = ((IWrapperItemProvider)selectedElement).getValue();
- }
- if(selectedElement instanceof FeatureMap.Entry) {
- selectedElement = ((FeatureMap.Entry)selectedElement).getValue();
- }
- if(selectedElement instanceof EObject) {
- selectedModelElement = (EObject)selectedElement;
- }
- }
- setPageComplete(validatePage());
- }
-
- /**
- * Override to provide specific validation of the selected model element.
- * @generated
- */
- protected boolean validatePage() {
- return true;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLCreationWizard.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLCreationWizard.java
deleted file mode 100644
index 9e4d0358de0..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLCreationWizard.java
+++ /dev/null
@@ -1,154 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-/**
- * @generated
- */
-public class UMLCreationWizard extends Wizard implements INewWizard {
-
- /**
- * @generated
- */
- private IWorkbench workbench;
-
- /**
- * @generated
- */
- protected IStructuredSelection selection;
-
- /**
- * @generated
- */
- protected UMLCreationWizardPage diagramModelFilePage;
-
- /**
- * @generated
- */
- protected UMLCreationWizardPage domainModelFilePage;
-
- /**
- * @generated
- */
- protected Resource diagram;
-
- /**
- * @generated
- */
- private boolean openNewlyCreatedDiagramEditor = true;
-
- /**
- * @generated
- */
- public IWorkbench getWorkbench() {
- return workbench;
- }
-
- /**
- * @generated
- */
- public IStructuredSelection getSelection() {
- return selection;
- }
-
- /**
- * @generated
- */
- public final Resource getDiagram() {
- return diagram;
- }
-
- /**
- * @generated
- */
- public final boolean isOpenNewlyCreatedDiagramEditor() {
- return openNewlyCreatedDiagramEditor;
- }
-
- /**
- * @generated
- */
- public void setOpenNewlyCreatedDiagramEditor(boolean openNewlyCreatedDiagramEditor) {
- this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor;
- }
-
- /**
- * @generated
- */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.workbench = workbench;
- this.selection = selection;
- setWindowTitle(Messages.UMLCreationWizardTitle);
- setDefaultPageImageDescriptor(UMLDiagramEditorPlugin.getBundledImageDescriptor("icons/wizban/NewUMLWizard.gif")); //$NON-NLS-1$
- setNeedsProgressMonitor(true);
- }
-
- /**
- * @generated
- */
- public void addPages() {
- diagramModelFilePage = new UMLCreationWizardPage("DiagramModelFile", getSelection(), "PapyrusUMLComponent_diagram"); //$NON-NLS-1$ //$NON-NLS-2$
- diagramModelFilePage.setTitle(Messages.UMLCreationWizard_DiagramModelFilePageTitle);
- diagramModelFilePage.setDescription(Messages.UMLCreationWizard_DiagramModelFilePageDescription);
- addPage(diagramModelFilePage);
-
- domainModelFilePage = new UMLCreationWizardPage("DomainModelFile", getSelection(), "PapyrusUMLComponent") { //$NON-NLS-1$ //$NON-NLS-2$
-
- public void setVisible(boolean visible) {
- if(visible) {
- String fileName = diagramModelFilePage.getFileName();
- fileName = fileName.substring(0, fileName.length() - ".PapyrusUMLComponent_diagram".length()); //$NON-NLS-1$
- setFileName(UMLDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), fileName, "PapyrusUMLComponent")); //$NON-NLS-1$
- }
- super.setVisible(visible);
- }
- };
- domainModelFilePage.setTitle(Messages.UMLCreationWizard_DomainModelFilePageTitle);
- domainModelFilePage.setDescription(Messages.UMLCreationWizard_DomainModelFilePageDescription);
- addPage(domainModelFilePage);
- }
-
- /**
- * @generated
- */
- public boolean performFinish() {
- IRunnableWithProgress op = new WorkspaceModifyOperation(null) {
-
- protected void execute(IProgressMonitor monitor) throws CoreException, InterruptedException {
- diagram = UMLDiagramEditorUtil.createDiagram(diagramModelFilePage.getURI(), domainModelFilePage.getURI(), monitor);
- if(isOpenNewlyCreatedDiagramEditor() && diagram != null) {
- try {
- UMLDiagramEditorUtil.openDiagram(diagram);
- } catch (PartInitException e) {
- ErrorDialog.openError(getContainer().getShell(), Messages.UMLCreationWizardOpenEditorError, null, e.getStatus());
- }
- }
- }
- };
- try {
- getContainer().run(false, true, op);
- } catch (InterruptedException e) {
- return false;
- } catch (InvocationTargetException e) {
- if(e.getTargetException() instanceof CoreException) {
- ErrorDialog.openError(getContainer().getShell(), Messages.UMLCreationWizardCreationError, null, ((CoreException)e.getTargetException()).getStatus());
- } else {
- UMLDiagramEditorPlugin.getInstance().logError("Error creating diagram", e.getTargetException()); //$NON-NLS-1$
- }
- return false;
- }
- return diagram != null;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLCreationWizardPage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLCreationWizardPage.java
deleted file mode 100644
index 766c96141a6..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLCreationWizardPage.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-
-/**
- * @generated
- */
-public class UMLCreationWizardPage extends WizardNewFileCreationPage {
-
- /**
- * @generated
- */
- private final String fileExtension;
-
- /**
- * @generated
- */
- public UMLCreationWizardPage(String pageName, IStructuredSelection selection, String fileExtension) {
- super(pageName, selection);
- this.fileExtension = fileExtension;
- }
-
- /**
- * Override to create files with this extension.
- *
- * @generated
- */
- protected String getExtension() {
- return fileExtension;
- }
-
- /**
- * @generated
- */
- public URI getURI() {
- return URI.createPlatformResourceURI(getFilePath().toString(), false);
- }
-
- /**
- * @generated
- */
- protected IPath getFilePath() {
- IPath path = getContainerFullPath();
- if(path == null) {
- path = new Path(""); //$NON-NLS-1$
- }
- String fileName = getFileName();
- if(fileName != null) {
- path = path.append(fileName);
- }
- return path;
- }
-
- /**
- * @generated
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- setFileName(UMLDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), getFileName(), getExtension()));
- setPageComplete(validatePage());
- }
-
- /**
- * @generated
- */
- protected boolean validatePage() {
- if(!super.validatePage()) {
- return false;
- }
- String extension = getExtension();
- if(extension != null && !getFilePath().toString().endsWith("." + extension)) {
- setErrorMessage(NLS.bind(Messages.UMLCreationWizardPageExtensionError, extension));
- return false;
- }
- return true;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramActionBarContributor.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramActionBarContributor.java
deleted file mode 100644
index 1656e6b643a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramActionBarContributor.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * @generated
- */
-public class UMLDiagramActionBarContributor extends DiagramActionBarContributor {
-
- /**
- * @generated
- */
- protected Class getEditorClass() {
- return UMLDiagramEditor.class;
- }
-
- /**
- * @generated
- */
- protected String getEditorId() {
- return UMLDiagramEditor.ID;
- }
-
- /**
- * @generated
- */
- public void init(IActionBars bars, IWorkbenchPage page) {
- super.init(bars, page);
- // print preview
- IMenuManager fileMenu = bars.getMenuManager().findMenuUsingPath(IWorkbenchActionConstants.M_FILE);
- assert fileMenu != null;
- fileMenu.remove("pageSetupAction"); //$NON-NLS-1$
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramEditor.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramEditor.java
deleted file mode 100644
index 0d07dacf56f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramEditor.java
+++ /dev/null
@@ -1,493 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import java.util.EventObject;
-
-import org.eclipse.core.commands.operations.IUndoableOperation;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.KeyHandler;
-import org.eclipse.gef.Tool;
-import org.eclipse.gef.commands.CommandStackListener;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.ui.palette.PaletteViewer;
-import org.eclipse.gef.ui.palette.PaletteViewerProvider;
-import org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener;
-import org.eclipse.gmf.runtime.common.core.service.ProviderChangeEvent;
-import org.eclipse.gmf.runtime.common.ui.services.marker.MarkerNavigationService;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
-import org.eclipse.gmf.runtime.diagram.ui.internal.parts.PaletteToolTransferDragSourceListener;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.papyrus.core.adaptor.gmf.GmfMultiDiagramDocumentProvider;
-import org.eclipse.papyrus.core.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.core.services.ServiceException;
-import org.eclipse.papyrus.core.services.ServicesRegistry;
-import org.eclipse.papyrus.diagram.common.listeners.DropTargetListener;
-import org.eclipse.papyrus.diagram.common.part.PapyrusPaletteContextMenuProvider;
-import org.eclipse.papyrus.diagram.common.part.PapyrusPaletteViewer;
-import org.eclipse.papyrus.diagram.common.part.UmlGmfDiagramEditor;
-import org.eclipse.papyrus.diagram.common.service.PapyrusPaletteService;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.ide.IGotoMarker;
-import org.eclipse.ui.part.ShowInContext;
-
-/**
- * @generated
- */
-public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderChangeListener, IGotoMarker {
-
- /**
- * @generated
- */
- public static final String ID = "org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorID"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final String CONTEXT_ID = "org.eclipse.papyrus.diagram.component.ui.diagramContext"; //$NON-NLS-1$
-
-
-
- /**
- * @generated
- */
- private KeyHandler paletteKeyHandler = null;
-
- /**
- * @generated
- */
- private MouseListener paletteMouseListener = null;
-
-
- /**
- * @generated
- */
- private IUndoableOperation savedOperation = null;
-
- /**
- * @generated
- */
- private TransactionalEditingDomain editingDomain;
-
- /**
- * @generated
- */
- private IDocumentProvider documentProvider;
-
-
-
-
- /**
- * @generated
- */
- public UMLDiagramEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws ServiceException {
- super(servicesRegistry, diagram);
-
-
- // adds a listener to the palette service, which reacts to palette customizations
- PapyrusPaletteService.getInstance().addProviderChangeListener(this);
-
-
- // Share the same editing provider
- editingDomain = servicesRegistry.getService(TransactionalEditingDomain.class);
- documentProvider = new GmfMultiDiagramDocumentProvider(editingDomain);
-
- // overrides editing domain created by super constructor
- setDocumentProvider(documentProvider);
-
-
- }
-
- /**
- * @generated
- */
- protected String getContextID() {
- return CONTEXT_ID;
- }
-
- /**
- * @generated
- */
- protected PaletteRoot createPaletteRoot(PaletteRoot existingPaletteRoot) {
- PaletteRoot paletteRoot;
- if(existingPaletteRoot == null) {
- paletteRoot = PapyrusPaletteService.getInstance().createPalette(this, getDefaultPaletteContent());
- } else {
- PapyrusPaletteService.getInstance().updatePalette(existingPaletteRoot, this, getDefaultPaletteContent());
- paletteRoot = existingPaletteRoot;
- }
- applyCustomizationsToPalette(paletteRoot);
- return paletteRoot;
- }
-
- /**
- * @generated
- */
- protected PreferencesHint getPreferencesHint() {
- return UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
- }
-
- /**
- * @generated
- */
- public String getContributorId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- protected final IDocumentProvider getDocumentProvider(IEditorInput input) {
- return documentProvider;
- }
-
- /**
- * @generated
- */
- public TransactionalEditingDomain getEditingDomain() {
- return editingDomain;
- }
-
- /**
- * @generated
- */
- protected final void setDocumentProvider(IEditorInput input) {
- // Already set in the constructor
- }
-
- /**
- * @generated
- */
- public void gotoMarker(IMarker marker) {
- MarkerNavigationService.getInstance().gotoMarker(this, marker);
- }
-
- /**
- * @generated
- */
- public boolean isSaveAsAllowed() {
- return true;
- }
-
- /**
- * @generated
- */
- public void doSaveAs() {
- performSaveAs(new NullProgressMonitor());
- }
-
- /**
- * @generated
- */
- protected void performSaveAs(IProgressMonitor progressMonitor) {
- // Nothing
- }
-
- /**
- * @generated
- */
- public ShowInContext getShowInContext() {
- return new ShowInContext(getEditorInput(), getGraphicalViewer().getSelection());
- }
-
- /**
- * @generated
- */
- protected void configureGraphicalViewer() {
- super.configureGraphicalViewer();
- DiagramEditorContextMenuProvider provider = new DiagramEditorContextMenuProvider(this, getDiagramGraphicalViewer());
- getDiagramGraphicalViewer().setContextMenu(provider);
- getSite().registerContextMenu(ActionIds.DIAGRAM_EDITOR_CONTEXT_MENU, provider, getDiagramGraphicalViewer());
- }
-
-
-
- /**
- * @generated
- */
- protected TransactionalEditingDomain createEditingDomain() {
- // Already configured
- return editingDomain;
- }
-
- /**
- * @generated
- */
- protected void configureDiagramEditDomain() {
- super.configureDiagramEditDomain();
- getDiagramEditDomain().getDiagramCommandStack().addCommandStackListener(new CommandStackListener() {
-
- public void commandStackChanged(EventObject event) {
- firePropertyChange(IEditorPart.PROP_DIRTY);
- }
- });
- }
-
- /**
- * @generated
- */
- public void doSave(IProgressMonitor progressMonitor) {
- // The saving of the resource is done by the CoreMultiDiagramEditor
- savedOperation = getOperationHistory().getUndoOperation(getUndoContext());
- }
-
- /**
- * @generated
- */
- public boolean isDirty() {
- IUndoableOperation op = getOperationHistory().getUndoOperation(getUndoContext());
- return savedOperation != op;
- }
-
-
- /**
- * @generated
- */
- public void providerChanged(ProviderChangeEvent event) {
- // update the palette if the palette service has changed
- if(PapyrusPaletteService.getInstance().equals(event.getSource())) {
- PapyrusPaletteService.getInstance().updatePalette(getPaletteViewer().getPaletteRoot(), this, getDefaultPaletteContent());
- }
- }
-
- /**
- * @generated
- */
- public void dispose() {
- // remove palette service listener
- // remove preference listener
- PapyrusPaletteService.getInstance().removeProviderChangeListener(this);
-
- super.dispose();
- }
-
- /**
- * @generated
- */
- protected PaletteViewer getPaletteViewer() {
- return getEditDomain().getPaletteViewer();
- }
-
-
-
- /**
- * @generated
- */
- protected PaletteViewer constructPaletteViewer() {
- return new PapyrusPaletteViewer();
- }
-
- /**
- * @generated
- */
- protected PaletteViewerProvider createPaletteViewerProvider() {
- getEditDomain().setPaletteRoot(createPaletteRoot(null));
- return new PaletteViewerProvider(getEditDomain()) {
-
- /**
- * Override to provide the additional behavior for the tools. Will intialize with a
- * PaletteEditPartFactory that has a TrackDragger that understand how to handle the
- * mouseDoubleClick event for shape creation tools. Also will initialize the palette
- * with a defaultTool that is the SelectToolEx that undestands how to handle the enter
- * key which will result in the creation of the shape also.
- */
- protected void configurePaletteViewer(PaletteViewer viewer) {
- super.configurePaletteViewer(viewer);
-
- // customize menu...
- viewer.setContextMenu(new PapyrusPaletteContextMenuProvider(viewer));
-
- viewer.getKeyHandler().setParent(getPaletteKeyHandler());
- viewer.getControl().addMouseListener(getPaletteMouseListener());
-
- // Add a transfer drag target listener that is supported on
- // palette template entries whose template is a creation tool.
- // This will enable drag and drop of the palette shape creation
- // tools.
- viewer.addDragSourceListener(new PaletteToolTransferDragSourceListener(viewer));
- viewer.setCustomizer(createPaletteCustomizer());
- }
-
- public PaletteViewer createPaletteViewer(Composite parent) {
- PaletteViewer pViewer = constructPaletteViewer();
- pViewer.createControl(parent);
- configurePaletteViewer(pViewer);
- hookPaletteViewer(pViewer);
- return pViewer;
- }
-
- /**
- * @return Palette Key Handler for the palette
- */
- private KeyHandler getPaletteKeyHandler() {
-
- if(paletteKeyHandler == null) {
-
- paletteKeyHandler = new KeyHandler() {
-
- /**
- * Processes a <i>key released </i> event. This method is called by the Tool
- * whenever a key is released, and the Tool is in the proper state. Override
- * to support pressing the enter key to create a shape or connection
- * (between two selected shapes)
- *
- * @param event
- * the KeyEvent
- * @return <code>true</code> if KeyEvent was handled in some way
- */
- public boolean keyReleased(KeyEvent event) {
-
- if(event.keyCode == SWT.Selection) {
-
- Tool tool = getPaletteViewer().getActiveTool().createTool();
-
- if(toolSupportsAccessibility(tool)) {
-
- tool.keyUp(event, getDiagramGraphicalViewer());
-
- // deactivate current selection
- getPaletteViewer().setActiveTool(null);
-
- return true;
- }
-
- }
- return super.keyReleased(event);
- }
-
- };
-
- }
- return paletteKeyHandler;
- }
-
- /**
- * @return Palette Mouse listener for the palette
- */
- private MouseListener getPaletteMouseListener() {
-
- if(paletteMouseListener == null) {
-
- paletteMouseListener = new MouseListener() {
-
- /**
- * Flag to indicate that the current active tool should be cleared after a
- * mouse double-click event.
- */
- private boolean clearActiveTool = false;
-
- /**
- * Override to support double-clicking a palette tool entry to create a
- * shape or connection (between two selected shapes).
- *
- * @see MouseListener#mouseDoubleClick(MouseEvent)
- */
- public void mouseDoubleClick(MouseEvent e) {
- Tool tool = getPaletteViewer().getActiveTool().createTool();
-
- if(toolSupportsAccessibility(tool)) {
-
- tool.setViewer(getDiagramGraphicalViewer());
- tool.setEditDomain(getDiagramGraphicalViewer().getEditDomain());
- tool.mouseDoubleClick(e, getDiagramGraphicalViewer());
-
- // Current active tool should be deactivated,
- // but if it is down here it will get
- // reactivated deep in GEF palette code after
- // receiving mouse up events.
- clearActiveTool = true;
- }
- }
-
- public void mouseDown(MouseEvent e) {
- // do nothing
- }
-
- public void mouseUp(MouseEvent e) {
- // Deactivate current active tool here if a
- // double-click was handled.
- if(clearActiveTool) {
- getPaletteViewer().setActiveTool(null);
- clearActiveTool = false;
- }
-
- }
- };
-
- }
- return paletteMouseListener;
- }
-
- };
- }
-
- /**
- * @generated
- */
- @Override
- public GraphicalViewer getGraphicalViewer() {
- return super.getGraphicalViewer();
- }
-
- /**
- * @generated
- */
- @Override
- protected void initializeGraphicalViewer() {
- super.initializeGraphicalViewer();
-
- // Enable Drop
- getDiagramGraphicalViewer().addDropTargetListener(new DropTargetListener(getDiagramGraphicalViewer(), LocalSelectionTransfer.getTransfer()) {
-
- @Override
- protected Object getJavaObject(TransferData data) {
- return LocalSelectionTransfer.getTransfer().nativeToJava(data);
- }
-
- @Override
- protected TransactionalEditingDomain getTransactionalEditingDomain() {
- return getEditingDomain();
- }
- });
-
- }
-
- /**
- * @generated
- */
- @Override
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if(getSite().getPage().getActiveEditor() instanceof IMultiDiagramEditor) {
- IMultiDiagramEditor editor = (IMultiDiagramEditor)getSite().getPage().getActiveEditor();
- // If not the active editor, ignore selection changed.
- if(this.equals(editor.getActiveEditor())) {
- updateActions(getSelectionActions());
- super.selectionChanged(part, selection);
- } else {
- super.selectionChanged(part, selection);
- }
- } else {
- super.selectionChanged(part, selection);
- }
- // from
- // org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.selectionChanged(IWorkbenchPart,
- // ISelection)
- if(part == this) {
- rebuildStatusLine();
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramEditorPlugin.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramEditorPlugin.java
deleted file mode 100644
index d75f012eb21..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramEditorPlugin.java
+++ /dev/null
@@ -1,319 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
-import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
-import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.diagram.component.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.component.expressions.UMLOCLFactory;
-import org.eclipse.papyrus.diagram.component.preferences.DiagramPreferenceInitializer;
-import org.eclipse.papyrus.diagram.component.providers.ElementInitializers;
-import org.eclipse.papyrus.preferences.Activator;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
-import org.osgi.framework.BundleContext;
-
-/**
- * @generated
- */
-public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
-
- /**
- * @generated
- */
- public static final String ID = "org.eclipse.papyrus.diagram.component"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(ID);
-
- /**
- * @generated
- */
- private static UMLDiagramEditorPlugin instance;
-
- /**
- * @generated
- */
- private ComposedAdapterFactory adapterFactory;
-
- /**
- * @generated
- */
- private UMLDocumentProvider documentProvider;
-
- /**
- * @generated
- */
- private UMLBaseItemSemanticEditPolicy.LinkConstraints linkConstraints;
-
-
- /**
- * @generated
- */
- private ElementInitializers initializers;
-
- /**
- * @generated
- */
- private UMLOCLFactory oclFactory;
-
- /**
- * @generated
- */
- public UMLDiagramEditorPlugin() {
- }
-
- /**
- * @generated
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- instance = this;
- PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore());
- adapterFactory = createAdapterFactory();
- DiagramPreferenceInitializer diagramPreferenceInitializer = new DiagramPreferenceInitializer();
- diagramPreferenceInitializer.initializeDefaultPreferences();
- }
-
- /**
- * @generated
- */
- public void stop(BundleContext context) throws Exception {
- adapterFactory.dispose();
- adapterFactory = null;
- linkConstraints = null;
- initializers = null;
- oclFactory = null;
- instance = null;
- super.stop(context);
- }
-
- /**
- * @generated
- */
- public static UMLDiagramEditorPlugin getInstance() {
- return instance;
- }
-
- /**
- * @generated
- */
- public IPreferenceStore getPreferenceStore() {
- IPreferenceStore store = Activator.getDefault().getPreferenceStore();
- return store;
- }
-
- /**
- * @generated
- */
- protected ComposedAdapterFactory createAdapterFactory() {
- ArrayList<AdapterFactory> factories = new ArrayList<AdapterFactory>();
- fillItemProviderFactories(factories);
- return new ComposedAdapterFactory(factories);
- }
-
- /**
- * @generated
- */
- protected void fillItemProviderFactories(List<AdapterFactory> factories) {
- factories.add(new UMLItemProviderAdapterFactory());
- factories.add(new EcoreItemProviderAdapterFactory());
- factories.add(new ResourceItemProviderAdapterFactory());
- factories.add(new ReflectiveItemProviderAdapterFactory());
- }
-
- /**
- * @generated
- */
- public AdapterFactory getItemProvidersAdapterFactory() {
- return adapterFactory;
- }
-
- /**
- * @generated
- */
- public ImageDescriptor getItemImageDescriptor(Object item) {
- IItemLabelProvider labelProvider = (IItemLabelProvider)adapterFactory.adapt(item, IItemLabelProvider.class);
- if(labelProvider != null) {
- return ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(item));
- }
- return null;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @generated
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getBundledImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
- }
-
- /**
- * Respects images residing in any plug-in. If path is relative,
- * then this bundle is looked up for the image, otherwise, for absolute
- * path, first segment is taken as id of plug-in with image
- *
- * @generated
- * @param path the path to image, either absolute (with plug-in id as first segment), or relative for bundled images
- * @return the image descriptor
- */
- public static ImageDescriptor findImageDescriptor(String path) {
- final IPath p = new Path(path);
- if(p.isAbsolute() && p.segmentCount() > 1) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p.removeFirstSegments(1).makeAbsolute().toString());
- } else {
- return getBundledImageDescriptor(p.makeAbsolute().toString());
- }
- }
-
- /**
- * Returns an image for the image file at the given plug-in relative path.
- * Client do not need to dispose this image. Images will be disposed automatically.
- *
- * @generated
- * @param path the path
- * @return image instance
- */
- public Image getBundledImage(String path) {
- Image image = getImageRegistry().get(path);
- if(image == null) {
- getImageRegistry().put(path, getBundledImageDescriptor(path));
- image = getImageRegistry().get(path);
- }
- return image;
- }
-
- /**
- * Returns string from plug-in's resource bundle
- *
- * @generated
- */
- public static String getString(String key) {
- return Platform.getResourceString(getInstance().getBundle(), "%" + key); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- public UMLDocumentProvider getDocumentProvider() {
- if(documentProvider == null) {
- documentProvider = new UMLDocumentProvider();
- }
- return documentProvider;
- }
-
- /**
- * @generated
- */
- public UMLBaseItemSemanticEditPolicy.LinkConstraints getLinkConstraints() {
- return linkConstraints;
- }
-
- /**
- * @generated
- */
- public void setLinkConstraints(UMLBaseItemSemanticEditPolicy.LinkConstraints lc) {
- this.linkConstraints = lc;
- }
-
- /**
- * @generated
- */
- public ElementInitializers getElementInitializers() {
- return initializers;
- }
-
- /**
- * @generated
- */
- public void setElementInitializers(ElementInitializers i) {
- this.initializers = i;
- }
-
- /**
- * @generated
- */
- public UMLOCLFactory getUMLOCLFactory() {
- return oclFactory;
- }
-
- /**
- * @generated
- */
- public void setUMLOCLFactory(UMLOCLFactory f) {
- this.oclFactory = f;
- }
-
-
- /**
- * @generated
- */
- public void logError(String error) {
- logError(error, null);
- }
-
- /**
- * @generated
- */
- public void logError(String error, Throwable throwable) {
- if(error == null && throwable != null) {
- error = throwable.getMessage();
- }
- getLog().log(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, IStatus.OK, error, throwable));
- debug(error, throwable);
- }
-
- /**
- * @generated
- */
- public void logInfo(String message) {
- logInfo(message, null);
- }
-
- /**
- * @generated
- */
- public void logInfo(String message, Throwable throwable) {
- if(message == null && throwable != null) {
- message = throwable.getMessage();
- }
- getLog().log(new Status(IStatus.INFO, UMLDiagramEditorPlugin.ID, IStatus.OK, message, throwable));
- debug(message, throwable);
- }
-
- /**
- * @generated
- */
- private void debug(String message, Throwable throwable) {
- if(!isDebugging()) {
- return;
- }
- if(message != null) {
- System.err.println(message);
- }
- if(throwable != null) {
- throwable.printStackTrace();
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramEditorUtil.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramEditorUtil.java
deleted file mode 100644
index 8993abae208..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramEditorUtil.java
+++ /dev/null
@@ -1,376 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.OperationHistoryFactory;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.uml2.uml.Model;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class UMLDiagramEditorUtil {
-
- /**
- * @generated
- */
- public static Map<?, ?> getSaveOptions() {
- HashMap<String, Object> saveOptions = new HashMap<String, Object>();
- saveOptions.put(XMLResource.OPTION_ENCODING, "UTF-8"); //$NON-NLS-1$
- saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
- return saveOptions;
- }
-
- /**
- * @generated
- */
- public static boolean openDiagram(Resource diagram) throws PartInitException {
- String path = diagram.getURI().toPlatformString(true);
- IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path));
- if(workspaceResource instanceof IFile) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- return null != page.openEditor(new FileEditorInput((IFile)workspaceResource), UMLDiagramEditor.ID);
- }
- return false;
- }
-
- /**
- * @generated
- */
- public static void setCharset(IFile file) {
- if(file == null) {
- return;
- }
- try {
- file.setCharset("UTF-8", new NullProgressMonitor()); //$NON-NLS-1$
- } catch (CoreException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to set charset for file " + file.getFullPath(), e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public static String getUniqueFileName(IPath containerFullPath, String fileName, String extension) {
- if(containerFullPath == null) {
- containerFullPath = new Path(""); //$NON-NLS-1$
- }
- if(fileName == null || fileName.trim().length() == 0) {
- fileName = "default"; //$NON-NLS-1$
- }
- IPath filePath = containerFullPath.append(fileName);
- if(extension != null && !extension.equals(filePath.getFileExtension())) {
- filePath = filePath.addFileExtension(extension);
- }
- extension = filePath.getFileExtension();
- fileName = filePath.removeFileExtension().lastSegment();
- int i = 1;
- while(ResourcesPlugin.getWorkspace().getRoot().exists(filePath)) {
- i++;
- filePath = containerFullPath.append(fileName + i);
- if(extension != null) {
- filePath = filePath.addFileExtension(extension);
- }
- }
- return filePath.lastSegment();
- }
-
-
-
- /**
- * Runs the wizard in a dialog.
- *
- * @generated
- */
- public static void runWizard(Shell shell, Wizard wizard, String settingsKey) {
- IDialogSettings pluginDialogSettings = UMLDiagramEditorPlugin.getInstance().getDialogSettings();
- IDialogSettings wizardDialogSettings = pluginDialogSettings.getSection(settingsKey);
- if(wizardDialogSettings == null) {
- wizardDialogSettings = pluginDialogSettings.addNewSection(settingsKey);
- }
- wizard.setDialogSettings(wizardDialogSettings);
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.getShell().setSize(Math.max(500, dialog.getShell().getSize().x), 500);
- dialog.open();
- }
-
- /**
- * This method should be called within a workspace modify operation since it creates resources.
- * @generated
- */
- public static Resource createDiagram(URI diagramURI, URI modelURI, IProgressMonitor progressMonitor) {
- TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
- progressMonitor.beginTask(Messages.UMLDiagramEditorUtil_CreateDiagramProgressTask, 3);
- final Resource diagramResource = editingDomain.getResourceSet().createResource(diagramURI);
- final Resource modelResource = editingDomain.getResourceSet().createResource(modelURI);
- final String diagramName = diagramURI.lastSegment();
- AbstractTransactionalCommand command = new AbstractTransactionalCommand(editingDomain, Messages.UMLDiagramEditorUtil_CreateDiagramCommandLabel, Collections.EMPTY_LIST) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- Model model = createInitialModel();
- attachModelToResource(model, modelResource);
-
- Diagram diagram = ViewService.createDiagram(model, ComponentDiagramEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- if(diagram != null) {
- diagramResource.getContents().add(diagram);
- diagram.setName(diagramName);
- diagram.setElement(model);
- }
-
- try {
- modelResource.save(org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorUtil.getSaveOptions());
- diagramResource.save(org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorUtil.getSaveOptions());
- } catch (IOException e) {
-
- UMLDiagramEditorPlugin.getInstance().logError("Unable to store model and diagram resources", e); //$NON-NLS-1$
- }
- return CommandResult.newOKCommandResult();
- }
- };
- try {
- OperationHistoryFactory.getOperationHistory().execute(command, new SubProgressMonitor(progressMonitor, 1), null);
- } catch (ExecutionException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
- }
- setCharset(WorkspaceSynchronizer.getFile(modelResource));
- setCharset(WorkspaceSynchronizer.getFile(diagramResource));
- return diagramResource;
- }
-
-
- /**
- * Create a new instance of domain element associated with canvas.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static Model createInitialModel() {
- return UMLFactory.eINSTANCE.createModel();
- }
-
-
- /**
- * Store model element in the resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static void attachModelToResource(Model model, Resource resource) {
- resource.getContents().add(model);
- }
-
-
-
-
-
- /**
- * @generated
- */
- public static void selectElementsInDiagram(IDiagramWorkbenchPart diagramPart, List<EditPart> editParts) {
- diagramPart.getDiagramGraphicalViewer().deselectAll();
-
- EditPart firstPrimary = null;
- for(EditPart nextPart : editParts) {
- diagramPart.getDiagramGraphicalViewer().appendSelection(nextPart);
- if(firstPrimary == null && nextPart instanceof IPrimaryEditPart) {
- firstPrimary = nextPart;
- }
- }
-
- if(!editParts.isEmpty()) {
- diagramPart.getDiagramGraphicalViewer().reveal(firstPrimary != null ? firstPrimary : (EditPart)editParts.get(0));
- }
- }
-
-
- /**
- * @generated
- */
- private static int findElementsInDiagramByID(DiagramEditPart diagramPart, EObject element, List<EditPart> editPartCollector) {
- IDiagramGraphicalViewer viewer = (IDiagramGraphicalViewer)diagramPart.getViewer();
- final int intialNumOfEditParts = editPartCollector.size();
-
- if(element instanceof View) { // support notation element lookup
- EditPart editPart = (EditPart)viewer.getEditPartRegistry().get(element);
- if(editPart != null) {
- editPartCollector.add(editPart);
- return 1;
- }
- }
-
- String elementID = EMFCoreUtil.getProxyID(element);
- @SuppressWarnings("unchecked")
- List<EditPart> associatedParts = viewer.findEditPartsForElement(elementID, IGraphicalEditPart.class);
- // perform the possible hierarchy disjoint -> take the top-most parts only
- for(EditPart nextPart : associatedParts) {
- EditPart parentPart = nextPart.getParent();
- while(parentPart != null && !associatedParts.contains(parentPart)) {
- parentPart = parentPart.getParent();
- }
- if(parentPart == null) {
- editPartCollector.add(nextPart);
- }
- }
-
- if(intialNumOfEditParts == editPartCollector.size()) {
- if(!associatedParts.isEmpty()) {
- editPartCollector.add(associatedParts.get(0));
- } else {
- if(element.eContainer() != null) {
- return findElementsInDiagramByID(diagramPart, element.eContainer(), editPartCollector);
- }
- }
- }
- return editPartCollector.size() - intialNumOfEditParts;
- }
-
-
- /**
- * @generated
- */
- public static View findView(DiagramEditPart diagramEditPart, EObject targetElement, LazyElement2ViewMap lazyElement2ViewMap) {
- boolean hasStructuralURI = false;
- if(targetElement.eResource() instanceof XMLResource) {
- hasStructuralURI = ((XMLResource)targetElement.eResource()).getID(targetElement) == null;
- }
-
- View view = null;
- LinkedList<EditPart> editPartHolder = new LinkedList<EditPart>();
- if(hasStructuralURI && !lazyElement2ViewMap.getElement2ViewMap().isEmpty()) {
- view = lazyElement2ViewMap.getElement2ViewMap().get(targetElement);
- } else if(findElementsInDiagramByID(diagramEditPart, targetElement, editPartHolder) > 0) {
- EditPart editPart = editPartHolder.get(0);
- view = editPart.getModel() instanceof View ? (View)editPart.getModel() : null;
- }
-
- return (view == null) ? diagramEditPart.getDiagramView() : view;
- }
-
- /**
- * XXX This is quite suspicious code (especially editPartTmpHolder) and likely to be removed soon
- * @generated
- */
- public static class LazyElement2ViewMap {
-
- /**
- * @generated
- */
- private Map<EObject, View> element2ViewMap;
-
- /**
- * @generated
- */
- private View scope;
-
- /**
- * @generated
- */
- private Set<? extends EObject> elementSet;
-
- /**
- * @generated
- */
- public LazyElement2ViewMap(View scope, Set<? extends EObject> elements) {
- this.scope = scope;
- this.elementSet = elements;
- }
-
- /**
- * @generated
- */
- public final Map<EObject, View> getElement2ViewMap() {
- if(element2ViewMap == null) {
- element2ViewMap = new HashMap<EObject, View>();
- // map possible notation elements to itself as these can't be found by view.getElement()
- for(EObject element : elementSet) {
- if(element instanceof View) {
- View view = (View)element;
- if(view.getDiagram() == scope.getDiagram()) {
- element2ViewMap.put(element, view); // take only those that part of our diagram
- }
- }
- }
-
- buildElement2ViewMap(scope, element2ViewMap, elementSet);
- }
- return element2ViewMap;
- }
-
- /**
- * @generated
- */
- private static boolean buildElement2ViewMap(View parentView, Map<EObject, View> element2ViewMap, Set<? extends EObject> elements) {
- if(elements.size() == element2ViewMap.size()) {
- return true;
- }
-
- if(parentView.isSetElement() && !element2ViewMap.containsKey(parentView.getElement()) && elements.contains(parentView.getElement())) {
- element2ViewMap.put(parentView.getElement(), parentView);
- if(elements.size() == element2ViewMap.size()) {
- return true;
- }
- }
- boolean complete = false;
- for(Iterator<?> it = parentView.getChildren().iterator(); it.hasNext() && !complete;) {
- complete = buildElement2ViewMap((View)it.next(), element2ViewMap, elements);
- }
- for(Iterator<?> it = parentView.getSourceEdges().iterator(); it.hasNext() && !complete;) {
- complete = buildElement2ViewMap((View)it.next(), element2ViewMap, elements);
- }
- for(Iterator<?> it = parentView.getTargetEdges().iterator(); it.hasNext() && !complete;) {
- complete = buildElement2ViewMap((View)it.next(), element2ViewMap, elements);
- }
- return complete;
- }
- } //LazyElement2ViewMap
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramUpdateCommand.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramUpdateCommand.java
deleted file mode 100644
index 94004967868..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramUpdateCommand.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.commands.IHandlerListener;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class UMLDiagramUpdateCommand implements IHandler {
-
- /**
- * @generated
- */
- public void addHandlerListener(IHandlerListener handlerListener) {
- }
-
- /**
- * @generated
- */
- public void dispose() {
- }
-
- /**
- * @generated
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- if(selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- if(structuredSelection.size() != 1) {
- return null;
- }
- if(structuredSelection.getFirstElement() instanceof EditPart && ((EditPart)structuredSelection.getFirstElement()).getModel() instanceof View) {
- EObject modelElement = ((View)((EditPart)structuredSelection.getFirstElement()).getModel()).getElement();
- List editPolicies = CanonicalEditPolicy.getRegisteredEditPolicies(modelElement);
- for(Iterator it = editPolicies.iterator(); it.hasNext();) {
- CanonicalEditPolicy nextEditPolicy = (CanonicalEditPolicy)it.next();
- nextEditPolicy.refresh();
- }
-
- }
- }
- return null;
- }
-
- /**
- * @generated
- */
- public boolean isEnabled() {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean isHandled() {
- return true;
- }
-
- /**
- * @generated
- */
- public void removeHandlerListener(IHandlerListener handlerListener) {
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramUpdater.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramUpdater.java
deleted file mode 100644
index 13626ce7e6f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDiagramUpdater.java
+++ /dev/null
@@ -1,2323 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentCompositeCompartmentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PackageEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PackagePackageableElementCompartmentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.uml2.uml.Abstraction;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Component;
-import org.eclipse.uml2.uml.ComponentRealization;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Generalization;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.InterfaceRealization;
-import org.eclipse.uml2.uml.Manifestation;
-import org.eclipse.uml2.uml.Model;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.PackageableElement;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Substitution;
-import org.eclipse.uml2.uml.Type;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.Usage;
-
-/**
- * @generated
- */
-public class UMLDiagramUpdater {
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getSemanticChildren(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
- case ComponentDiagramEditPart.VISUAL_ID:
- return getModel_1000SemanticChildren(view);
- case ComponentEditPart.VISUAL_ID:
- return getComponent_2002SemanticChildren(view);
- case ComponentEditPartCN.VISUAL_ID:
- return getComponent_3070SemanticChildren(view);
- case ComponentEditPartPCN.VISUAL_ID:
- return getComponent_3071SemanticChildren(view);
- case ComponentCompositeCompartmentEditPart.VISUAL_ID:
- return getComponentCompositeCompartment_7001SemanticChildren(view);
- case PackagePackageableElementCompartmentEditPart.VISUAL_ID:
- return getPackagePackageableElementCompartment_7002SemanticChildren(view);
- case ComponentCompositeCompartmentEditPartCN.VISUAL_ID:
- return getComponentCompositeCompartmentCN_7003SemanticChildren(view);
- case ComponentCompositeCompartmentEditPartPCN.VISUAL_ID:
- return getComponentCompositeCompartmentPCN_7004SemanticChildren(view);
- }
- return Collections.emptyList();
- }
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getModel_1000SemanticChildren(View view) {
- if(!view.isSetElement()) {
- return Collections.EMPTY_LIST;
- }
- Model modelElement = (Model)view.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedTypes().iterator(); it.hasNext();) {
- Type childElement = (Type)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ComponentEditPart.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- if(visualID == InterfaceEditPart.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- for(Iterator<?> it = modelElement.getPackagedElements().iterator(); it.hasNext();) {
- PackageableElement childElement = (PackageableElement)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PackageEditPart.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPart.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ConstraintEditPart.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getComponent_2002SemanticChildren(View view) {
- if(!view.isSetElement()) {
- return Collections.EMPTY_LIST;
- }
- Component modelElement = (Component)view.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getComponent_3070SemanticChildren(View view) {
- if(!view.isSetElement()) {
- return Collections.EMPTY_LIST;
- }
- Component modelElement = (Component)view.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getComponent_3071SemanticChildren(View view) {
- if(!view.isSetElement()) {
- return Collections.EMPTY_LIST;
- }
- Component modelElement = (Component)view.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getComponentCompositeCompartment_7001SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
- return Collections.emptyList();
- }
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
- return Collections.emptyList();
- }
- Component modelElement = (Component)containerView.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ComponentEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getPackagePackageableElementCompartment_7002SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
- return Collections.emptyList();
- }
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
- return Collections.emptyList();
- }
- Package modelElement = (Package)containerView.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getPackagedElements().iterator(); it.hasNext();) {
- PackageableElement childElement = (PackageableElement)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == InterfaceEditPartPCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- if(visualID == ComponentEditPartPCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartPCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ConstraintEditPartPCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getComponentCompositeCompartmentCN_7003SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
- return Collections.emptyList();
- }
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
- return Collections.emptyList();
- }
- Component modelElement = (Component)containerView.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ComponentEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getComponentCompositeCompartmentPCN_7004SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
- return Collections.emptyList();
- }
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
- return Collections.emptyList();
- }
- Component modelElement = (Component)containerView.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ComponentEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getContainedLinks(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
- case ComponentDiagramEditPart.VISUAL_ID:
- return getModel_1000ContainedLinks(view);
- case ComponentEditPart.VISUAL_ID:
- return getComponent_2002ContainedLinks(view);
- case InterfaceEditPart.VISUAL_ID:
- return getInterface_2003ContainedLinks(view);
- case PackageEditPart.VISUAL_ID:
- return getPackage_3200ContainedLinks(view);
- case CommentEditPart.VISUAL_ID:
- return getComment_3201ContainedLinks(view);
- case ConstraintEditPart.VISUAL_ID:
- return getConstraint_3199ContainedLinks(view);
- case PortEditPart.VISUAL_ID:
- return getPort_3069ContainedLinks(view);
- case ComponentEditPartCN.VISUAL_ID:
- return getComponent_3070ContainedLinks(view);
- case ComponentEditPartPCN.VISUAL_ID:
- return getComponent_3071ContainedLinks(view);
- case InterfaceEditPartPCN.VISUAL_ID:
- return getInterface_3072ContainedLinks(view);
- case CommentEditPartPCN.VISUAL_ID:
- return getComment_3074ContainedLinks(view);
- case ConstraintEditPartPCN.VISUAL_ID:
- return getConstraint_3075ContainedLinks(view);
- case UsageEditPart.VISUAL_ID:
- return getUsage_4001ContainedLinks(view);
- case InterfaceRealizationEditPart.VISUAL_ID:
- return getInterfaceRealization_4006ContainedLinks(view);
- case GeneralizationEditPart.VISUAL_ID:
- return getGeneralization_4003ContainedLinks(view);
- case SubstitutionEditPart.VISUAL_ID:
- return getSubstitution_4012ContainedLinks(view);
- case ManifestationEditPart.VISUAL_ID:
- return getManifestation_4014ContainedLinks(view);
- case ComponentRealizationEditPart.VISUAL_ID:
- return getComponentRealization_4007ContainedLinks(view);
- case AbstractionEditPart.VISUAL_ID:
- return getAbstraction_4013ContainedLinks(view);
- case DependencyEditPart.VISUAL_ID:
- return getDependency_4010ContainedLinks(view);
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getIncomingLinks(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
- case ComponentEditPart.VISUAL_ID:
- return getComponent_2002IncomingLinks(view);
- case InterfaceEditPart.VISUAL_ID:
- return getInterface_2003IncomingLinks(view);
- case PackageEditPart.VISUAL_ID:
- return getPackage_3200IncomingLinks(view);
- case CommentEditPart.VISUAL_ID:
- return getComment_3201IncomingLinks(view);
- case ConstraintEditPart.VISUAL_ID:
- return getConstraint_3199IncomingLinks(view);
- case PortEditPart.VISUAL_ID:
- return getPort_3069IncomingLinks(view);
- case ComponentEditPartCN.VISUAL_ID:
- return getComponent_3070IncomingLinks(view);
- case ComponentEditPartPCN.VISUAL_ID:
- return getComponent_3071IncomingLinks(view);
- case InterfaceEditPartPCN.VISUAL_ID:
- return getInterface_3072IncomingLinks(view);
- case CommentEditPartPCN.VISUAL_ID:
- return getComment_3074IncomingLinks(view);
- case ConstraintEditPartPCN.VISUAL_ID:
- return getConstraint_3075IncomingLinks(view);
- case UsageEditPart.VISUAL_ID:
- return getUsage_4001IncomingLinks(view);
- case InterfaceRealizationEditPart.VISUAL_ID:
- return getInterfaceRealization_4006IncomingLinks(view);
- case GeneralizationEditPart.VISUAL_ID:
- return getGeneralization_4003IncomingLinks(view);
- case SubstitutionEditPart.VISUAL_ID:
- return getSubstitution_4012IncomingLinks(view);
- case ManifestationEditPart.VISUAL_ID:
- return getManifestation_4014IncomingLinks(view);
- case ComponentRealizationEditPart.VISUAL_ID:
- return getComponentRealization_4007IncomingLinks(view);
- case AbstractionEditPart.VISUAL_ID:
- return getAbstraction_4013IncomingLinks(view);
- case DependencyEditPart.VISUAL_ID:
- return getDependency_4010IncomingLinks(view);
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getOutgoingLinks(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
- case ComponentEditPart.VISUAL_ID:
- return getComponent_2002OutgoingLinks(view);
- case InterfaceEditPart.VISUAL_ID:
- return getInterface_2003OutgoingLinks(view);
- case PackageEditPart.VISUAL_ID:
- return getPackage_3200OutgoingLinks(view);
- case CommentEditPart.VISUAL_ID:
- return getComment_3201OutgoingLinks(view);
- case ConstraintEditPart.VISUAL_ID:
- return getConstraint_3199OutgoingLinks(view);
- case PortEditPart.VISUAL_ID:
- return getPort_3069OutgoingLinks(view);
- case ComponentEditPartCN.VISUAL_ID:
- return getComponent_3070OutgoingLinks(view);
- case ComponentEditPartPCN.VISUAL_ID:
- return getComponent_3071OutgoingLinks(view);
- case InterfaceEditPartPCN.VISUAL_ID:
- return getInterface_3072OutgoingLinks(view);
- case CommentEditPartPCN.VISUAL_ID:
- return getComment_3074OutgoingLinks(view);
- case ConstraintEditPartPCN.VISUAL_ID:
- return getConstraint_3075OutgoingLinks(view);
- case UsageEditPart.VISUAL_ID:
- return getUsage_4001OutgoingLinks(view);
- case InterfaceRealizationEditPart.VISUAL_ID:
- return getInterfaceRealization_4006OutgoingLinks(view);
- case GeneralizationEditPart.VISUAL_ID:
- return getGeneralization_4003OutgoingLinks(view);
- case SubstitutionEditPart.VISUAL_ID:
- return getSubstitution_4012OutgoingLinks(view);
- case ManifestationEditPart.VISUAL_ID:
- return getManifestation_4014OutgoingLinks(view);
- case ComponentRealizationEditPart.VISUAL_ID:
- return getComponentRealization_4007OutgoingLinks(view);
- case AbstractionEditPart.VISUAL_ID:
- return getAbstraction_4013OutgoingLinks(view);
- case DependencyEditPart.VISUAL_ID:
- return getDependency_4010OutgoingLinks(view);
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getModel_1000ContainedLinks(View view) {
- Model modelElement = (Model)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComponent_2002ContainedLinks(View view) {
- Component modelElement = (Component)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Generalization_4003(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getInterface_2003ContainedLinks(View view) {
- Interface modelElement = (Interface)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Generalization_4003(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getPackage_3200ContainedLinks(View view) {
- Package modelElement = (Package)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComment_3201ContainedLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getConstraint_3199ContainedLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getPort_3069ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComponent_3070ContainedLinks(View view) {
- Component modelElement = (Component)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Generalization_4003(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComponent_3071ContainedLinks(View view) {
- Component modelElement = (Component)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Generalization_4003(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getInterface_3072ContainedLinks(View view) {
- Interface modelElement = (Interface)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Generalization_4003(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComment_3074ContainedLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getConstraint_3075ContainedLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getUsage_4001ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getInterfaceRealization_4006ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getGeneralization_4003ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getSubstitution_4012ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getManifestation_4014ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComponentRealization_4007ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getAbstraction_4013ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getDependency_4010ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComponent_2002IncomingLinks(View view) {
- Component modelElement = (Component)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Generalization_4003(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getInterface_2003IncomingLinks(View view) {
- Interface modelElement = (Interface)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Generalization_4003(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getPackage_3200IncomingLinks(View view) {
- Package modelElement = (Package)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComment_3201IncomingLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getConstraint_3199IncomingLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getPort_3069IncomingLinks(View view) {
- Port modelElement = (Port)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComponent_3070IncomingLinks(View view) {
- Component modelElement = (Component)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Generalization_4003(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComponent_3071IncomingLinks(View view) {
- Component modelElement = (Component)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Generalization_4003(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getInterface_3072IncomingLinks(View view) {
- Interface modelElement = (Interface)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Generalization_4003(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComment_3074IncomingLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getConstraint_3075IncomingLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getUsage_4001IncomingLinks(View view) {
- Usage modelElement = (Usage)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getInterfaceRealization_4006IncomingLinks(View view) {
- InterfaceRealization modelElement = (InterfaceRealization)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getGeneralization_4003IncomingLinks(View view) {
- Generalization modelElement = (Generalization)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getSubstitution_4012IncomingLinks(View view) {
- Substitution modelElement = (Substitution)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getManifestation_4014IncomingLinks(View view) {
- Manifestation modelElement = (Manifestation)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComponentRealization_4007IncomingLinks(View view) {
- ComponentRealization modelElement = (ComponentRealization)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getAbstraction_4013IncomingLinks(View view) {
- Abstraction modelElement = (Abstraction)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getDependency_4010IncomingLinks(View view) {
- Dependency modelElement = (Dependency)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Usage_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_InterfaceRealization_4006(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Substitution_4012(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4014(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_ComponentRealization_4007(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Abstraction_4013(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4010(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComponent_2002OutgoingLinks(View view) {
- Component modelElement = (Component)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4003(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getInterface_2003OutgoingLinks(View view) {
- Interface modelElement = (Interface)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4003(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getPackage_3200OutgoingLinks(View view) {
- Package modelElement = (Package)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComment_3201OutgoingLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getConstraint_3199OutgoingLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getPort_3069OutgoingLinks(View view) {
- Port modelElement = (Port)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComponent_3070OutgoingLinks(View view) {
- Component modelElement = (Component)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4003(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComponent_3071OutgoingLinks(View view) {
- Component modelElement = (Component)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4003(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getInterface_3072OutgoingLinks(View view) {
- Interface modelElement = (Interface)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4003(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComment_3074OutgoingLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getConstraint_3075OutgoingLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getUsage_4001OutgoingLinks(View view) {
- Usage modelElement = (Usage)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getInterfaceRealization_4006OutgoingLinks(View view) {
- InterfaceRealization modelElement = (InterfaceRealization)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getGeneralization_4003OutgoingLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getSubstitution_4012OutgoingLinks(View view) {
- Substitution modelElement = (Substitution)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getManifestation_4014OutgoingLinks(View view) {
- Manifestation modelElement = (Manifestation)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComponentRealization_4007OutgoingLinks(View view) {
- ComponentRealization modelElement = (ComponentRealization)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getAbstraction_4013OutgoingLinks(View view) {
- Abstraction modelElement = (Abstraction)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getDependency_4010OutgoingLinks(View view) {
- Dependency modelElement = (Dependency)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Usage_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Substitution_4012(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4014(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4007(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Abstraction_4013(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4010(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Usage_4001(Package container) {
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Usage) {
- continue;
- }
- Usage link = (Usage)linkObject;
- if(UsageEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Usage_4001, UsageEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_InterfaceRealization_4006(Package container) {
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof InterfaceRealization) {
- continue;
- }
- InterfaceRealization link = (InterfaceRealization)linkObject;
- if(InterfaceRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.InterfaceRealization_4006, InterfaceRealizationEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Generalization_4003(Classifier container) {
- Collection result = new LinkedList();
- for(Iterator links = container.getGeneralizations().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Generalization) {
- continue;
- }
- Generalization link = (Generalization)linkObject;
- if(GeneralizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- Classifier dst = link.getGeneral();
- Classifier src = link.getSpecific();
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Generalization_4003, GeneralizationEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Substitution_4012(Package container) {
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Substitution) {
- continue;
- }
- Substitution link = (Substitution)linkObject;
- if(SubstitutionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Substitution_4012, SubstitutionEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Manifestation_4014(Package container) {
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Manifestation) {
- continue;
- }
- Manifestation link = (Manifestation)linkObject;
- if(ManifestationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Manifestation_4014, ManifestationEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_ComponentRealization_4007(Package container) {
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof ComponentRealization) {
- continue;
- }
- ComponentRealization link = (ComponentRealization)linkObject;
- if(ComponentRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.ComponentRealization_4007, ComponentRealizationEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Abstraction_4013(Package container) {
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Abstraction) {
- continue;
- }
- Abstraction link = (Abstraction)linkObject;
- if(AbstractionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Abstraction_4013, AbstractionEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Dependency_4010(Package container) {
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Dependency) {
- continue;
- }
- Dependency link = (Dependency)linkObject;
- if(DependencyEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Dependency_4010, DependencyEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Usage_4001(NamedElement target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Usage) {
- continue;
- }
- Usage link = (Usage)setting.getEObject();
- if(UsageEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Usage_4001, UsageEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_InterfaceRealization_4006(NamedElement target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof InterfaceRealization) {
- continue;
- }
- InterfaceRealization link = (InterfaceRealization)setting.getEObject();
- if(InterfaceRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.InterfaceRealization_4006, InterfaceRealizationEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Generalization_4003(Classifier target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getGeneralization_General() || false == setting.getEObject() instanceof Generalization) {
- continue;
- }
- Generalization link = (Generalization)setting.getEObject();
- if(GeneralizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
- Classifier src = link.getSpecific();
- result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Generalization_4003, GeneralizationEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Substitution_4012(NamedElement target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Substitution) {
- continue;
- }
- Substitution link = (Substitution)setting.getEObject();
- if(SubstitutionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Substitution_4012, SubstitutionEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Manifestation_4014(NamedElement target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Manifestation) {
- continue;
- }
- Manifestation link = (Manifestation)setting.getEObject();
- if(ManifestationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Manifestation_4014, ManifestationEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_ComponentRealization_4007(NamedElement target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof ComponentRealization) {
- continue;
- }
- ComponentRealization link = (ComponentRealization)setting.getEObject();
- if(ComponentRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.ComponentRealization_4007, ComponentRealizationEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Abstraction_4013(NamedElement target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Abstraction) {
- continue;
- }
- Abstraction link = (Abstraction)setting.getEObject();
- if(AbstractionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Abstraction_4013, AbstractionEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(Element target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getComment_AnnotatedElement()) {
- result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.CommentAnnotatedElement_4015, CommentAnnotatedElementEditPart.VISUAL_ID));
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(Element target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getConstraint_ConstrainedElement()) {
- result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.ConstraintConstrainedElement_4009, ConstraintConstrainedElementEditPart.VISUAL_ID));
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Dependency_4010(NamedElement target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Dependency) {
- continue;
- }
- Dependency link = (Dependency)setting.getEObject();
- if(DependencyEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Dependency_4010, DependencyEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_Usage_4001(NamedElement source) {
- Package container = null;
- // Find container element for the link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
- }
- }
- if(container == null) {
- return Collections.emptyList();
- }
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Usage) {
- continue;
- }
- Usage link = (Usage)linkObject;
- if(UsageEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
- continue;
- }
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Usage_4001, UsageEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_InterfaceRealization_4006(NamedElement source) {
- Package container = null;
- // Find container element for the link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
- }
- }
- if(container == null) {
- return Collections.emptyList();
- }
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof InterfaceRealization) {
- continue;
- }
- InterfaceRealization link = (InterfaceRealization)linkObject;
- if(InterfaceRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
- continue;
- }
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.InterfaceRealization_4006, InterfaceRealizationEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_Generalization_4003(Classifier source) {
- Classifier container = null;
- // Find container element for the link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Classifier) {
- container = (Classifier)element;
- }
- }
- if(container == null) {
- return Collections.emptyList();
- }
- Collection result = new LinkedList();
- for(Iterator links = container.getGeneralizations().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Generalization) {
- continue;
- }
- Generalization link = (Generalization)linkObject;
- if(GeneralizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- Classifier dst = link.getGeneral();
- Classifier src = link.getSpecific();
- if(src != source) {
- continue;
- }
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Generalization_4003, GeneralizationEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_Substitution_4012(NamedElement source) {
- Package container = null;
- // Find container element for the link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
- }
- }
- if(container == null) {
- return Collections.emptyList();
- }
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Substitution) {
- continue;
- }
- Substitution link = (Substitution)linkObject;
- if(SubstitutionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
- continue;
- }
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Substitution_4012, SubstitutionEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_Manifestation_4014(NamedElement source) {
- Package container = null;
- // Find container element for the link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
- }
- }
- if(container == null) {
- return Collections.emptyList();
- }
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Manifestation) {
- continue;
- }
- Manifestation link = (Manifestation)linkObject;
- if(ManifestationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
- continue;
- }
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Manifestation_4014, ManifestationEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_ComponentRealization_4007(NamedElement source) {
- Package container = null;
- // Find container element for the link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
- }
- }
- if(container == null) {
- return Collections.emptyList();
- }
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof ComponentRealization) {
- continue;
- }
- ComponentRealization link = (ComponentRealization)linkObject;
- if(ComponentRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
- continue;
- }
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.ComponentRealization_4007, ComponentRealizationEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_Abstraction_4013(NamedElement source) {
- Package container = null;
- // Find container element for the link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
- }
- }
- if(container == null) {
- return Collections.emptyList();
- }
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Abstraction) {
- continue;
- }
- Abstraction link = (Abstraction)linkObject;
- if(AbstractionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
- continue;
- }
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Abstraction_4013, AbstractionEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_4015(Comment source) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> destinations = source.getAnnotatedElements().iterator(); destinations.hasNext();) {
- Element destination = (Element)destinations.next();
- result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.CommentAnnotatedElement_4015, CommentAnnotatedElementEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(Constraint source) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> destinations = source.getConstrainedElements().iterator(); destinations.hasNext();) {
- Element destination = (Element)destinations.next();
- result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.ConstraintConstrainedElement_4009, ConstraintConstrainedElementEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_Dependency_4010(NamedElement source) {
- Package container = null;
- // Find container element for the link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
- }
- }
- if(container == null) {
- return Collections.emptyList();
- }
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Dependency) {
- continue;
- }
- Dependency link = (Dependency)linkObject;
- if(DependencyEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
- continue;
- }
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Dependency_4010, DependencyEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDocumentProvider.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDocumentProvider.java
deleted file mode 100644
index 3013dc897d1..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLDocumentProvider.java
+++ /dev/null
@@ -1,974 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.MultiRule;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EContentAdapter;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.transaction.NotificationFilter;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.DiagramDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocumentProvider;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.EditorStatusCodes;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.util.DiagramIOUtil;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.part.FileEditorInput;
-
-/**
- * @generated
- */
-public class UMLDocumentProvider extends AbstractDocumentProvider implements IDiagramDocumentProvider {
-
- /**
- * @generated
- */
- protected ElementInfo createElementInfo(Object element) throws CoreException {
- if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- IEditorInput editorInput = (IEditorInput)element;
- IDiagramDocument document = (IDiagramDocument)createDocument(editorInput);
-
- ResourceSetInfo info = new ResourceSetInfo(document, editorInput);
- info.setModificationStamp(computeModificationStamp(info));
- info.fStatus = null;
- return info;
- }
-
- /**
- * @generated
- */
- protected IDocument createDocument(Object element) throws CoreException {
- if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- IDocument document = createEmptyDocument();
- setDocumentContent(document, (IEditorInput)element);
- setupDocument(element, document);
- return document;
- }
-
- /**
- * Sets up the given document as it would be provided for the given element. The
- * content of the document is not changed. This default implementation is empty.
- * Subclasses may reimplement.
- *
- * @param element the blue-print element
- * @param document the document to set up
- * @generated
- */
- protected void setupDocument(Object element, IDocument document) {
- // for subclasses
- }
-
- /**
- * @generated
- */
- private long computeModificationStamp(ResourceSetInfo info) {
- int result = 0;
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- if(file.getLocation() != null) {
- result += file.getLocation().toFile().lastModified();
- } else {
- result += file.getModificationStamp();
- }
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected IDocument createEmptyDocument() {
- DiagramDocument document = new DiagramDocument();
- document.setEditingDomain(createEditingDomain());
- return document;
- }
-
- /**
- * @generated
- */
- private TransactionalEditingDomain createEditingDomain() {
- TransactionalEditingDomain editingDomain = DiagramEditingDomainFactory.getInstance().createEditingDomain();
- editingDomain.setID("org.eclipse.papyrus.diagram.component.EditingDomain"); //$NON-NLS-1$
- final NotificationFilter diagramResourceModifiedFilter = NotificationFilter.createNotifierFilter(editingDomain.getResourceSet()).and(NotificationFilter.createEventTypeFilter(Notification.ADD)).and(NotificationFilter.createFeatureFilter(ResourceSet.class, ResourceSet.RESOURCE_SET__RESOURCES));
- editingDomain.getResourceSet().eAdapters().add(new Adapter() {
-
- private Notifier myTarger;
-
- public Notifier getTarget() {
- return myTarger;
- }
-
- public boolean isAdapterForType(Object type) {
- return false;
- }
-
- public void notifyChanged(Notification notification) {
- if(diagramResourceModifiedFilter.matches(notification)) {
- Object value = notification.getNewValue();
- if(value instanceof Resource) {
- ((Resource)value).setTrackingModification(true);
- }
- }
- }
-
- public void setTarget(Notifier newTarget) {
- myTarger = newTarget;
- }
-
- });
-
- return editingDomain;
- }
-
- /**
- * @generated
- */
- protected void setDocumentContent(IDocument document, IEditorInput element) throws CoreException {
- IDiagramDocument diagramDocument = (IDiagramDocument)document;
- TransactionalEditingDomain domain = diagramDocument.getEditingDomain();
- if(element instanceof FileEditorInput) {
- IStorage storage = ((FileEditorInput)element).getStorage();
- Diagram diagram = DiagramIOUtil.load(domain, storage, true, getProgressMonitor());
- document.setContent(diagram);
- } else if(element instanceof URIEditorInput) {
- URI uri = ((URIEditorInput)element).getURI();
- Resource resource = null;
- try {
- resource = domain.getResourceSet().getResource(uri.trimFragment(), false);
- if(resource == null) {
- resource = domain.getResourceSet().createResource(uri.trimFragment());
- }
- if(!resource.isLoaded()) {
- try {
- Map options = new HashMap(GMFResourceFactory.getDefaultLoadOptions());
- // @see 171060
- // options.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
- resource.load(options);
- } catch (IOException e) {
- resource.unload();
- throw e;
- }
- }
- if(uri.fragment() != null) {
- EObject rootElement = resource.getEObject(uri.fragment());
- if(rootElement instanceof Diagram) {
- document.setContent((Diagram)rootElement);
- return;
- }
- } else {
- for(Iterator it = resource.getContents().iterator(); it.hasNext();) {
- Object rootElement = it.next();
- if(rootElement instanceof Diagram) {
- document.setContent((Diagram)rootElement);
- return;
- }
- }
- }
- throw new RuntimeException(Messages.UMLDocumentProvider_NoDiagramInResourceError);
- } catch (Exception e) {
- CoreException thrownExcp = null;
- if(e instanceof CoreException) {
- thrownExcp = (CoreException)e;
- } else {
- String msg = e.getLocalizedMessage();
- thrownExcp = new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, msg != null ? msg : Messages.UMLDocumentProvider_DiagramLoadingError, e));
- }
- throw thrownExcp;
- }
- } else {
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- }
-
- /**
- * @generated
- */
- public long getModificationStamp(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- return computeModificationStamp(info);
- }
- return super.getModificationStamp(element);
- }
-
- /**
- * @generated
- */
- public boolean isDeleted(Object element) {
- IDiagramDocument document = getDiagramDocument(element);
- if(document != null) {
- Resource diagramResource = document.getDiagram().eResource();
- if(diagramResource != null) {
- IFile file = WorkspaceSynchronizer.getFile(diagramResource);
- return file == null || file.getLocation() == null || !file.getLocation().toFile().exists();
- }
- }
- return super.isDeleted(element);
- }
-
- /**
- * @generated
- */
- public ResourceSetInfo getResourceSetInfo(Object editorInput) {
- return (ResourceSetInfo)super.getElementInfo(editorInput);
- }
-
- /**
- * @generated
- */
- protected void disposeElementInfo(Object element, ElementInfo info) {
- if(info instanceof ResourceSetInfo) {
- ResourceSetInfo resourceSetInfo = (ResourceSetInfo)info;
- resourceSetInfo.dispose();
- }
- super.disposeElementInfo(element, info);
- }
-
- /**
- * @generated
- */
- protected void doValidateState(Object element, Object computationContext) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- LinkedList<IFile> files2Validate = new LinkedList<IFile>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null && file.isReadOnly()) {
- files2Validate.add(file);
- }
- }
- ResourcesPlugin.getWorkspace().validateEdit((IFile[])files2Validate.toArray(new IFile[files2Validate.size()]), computationContext);
- }
-
- super.doValidateState(element, computationContext);
- }
-
- /**
- * @generated
- */
- public boolean isReadOnly(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(info.isUpdateCache()) {
- try {
- updateCache(element);
- } catch (CoreException ex) {
- UMLDiagramEditorPlugin.getInstance().logError(Messages.UMLDocumentProvider_isModifiable, ex);
- // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.StorageDocumentProvider_isModifiable
- }
- }
- return info.isReadOnly();
- }
- return super.isReadOnly(element);
- }
-
- /**
- * @generated
- */
- public boolean isModifiable(Object element) {
- if(!isStateValidated(element)) {
- if(element instanceof FileEditorInput || element instanceof URIEditorInput) {
- return true;
- }
- }
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(info.isUpdateCache()) {
- try {
- updateCache(element);
- } catch (CoreException ex) {
- UMLDiagramEditorPlugin.getInstance().logError(Messages.UMLDocumentProvider_isModifiable, ex);
- // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.StorageDocumentProvider_isModifiable
- }
- }
- return info.isModifiable();
- }
- return super.isModifiable(element);
- }
-
- /**
- * @generated
- */
- protected void updateCache(Object element) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null && file.isReadOnly()) {
- info.setReadOnly(true);
- info.setModifiable(false);
- return;
- }
- }
- info.setReadOnly(false);
- info.setModifiable(true);
- return;
- }
- }
-
- /**
- * @generated
- */
- protected void doUpdateStateCache(Object element) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- info.setUpdateCache(true);
- }
- super.doUpdateStateCache(element);
- }
-
- /**
- * @generated
- */
- public boolean isSynchronized(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- return info.isSynchronized();
- }
- return super.isSynchronized(element);
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getResetRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(file));
- }
- }
- return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getSaveRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- rules.add(computeSchedulingRule(file));
- }
- }
- return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getSynchronizeRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().refreshRule(file));
- }
- }
- return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getValidateStateRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- LinkedList<ISchedulingRule> files = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- files.add(file);
- }
- }
- return ResourcesPlugin.getWorkspace().getRuleFactory().validateEditRule((IFile[])files.toArray(new IFile[files.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- private ISchedulingRule computeSchedulingRule(IResource toCreateOrModify) {
- if(toCreateOrModify.exists())
- return ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(toCreateOrModify);
-
- IResource parent = toCreateOrModify;
- do {
- /*
- * XXX This is a workaround for
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=67601
- * IResourceRuleFactory.createRule should iterate the hierarchy
- * itself.
- */
- toCreateOrModify = parent;
- parent = toCreateOrModify.getParent();
- } while(parent != null && !parent.exists());
-
- return ResourcesPlugin.getWorkspace().getRuleFactory().createRule(toCreateOrModify);
- }
-
- /**
- * @generated
- */
- protected void doSynchronize(Object element, IProgressMonitor monitor) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- handleElementChanged(info, nextResource, monitor);
- }
- return;
- }
- super.doSynchronize(element, monitor);
- }
-
- /**
- * @generated
- */
- protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(!overwrite && !info.isSynchronized()) {
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, IResourceStatus.OUT_OF_SYNC_LOCAL, Messages.UMLDocumentProvider_UnsynchronizedFileSaveError, null));
- }
- info.stopResourceListening();
- fireElementStateChanging(element);
- try {
- monitor.beginTask(Messages.UMLDocumentProvider_SaveDiagramTask, info.getResourceSet().getResources().size() + 1); //"Saving diagram"
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- monitor.setTaskName(NLS.bind(Messages.UMLDocumentProvider_SaveNextResourceTask, nextResource.getURI()));
- if(nextResource.isLoaded() && !info.getEditingDomain().isReadOnly(nextResource)) {
- try {
- nextResource.save(UMLDiagramEditorUtil.getSaveOptions());
- } catch (IOException e) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, EditorStatusCodes.RESOURCE_FAILURE, e.getLocalizedMessage(), null));
- }
- }
- monitor.worked(1);
- }
- monitor.done();
- info.setModificationStamp(computeModificationStamp(info));
- } catch (RuntimeException x) {
- fireElementStateChangeFailed(element);
- throw x;
- } finally {
- info.startResourceListening();
- }
- } else {
- URI newResoruceURI;
- List<IFile> affectedFiles = null;
- if(element instanceof FileEditorInput) {
- IFile newFile = ((FileEditorInput)element).getFile();
- affectedFiles = Collections.singletonList(newFile);
- newResoruceURI = URI.createPlatformResourceURI(newFile.getFullPath().toString(), true);
- } else if(element instanceof URIEditorInput) {
- newResoruceURI = ((URIEditorInput)element).getURI();
- } else {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- if(false == document instanceof IDiagramDocument) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, "Incorrect document used: " + document + " instead of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument", null)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- IDiagramDocument diagramDocument = (IDiagramDocument)document;
- final Resource newResource = diagramDocument.getEditingDomain().getResourceSet().createResource(newResoruceURI);
- final Diagram diagramCopy = (Diagram)EcoreUtil.copy(diagramDocument.getDiagram());
- try {
- new AbstractTransactionalCommand(diagramDocument.getEditingDomain(), NLS.bind(Messages.UMLDocumentProvider_SaveAsOperation, diagramCopy.getName()), affectedFiles) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- newResource.getContents().add(diagramCopy);
- return CommandResult.newOKCommandResult();
- }
- }.execute(monitor, null);
- newResource.save(UMLDiagramEditorUtil.getSaveOptions());
- } catch (ExecutionException e) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, e.getLocalizedMessage(), null));
- } catch (IOException e) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, e.getLocalizedMessage(), null));
- }
- newResource.unload();
- }
- }
-
- /**
- * @generated
- */
- protected void handleElementChanged(ResourceSetInfo info, Resource changedResource, IProgressMonitor monitor) {
- IFile file = WorkspaceSynchronizer.getFile(changedResource);
- if(file != null) {
- try {
- file.refreshLocal(IResource.DEPTH_INFINITE, monitor);
- } catch (CoreException ex) {
- UMLDiagramEditorPlugin.getInstance().logError(Messages.UMLDocumentProvider_handleElementContentChanged, ex);
- // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.FileDocumentProvider_handleElementContentChanged
- }
- }
- changedResource.unload();
-
- fireElementContentAboutToBeReplaced(info.getEditorInput());
- removeUnchangedElementListeners(info.getEditorInput(), info);
- info.fStatus = null;
- try {
- setDocumentContent(info.fDocument, info.getEditorInput());
- } catch (CoreException e) {
- info.fStatus = e.getStatus();
- }
- if(!info.fCanBeSaved) {
- info.setModificationStamp(computeModificationStamp(info));
- }
- addUnchangedElementListeners(info.getEditorInput(), info);
- fireElementContentReplaced(info.getEditorInput());
- }
-
- /**
- * @generated
- */
- protected void handleElementMoved(IEditorInput input, URI uri) {
- if(input instanceof FileEditorInput) {
- IFile newFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(URI.decode(uri.path())).removeFirstSegments(1));
- fireElementMoved(input, newFile == null ? null : new FileEditorInput(newFile));
- return;
- }
- // TODO: append suffix to the URI! (use diagram as a parameter)
- fireElementMoved(input, new URIEditorInput(uri));
- }
-
- /**
- * @generated
- */
- public IEditorInput createInputWithEditingDomain(IEditorInput editorInput, TransactionalEditingDomain domain) {
- return editorInput;
- }
-
- /**
- * @generated
- */
- public IDiagramDocument getDiagramDocument(Object element) {
- IDocument doc = getDocument(element);
- if(doc instanceof IDiagramDocument) {
- return (IDiagramDocument)doc;
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
- return null;
- }
-
- /**
- * @generated
- */
- protected class ResourceSetInfo extends ElementInfo {
-
- /**
- * @generated
- */
- private long myModificationStamp = IResource.NULL_STAMP;
-
- /**
- * @generated
- */
- private WorkspaceSynchronizer mySynchronizer;
-
- /**
- * @generated
- */
- private LinkedList<Resource> myUnSynchronizedResources = new LinkedList<Resource>();
-
- /**
- * @generated
- */
- private IDiagramDocument myDocument;
-
- /**
- * @generated
- */
- private IEditorInput myEditorInput;
-
- /**
- * @generated
- */
- private boolean myUpdateCache = true;
-
- /**
- * @generated
- */
- private boolean myModifiable = false;
-
- /**
- * @generated
- */
- private boolean myReadOnly = true;
-
- /**
- * @generated
- */
- private ResourceSetModificationListener myResourceSetListener;
-
- /**
- * @generated
- */
- public ResourceSetInfo(IDiagramDocument document, IEditorInput editorInput) {
- super(document);
- myDocument = document;
- myEditorInput = editorInput;
- startResourceListening();
- myResourceSetListener = new ResourceSetModificationListener(this);
- getResourceSet().eAdapters().add(myResourceSetListener);
- }
-
- /**
- * @generated
- */
- public long getModificationStamp() {
- return myModificationStamp;
- }
-
- /**
- * @generated
- */
- public void setModificationStamp(long modificationStamp) {
- myModificationStamp = modificationStamp;
- }
-
- /**
- * @generated
- */
- public TransactionalEditingDomain getEditingDomain() {
- return myDocument.getEditingDomain();
- }
-
- /**
- * @generated
- */
- public ResourceSet getResourceSet() {
- return getEditingDomain().getResourceSet();
- }
-
- /**
- * @generated
- */
- public Iterator<Resource> getLoadedResourcesIterator() {
- return new ArrayList<Resource>(getResourceSet().getResources()).iterator();
- }
-
- /**
- * @generated
- */
- public IEditorInput getEditorInput() {
- return myEditorInput;
- }
-
- /**
- * @generated
- */
- public void dispose() {
- stopResourceListening();
- getResourceSet().eAdapters().remove(myResourceSetListener);
- for(Iterator<Resource> it = getLoadedResourcesIterator(); it.hasNext();) {
- Resource resource = it.next();
- resource.unload();
- }
- getEditingDomain().dispose();
- }
-
- /**
- * @generated
- */
- public boolean isSynchronized() {
- return myUnSynchronizedResources.size() == 0;
- }
-
- /**
- * @generated
- */
- public void setUnSynchronized(Resource resource) {
- myUnSynchronizedResources.add(resource);
- }
-
- /**
- * @generated
- */
- public void setSynchronized(Resource resource) {
- myUnSynchronizedResources.remove(resource);
- }
-
- /**
- * @generated
- */
- public final void stopResourceListening() {
- mySynchronizer.dispose();
- mySynchronizer = null;
- }
-
- /**
- * @generated
- */
- public final void startResourceListening() {
- mySynchronizer = new WorkspaceSynchronizer(getEditingDomain(), new SynchronizerDelegate());
- }
-
- /**
- * @generated
- */
- public boolean isUpdateCache() {
- return myUpdateCache;
- }
-
- /**
- * @generated
- */
- public void setUpdateCache(boolean update) {
- myUpdateCache = update;
- }
-
- /**
- * @generated
- */
- public boolean isModifiable() {
- return myModifiable;
- }
-
- /**
- * @generated
- */
- public void setModifiable(boolean modifiable) {
- myModifiable = modifiable;
- }
-
- /**
- * @generated
- */
- public boolean isReadOnly() {
- return myReadOnly;
- }
-
- /**
- * @generated
- */
- public void setReadOnly(boolean readOnly) {
- myReadOnly = readOnly;
- }
-
- /**
- * @generated
- */
- private class SynchronizerDelegate implements WorkspaceSynchronizer.Delegate {
-
- /**
- * @generated
- */
- public void dispose() {
- }
-
- /**
- * @generated
- */
- public boolean handleResourceChanged(final Resource resource) {
- synchronized(ResourceSetInfo.this) {
- if(ResourceSetInfo.this.fCanBeSaved) {
- ResourceSetInfo.this.setUnSynchronized(resource);
- return true;
- }
- }
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- handleElementChanged(ResourceSetInfo.this, resource, null);
- }
- });
- return true;
- }
-
- /**
- * @generated
- */
- public boolean handleResourceDeleted(Resource resource) {
- synchronized(ResourceSetInfo.this) {
- if(ResourceSetInfo.this.fCanBeSaved) {
- ResourceSetInfo.this.setUnSynchronized(resource);
- return true;
- }
- }
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- fireElementDeleted(ResourceSetInfo.this.getEditorInput());
- }
- });
- return true;
- }
-
- /**
- * @generated
- */
- public boolean handleResourceMoved(Resource resource, final URI newURI) {
- synchronized(ResourceSetInfo.this) {
- if(ResourceSetInfo.this.fCanBeSaved) {
- ResourceSetInfo.this.setUnSynchronized(resource);
- return true;
- }
- }
- if(myDocument.getDiagram().eResource() == resource) {
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- handleElementMoved(ResourceSetInfo.this.getEditorInput(), newURI);
- }
- });
- } else {
- handleResourceDeleted(resource);
- }
- return true;
- }
-
- }
-
- }
-
- /**
- * @generated
- */
- private class ResourceSetModificationListener extends EContentAdapter {
-
- /**
- * @generated
- */
- private NotificationFilter myModifiedFilter;
-
- /**
- * @generated
- */
- private ResourceSetInfo myInfo;
-
- /**
- * @generated
- */
- public ResourceSetModificationListener(ResourceSetInfo info) {
- myInfo = info;
- myModifiedFilter = NotificationFilter.createEventTypeFilter(Notification.SET).or(NotificationFilter.createEventTypeFilter(Notification.UNSET)).and(NotificationFilter.createFeatureFilter(Resource.class, Resource.RESOURCE__IS_MODIFIED));
- }
-
- /**
- * @generated
- */
- public void notifyChanged(Notification notification) {
- if(notification.getNotifier() instanceof ResourceSet) {
- super.notifyChanged(notification);
- }
- if(!notification.isTouch() && myModifiedFilter.matches(notification)) {
- if(notification.getNotifier() instanceof Resource) {
- Resource resource = (Resource)notification.getNotifier();
- if(resource.isLoaded()) {
- boolean modified = false;
- for(Iterator/*<org.eclipse.emf.ecore.resource.Resource>*/it = myInfo.getLoadedResourcesIterator(); it.hasNext() && !modified;) {
- Resource nextResource = (Resource)it.next();
- if(nextResource.isLoaded()) {
- modified = nextResource.isModified();
- }
- }
- boolean dirtyStateChanged = false;
- synchronized(myInfo) {
- if(modified != myInfo.fCanBeSaved) {
- myInfo.fCanBeSaved = modified;
- dirtyStateChanged = true;
- }
- if(!resource.isModified()) {
- myInfo.setSynchronized(resource);
- }
- }
- if(dirtyStateChanged) {
- fireElementDirtyStateChanged(myInfo.getEditorInput(), modified);
-
- if(!modified) {
- myInfo.setModificationStamp(computeModificationStamp(myInfo));
- }
- }
- }
- }
- }
- }
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLInitDiagramFileAction.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLInitDiagramFileAction.java
deleted file mode 100644
index 11ca8de3e8a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLInitDiagramFileAction.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.common.util.WrappedException;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @generated
- */
-public class UMLInitDiagramFileAction implements IObjectActionDelegate {
-
- /**
- * @generated
- */
- private IWorkbenchPart targetPart;
-
- /**
- * @generated
- */
- private URI domainModelURI;
-
- /**
- * @generated
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.targetPart = targetPart;
- }
-
- /**
- * @generated
- */
- public void selectionChanged(IAction action, ISelection selection) {
- domainModelURI = null;
- action.setEnabled(false);
- if(selection instanceof IStructuredSelection == false || selection.isEmpty()) {
- return;
- }
- IFile file = (IFile)((IStructuredSelection)selection).getFirstElement();
- domainModelURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
- action.setEnabled(true);
- }
-
- /**
- * @generated
- */
- private Shell getShell() {
- return targetPart.getSite().getShell();
- }
-
- /**
- * @generated
- */
- public void run(IAction action) {
- TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
- ResourceSet resourceSet = editingDomain.getResourceSet();
- EObject diagramRoot = null;
- try {
- Resource resource = resourceSet.getResource(domainModelURI, true);
- diagramRoot = (EObject)resource.getContents().get(0);
- } catch (WrappedException ex) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to load resource: " + domainModelURI, ex); //$NON-NLS-1$
- }
- if(diagramRoot == null) {
- MessageDialog.openError(getShell(), Messages.InitDiagramFile_ResourceErrorDialogTitle, Messages.InitDiagramFile_ResourceErrorDialogMessage);
- return;
- }
- Wizard wizard = new UMLNewDiagramFileWizard(domainModelURI, diagramRoot, editingDomain);
- wizard.setWindowTitle(NLS.bind(Messages.InitDiagramFile_WizardTitle, ComponentDiagramEditPart.MODEL_ID));
- UMLDiagramEditorUtil.runWizard(getShell(), wizard, "InitDiagramFile"); //$NON-NLS-1$
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLLinkDescriptor.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLLinkDescriptor.java
deleted file mode 100644
index 7b99f929e1e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLLinkDescriptor.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-
-/**
- * @generated
- */
-public class UMLLinkDescriptor extends UMLNodeDescriptor {
-
- /**
- * @generated
- */
- private EObject mySource;
-
- /**
- * @generated
- */
- private EObject myDestination;
-
- /**
- * @generated
- */
- private IAdaptable mySemanticAdapter;
-
- /**
- * @generated
- */
- private UMLLinkDescriptor(EObject source, EObject destination, EObject linkElement, int linkVID) {
- super(linkElement, linkVID);
- mySource = source;
- myDestination = destination;
- }
-
- /**
- * @generated
- */
- public UMLLinkDescriptor(EObject source, EObject destination, IElementType elementType, int linkVID) {
- this(source, destination, (EObject)null, linkVID);
- final IElementType elementTypeCopy = elementType;
- mySemanticAdapter = new IAdaptable() {
-
- public Object getAdapter(Class adapter) {
- if(IElementType.class.equals(adapter)) {
- return elementTypeCopy;
- }
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public UMLLinkDescriptor(EObject source, EObject destination, EObject linkElement, IElementType elementType, int linkVID) {
- this(source, destination, linkElement, linkVID);
- final IElementType elementTypeCopy = elementType;
- mySemanticAdapter = new EObjectAdapter(linkElement) {
-
- public Object getAdapter(Class adapter) {
- if(IElementType.class.equals(adapter)) {
- return elementTypeCopy;
- }
- return super.getAdapter(adapter);
- }
- };
- }
-
- /**
- * @generated
- */
- public EObject getSource() {
- return mySource;
- }
-
- /**
- * @generated
- */
- public EObject getDestination() {
- return myDestination;
- }
-
- /**
- * @generated
- */
- public IAdaptable getSemanticAdapter() {
- return mySemanticAdapter;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLMatchingStrategy.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLMatchingStrategy.java
deleted file mode 100644
index 240ace713dd..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLMatchingStrategy.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorMatchingStrategy;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.PartInitException;
-
-/**
- * @generated
- */
-public class UMLMatchingStrategy implements IEditorMatchingStrategy {
-
- /**
- * @generated
- */
- public boolean matches(IEditorReference editorRef, IEditorInput input) {
- IEditorInput editorInput;
- try {
- editorInput = editorRef.getEditorInput();
- } catch (PartInitException e) {
- return false;
- }
-
- if(editorInput.equals(input)) {
- return true;
- }
- if(editorInput instanceof URIEditorInput && input instanceof URIEditorInput) {
- return ((URIEditorInput)editorInput).getURI().equals(((URIEditorInput)input).getURI());
- }
- return false;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLNewDiagramFileWizard.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLNewDiagramFileWizard.java
deleted file mode 100644
index 54acb4520d5..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLNewDiagramFileWizard.java
+++ /dev/null
@@ -1,161 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import java.io.IOException;
-import java.util.LinkedList;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.OperationHistoryFactory;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-
-/**
- * @generated
- */
-public class UMLNewDiagramFileWizard extends Wizard {
-
- /**
- * @generated
- */
- private WizardNewFileCreationPage myFileCreationPage;
-
- /**
- * @generated
- */
- private ModelElementSelectionPage diagramRootElementSelectionPage;
-
- /**
- * @generated
- */
- private TransactionalEditingDomain myEditingDomain;
-
- /**
- * @generated
- */
- public UMLNewDiagramFileWizard(URI domainModelURI, EObject diagramRoot, TransactionalEditingDomain editingDomain) {
- assert domainModelURI != null : "Domain model uri must be specified"; //$NON-NLS-1$
- assert diagramRoot != null : "Doagram root element must be specified"; //$NON-NLS-1$
- assert editingDomain != null : "Editing domain must be specified"; //$NON-NLS-1$
-
- myFileCreationPage = new WizardNewFileCreationPage(Messages.UMLNewDiagramFileWizard_CreationPageName, StructuredSelection.EMPTY);
- myFileCreationPage.setTitle(Messages.UMLNewDiagramFileWizard_CreationPageTitle);
- myFileCreationPage.setDescription(NLS.bind(Messages.UMLNewDiagramFileWizard_CreationPageDescription, ComponentDiagramEditPart.MODEL_ID));
- IPath filePath;
- String fileName = URI.decode(domainModelURI.trimFileExtension().lastSegment());
- if(domainModelURI.isPlatformResource()) {
- filePath = new Path(domainModelURI.trimSegments(1).toPlatformString(true));
- } else if(domainModelURI.isFile()) {
- filePath = new Path(domainModelURI.trimSegments(1).toFileString());
- } else {
- // TODO : use some default path
- throw new IllegalArgumentException("Unsupported URI: " + domainModelURI); //$NON-NLS-1$
- }
- myFileCreationPage.setContainerFullPath(filePath);
- myFileCreationPage.setFileName(UMLDiagramEditorUtil.getUniqueFileName(filePath, fileName, "PapyrusUMLComponent_diagram")); //$NON-NLS-1$
-
- diagramRootElementSelectionPage = new DiagramRootElementSelectionPage(Messages.UMLNewDiagramFileWizard_RootSelectionPageName);
- diagramRootElementSelectionPage.setTitle(Messages.UMLNewDiagramFileWizard_RootSelectionPageTitle);
- diagramRootElementSelectionPage.setDescription(Messages.UMLNewDiagramFileWizard_RootSelectionPageDescription);
- diagramRootElementSelectionPage.setModelElement(diagramRoot);
-
- myEditingDomain = editingDomain;
- }
-
- /**
- * @generated
- */
- public void addPages() {
- addPage(myFileCreationPage);
- addPage(diagramRootElementSelectionPage);
- }
-
- /**
- * @generated
- */
- public boolean performFinish() {
- LinkedList<IFile> affectedFiles = new LinkedList<IFile>();
- IFile diagramFile = myFileCreationPage.createNewFile();
- UMLDiagramEditorUtil.setCharset(diagramFile);
- affectedFiles.add(diagramFile);
- URI diagramModelURI = URI.createPlatformResourceURI(diagramFile.getFullPath().toString(), true);
- ResourceSet resourceSet = myEditingDomain.getResourceSet();
- final Resource diagramResource = resourceSet.createResource(diagramModelURI);
- AbstractTransactionalCommand command = new AbstractTransactionalCommand(myEditingDomain, Messages.UMLNewDiagramFileWizard_InitDiagramCommand, affectedFiles) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- int diagramVID = UMLVisualIDRegistry.getDiagramVisualID(diagramRootElementSelectionPage.getModelElement());
- if(diagramVID != ComponentDiagramEditPart.VISUAL_ID) {
- return CommandResult.newErrorCommandResult(Messages.UMLNewDiagramFileWizard_IncorrectRootError);
- }
- Diagram diagram = ViewService.createDiagram(diagramRootElementSelectionPage.getModelElement(), ComponentDiagramEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- diagramResource.getContents().add(diagram);
- return CommandResult.newOKCommandResult();
- }
- };
- try {
- OperationHistoryFactory.getOperationHistory().execute(command, new NullProgressMonitor(), null);
- diagramResource.save(UMLDiagramEditorUtil.getSaveOptions());
- UMLDiagramEditorUtil.openDiagram(diagramResource);
- } catch (ExecutionException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
- } catch (IOException ex) {
- UMLDiagramEditorPlugin.getInstance().logError("Save operation failed for: " + diagramModelURI, ex); //$NON-NLS-1$
- } catch (PartInitException ex) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to open editor", ex); //$NON-NLS-1$
- }
- return true;
- }
-
- /**
- * @generated
- */
- private static class DiagramRootElementSelectionPage extends ModelElementSelectionPage {
-
- /**
- * @generated
- */
- protected DiagramRootElementSelectionPage(String pageName) {
- super(pageName);
- }
-
- /**
- * @generated
- */
- protected String getSelectionTitle() {
- return Messages.UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle;
- }
-
- /**
- * @generated
- */
- protected boolean validatePage() {
- if(selectedModelElement == null) {
- setErrorMessage(Messages.UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage);
- return false;
- }
- boolean result = ViewService.getInstance().provides(new CreateDiagramViewOperation(new EObjectAdapter(selectedModelElement), ComponentDiagramEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT));
- setErrorMessage(result ? null : Messages.UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage);
- return result;
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLNodeDescriptor.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLNodeDescriptor.java
deleted file mode 100644
index 4f73d4d74cd..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLNodeDescriptor.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * @generated
- */
-public class UMLNodeDescriptor {
-
- /**
- * @generated
- */
- private final EObject myModelElement;
-
- /**
- * @generated
- */
- private final int myVisualID;
-
- /**
- * @generated
- */
- public UMLNodeDescriptor(EObject modelElement, int visualID) {
- myModelElement = modelElement;
- myVisualID = visualID;
- }
-
- /**
- * @generated
- */
- public EObject getModelElement() {
- return myModelElement;
- }
-
- /**
- * @generated
- */
- public int getVisualID() {
- return myVisualID;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLPaletteFactory.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLPaletteFactory.java
deleted file mode 100644
index 65db5e5d74a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLPaletteFactory.java
+++ /dev/null
@@ -1,348 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.Tool;
-import org.eclipse.gmf.runtime.diagram.ui.services.palette.PaletteFactory;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.papyrus.diagram.common.service.AspectUnspecifiedTypeConnectionTool;
-import org.eclipse.papyrus.diagram.common.service.AspectUnspecifiedTypeCreationTool;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class UMLPaletteFactory extends PaletteFactory.Adapter {
-
-
-
-
-
- /**
- * @generated
- */
- private final static String COMPONENT_TOOL_PACKAGE = "component.tool.package"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String COMPONENT_TOOL_COMPONENT = "component.tool.component"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String COMPONENT_TOOL_INTERFACE = "component.tool.interface"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String COMPONENT_TOOL_PORT = "component.tool.port"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String COMPONENT_TOOL_COMMENT = "component.tool.comment"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String COMPONENT_TOOL_CONSTRAINT = "component.tool.constraint"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String COMPONENT_TOOL_LINK = "component.tool.link"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String COMPONENT_TOOL_DEPENDENCY = "component.tool.dependency"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String COMPONENT_TOOL_ABSTRACTION = "component.tool.abstraction"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String COMPONENT_TOOL_MANIFESTATION = "component.tool.manifestation"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String COMPONENT_TOOL_GENERALIZATION = "component.tool.generalization"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String COMPONENT_TOOL_USAGE = "component.tool.usage"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String COMPONENT_TOOL_SUBSTITUTION = "component.tool.substitution"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String COMPONENT_TOOL_INTERFACEREALIZATION = "component.tool.interfaceRealization"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String COMPONENT_TOOL_COMPONENTREALIZATION = "component.tool.componentRealization"; //$NON-NLS-1$
-
-
-
- /**
- * @generated
- */
- public UMLPaletteFactory() {
-
- }
-
-
-
- /**
- * @generated
- */
- public Tool createTool(String toolId) {
- if(toolId.equals(COMPONENT_TOOL_PACKAGE)) {
- return createPackageCreationTool();
- }
- if(toolId.equals(COMPONENT_TOOL_COMPONENT)) {
- return createComponentCreationTool();
- }
- if(toolId.equals(COMPONENT_TOOL_INTERFACE)) {
- return createInterfaceCreationTool();
- }
- if(toolId.equals(COMPONENT_TOOL_PORT)) {
- return createPortCreationTool();
- }
- if(toolId.equals(COMPONENT_TOOL_COMMENT)) {
- return createCommentCreationTool();
- }
- if(toolId.equals(COMPONENT_TOOL_CONSTRAINT)) {
- return createConstraintCreationTool();
- }
- if(toolId.equals(COMPONENT_TOOL_LINK)) {
- return createLinkCreationTool();
- }
- if(toolId.equals(COMPONENT_TOOL_DEPENDENCY)) {
- return createDependencyCreationTool();
- }
- if(toolId.equals(COMPONENT_TOOL_ABSTRACTION)) {
- return createAbstractionCreationTool();
- }
- if(toolId.equals(COMPONENT_TOOL_MANIFESTATION)) {
- return createManifestationCreationTool();
- }
- if(toolId.equals(COMPONENT_TOOL_GENERALIZATION)) {
- return createGeneralizationCreationTool();
- }
- if(toolId.equals(COMPONENT_TOOL_USAGE)) {
- return createUsageCreationTool();
- }
- if(toolId.equals(COMPONENT_TOOL_SUBSTITUTION)) {
- return createSubstitutionCreationTool();
- }
- if(toolId.equals(COMPONENT_TOOL_INTERFACEREALIZATION)) {
- return createInterfaceRealizationCreationTool();
- }
- if(toolId.equals(COMPONENT_TOOL_COMPONENTREALIZATION)) {
- return createComponentRealizationCreationTool();
- }
-
- // default return: null
- return null;
- }
-
-
-
-
- /**
- * @generated
- */
- public Object getTemplate(String templateId) {
-
- // default return: null
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private Tool createPackageCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Package_3200);
-
- Tool tool = new AspectUnspecifiedTypeCreationTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createComponentCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(3);
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Component_3070);
- types.add(UMLElementTypes.Component_3071);
-
- Tool tool = new AspectUnspecifiedTypeCreationTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createInterfaceCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(2);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Interface_3072);
-
- Tool tool = new AspectUnspecifiedTypeCreationTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createPortCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Port_3069);
-
- Tool tool = new AspectUnspecifiedTypeCreationTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createCommentCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(2);
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Comment_3074);
-
- Tool tool = new AspectUnspecifiedTypeCreationTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createConstraintCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(2);
- types.add(UMLElementTypes.Constraint_3199);
- types.add(UMLElementTypes.Constraint_3075);
-
- Tool tool = new AspectUnspecifiedTypeCreationTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createLinkCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(2);
- types.add(UMLElementTypes.CommentAnnotatedElement_4015);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
-
- Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createDependencyCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Dependency_4010);
-
- Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createAbstractionCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Abstraction_4013);
-
- Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createManifestationCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Manifestation_4014);
-
- Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createGeneralizationCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Generalization_4003);
-
- Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createUsageCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Usage_4001);
-
- Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createSubstitutionCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Substitution_4012);
-
- Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createInterfaceRealizationCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.InterfaceRealization_4006);
-
- Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createComponentRealizationCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.ComponentRealization_4007);
-
- Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
- return tool;
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLVisualIDRegistry.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLVisualIDRegistry.java
deleted file mode 100644
index 6ed80ab5fea..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/part/UMLVisualIDRegistry.java
+++ /dev/null
@@ -1,703 +0,0 @@
-package org.eclipse.papyrus.diagram.component.part;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.providers.BaseViewInfo;
-import org.eclipse.papyrus.diagram.common.providers.ViewInfo;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentBodyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentBodyEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentCompositeCompartmentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentNameEditPartCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentNameEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintNameEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintSpecificationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintSpecificationEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.GeneralizationAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceNameEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PackageEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PackageNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PackagePackageableElementCompartmentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.uml2.uml.Model;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * This registry is used to determine which type of visual object should be
- * created for the corresponding Diagram, Node, ChildNode or Link represented
- * by a domain model object.
- *
- * @generated
- */
-public class UMLVisualIDRegistry {
-
- /**
- * @generated
- */
- private static final String DEBUG_KEY = "org.eclipse.papyrus.diagram.component/debug/visualID"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static int getVisualID(View view) {
- if(view instanceof Diagram) {
- if(ComponentDiagramEditPart.MODEL_ID.equals(view.getType())) {
- return ComponentDiagramEditPart.VISUAL_ID;
- } else {
- return -1;
- }
- }
- return org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry.getVisualID(view.getType());
- }
-
- /**
- * @generated
- */
- public static String getModelID(View view) {
- View diagram = view.getDiagram();
- while(view != diagram) {
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if(annotation != null) {
- return (String)annotation.getDetails().get("modelID"); //$NON-NLS-1$
- }
- view = (View)view.eContainer();
- }
- return diagram != null ? diagram.getType() : null;
- }
-
- /**
- * @generated
- */
- public static int getVisualID(String type) {
- try {
- return Integer.parseInt(type);
- } catch (NumberFormatException e) {
- if(Boolean.TRUE.toString().equalsIgnoreCase(Platform.getDebugOption(DEBUG_KEY))) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to parse view type as a visualID number: " + type);
- }
- }
- return -1;
- }
-
- /**
- * @generated
- */
- public static String getType(int visualID) {
- return Integer.toString(visualID);
- }
-
- /**
- * @generated
- */
- public static int getDiagramVisualID(EObject domainElement) {
- if(domainElement == null) {
- return -1;
- }
- if(UMLPackage.eINSTANCE.getModel().isSuperTypeOf(domainElement.eClass()) && isDiagram((Model)domainElement)) {
- return ComponentDiagramEditPart.VISUAL_ID;
- }
-
- return -1;
- }
-
- /**
- * @generated
- */
- public static int getNodeVisualID(View containerView, EObject domainElement) {
- if(domainElement == null) {
- return -1;
- }
- String containerModelID = org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry.getModelID(containerView);
- if(!ComponentDiagramEditPart.MODEL_ID.equals(containerModelID)) {
- return -1;
- }
- int containerVisualID;
- if(ComponentDiagramEditPart.MODEL_ID.equals(containerModelID)) {
- containerVisualID = org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry.getVisualID(containerView);
- } else {
- if(containerView instanceof Diagram) {
- containerVisualID = ComponentDiagramEditPart.VISUAL_ID;
- } else {
- return -1;
- }
- }
- switch(containerVisualID) {
- case ComponentDiagramEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ComponentEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return InterfaceEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getPackage().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return PackageEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return CommentEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ConstraintEditPart.VISUAL_ID;
- }
- break;
- case ComponentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return PortEditPart.VISUAL_ID;
- }
- break;
- case ComponentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return PortEditPart.VISUAL_ID;
- }
- break;
- case ComponentEditPartPCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return PortEditPart.VISUAL_ID;
- }
- break;
- case ComponentCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ComponentEditPartCN.VISUAL_ID;
- }
- break;
- case PackagePackageableElementCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return InterfaceEditPartPCN.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return CommentEditPartPCN.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ConstraintEditPartPCN.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ComponentEditPartPCN.VISUAL_ID;
- }
- break;
- case ComponentCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ComponentEditPartCN.VISUAL_ID;
- }
- break;
- case ComponentCompositeCompartmentEditPartPCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ComponentEditPartCN.VISUAL_ID;
- }
- break;
- }
- return -1;
- }
-
- /**
- * @generated
- */
- public static boolean canCreateNode(View containerView, int nodeVisualID) {
- String containerModelID = org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry.getModelID(containerView);
- if(!ComponentDiagramEditPart.MODEL_ID.equals(containerModelID)) {
- return false;
- }
- int containerVisualID;
- if(ComponentDiagramEditPart.MODEL_ID.equals(containerModelID)) {
- containerVisualID = org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry.getVisualID(containerView);
- } else {
- if(containerView instanceof Diagram) {
- containerVisualID = ComponentDiagramEditPart.VISUAL_ID;
- } else {
- return false;
- }
- }
- switch(containerVisualID) {
- case ComponentDiagramEditPart.VISUAL_ID:
- if(ComponentEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(InterfaceEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(PackageEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(CommentEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ConstraintEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ComponentEditPart.VISUAL_ID:
- if(ComponentNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ComponentCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case InterfaceEditPart.VISUAL_ID:
- if(InterfaceNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case PackageEditPart.VISUAL_ID:
- if(PackageNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(PackagePackageableElementCompartmentEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case CommentEditPart.VISUAL_ID:
- if(CommentBodyEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ConstraintEditPart.VISUAL_ID:
- if(ConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ConstraintSpecificationEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case PortEditPart.VISUAL_ID:
- if(PortNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(PortAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ComponentEditPartCN.VISUAL_ID:
- if(ComponentNameEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ComponentCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ComponentEditPartPCN.VISUAL_ID:
- if(ComponentNameEditPartPCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ComponentCompositeCompartmentEditPartPCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case InterfaceEditPartPCN.VISUAL_ID:
- if(InterfaceNameEditPartPCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case CommentEditPartPCN.VISUAL_ID:
- if(CommentBodyEditPartPCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ConstraintEditPartPCN.VISUAL_ID:
- if(ConstraintNameEditPartPCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ConstraintSpecificationEditPartPCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ComponentCompositeCompartmentEditPart.VISUAL_ID:
- if(ComponentEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case PackagePackageableElementCompartmentEditPart.VISUAL_ID:
- if(InterfaceEditPartPCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(CommentEditPartPCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ConstraintEditPartPCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ComponentEditPartPCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ComponentCompositeCompartmentEditPartCN.VISUAL_ID:
- if(ComponentEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ComponentCompositeCompartmentEditPartPCN.VISUAL_ID:
- if(ComponentEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case GeneralizationEditPart.VISUAL_ID:
- if(GeneralizationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case SubstitutionEditPart.VISUAL_ID:
- if(SubstitutionNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(SubstitutionAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ManifestationEditPart.VISUAL_ID:
- if(ManifestationNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ManifestationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ComponentRealizationEditPart.VISUAL_ID:
- if(ComponentRealizationNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ComponentRealizationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case AbstractionEditPart.VISUAL_ID:
- if(AbstractionNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(AbstractionAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case DependencyEditPart.VISUAL_ID:
- if(DependencyNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(DependencyAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- }
- return false;
- }
-
- /**
- * @generated
- */
- public static int getLinkWithClassVisualID(EObject domainElement) {
- if(domainElement == null) {
- return -1;
- }
- if(UMLPackage.eINSTANCE.getUsage().isSuperTypeOf(domainElement.eClass())
-
-
-
- ) {
- return UsageEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getInterfaceRealization().isSuperTypeOf(domainElement.eClass())
-
-
-
- ) {
- return InterfaceRealizationEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getGeneralization().isSuperTypeOf(domainElement.eClass())
-
-
-
- ) {
- return GeneralizationEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getSubstitution().isSuperTypeOf(domainElement.eClass())
-
-
-
- ) {
- return SubstitutionEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getManifestation().isSuperTypeOf(domainElement.eClass())
-
-
-
- ) {
- return ManifestationEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getComponentRealization().isSuperTypeOf(domainElement.eClass())
-
-
-
- ) {
- return ComponentRealizationEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getAbstraction().isSuperTypeOf(domainElement.eClass())
-
-
-
- ) {
- return AbstractionEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getDependency().isSuperTypeOf(domainElement.eClass())
-
-
-
- ) {
- return DependencyEditPart.VISUAL_ID;
- }
- return -1;
- }
-
- /**
- * "User can change implementation of this method to handle some specific\n""situations not covered by default logic.\n"
- * @generated
- */
- private static boolean isDiagram(Model element) {
- return true;
- }
-
-
-
-
-
- /**
- * @generated
- */
- private static ViewInfo diagramViewInfo = null;
-
-
- /**
- * @generated
- */
- public static ViewInfo getDiagramViewInfo() {
- if(diagramViewInfo == null) {
- diagramViewInfo = getModel_1000ViewInfo();
- }
- return diagramViewInfo;
- }
-
-
-
- /**
- * @generated
- */
- protected static ViewInfo getModel_1000ViewInfo() {
- ViewInfo root = new BaseViewInfo(1000, ViewInfo.Head, "", null, null);
- ViewInfo viewInfo = null;
- ViewInfo labelInfo = null;
-
- viewInfo = new BaseViewInfo(2002, ViewInfo.Node, "Component");
- root.addNode(1000, viewInfo);
-
- viewInfo = new BaseViewInfo(2003, ViewInfo.Node, "Interface");
- root.addNode(1000, viewInfo);
-
- viewInfo = new BaseViewInfo(3200, ViewInfo.Node, "Package");
- root.addNode(1000, viewInfo);
-
- viewInfo = new BaseViewInfo(3201, ViewInfo.Node, "Comment");
- root.addNode(1000, viewInfo);
-
- viewInfo = new BaseViewInfo(3199, ViewInfo.Node, "Constraint");
- root.addNode(1000, viewInfo);
-
- viewInfo = new BaseViewInfo(4001, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- viewInfo = new BaseViewInfo(4006, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- viewInfo = new BaseViewInfo(4003, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- labelInfo = new BaseViewInfo(2, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- viewInfo = new BaseViewInfo(4012, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- labelInfo = new BaseViewInfo(6006, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- labelInfo = new BaseViewInfo(6020, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- viewInfo = new BaseViewInfo(4014, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- labelInfo = new BaseViewInfo(6008, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- labelInfo = new BaseViewInfo(6022, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- viewInfo = new BaseViewInfo(4007, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- labelInfo = new BaseViewInfo(3, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- labelInfo = new BaseViewInfo(4, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- viewInfo = new BaseViewInfo(4013, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- labelInfo = new BaseViewInfo(6007, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- labelInfo = new BaseViewInfo(6021, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- viewInfo = new BaseViewInfo(4016, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- viewInfo = new BaseViewInfo(4015, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- viewInfo = new BaseViewInfo(4009, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- viewInfo = new BaseViewInfo(4010, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- labelInfo = new BaseViewInfo(6009, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- labelInfo = new BaseViewInfo(6023, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- viewInfo = new BaseViewInfo(3069, ViewInfo.Node, "Port");
-
- root.addNode(2002, viewInfo);
-
- root.addNode(3070, viewInfo);
-
- root.addNode(3071, viewInfo);
-
-
- viewInfo = new BaseViewInfo(3070, ViewInfo.Node, "Component");
-
- root.addNode(7003, viewInfo);
-
- root.addNode(7004, viewInfo);
-
- root.addNode(7001, viewInfo);
-
-
- viewInfo = new BaseViewInfo(3071, ViewInfo.Node, "Component");
-
- root.addNode(7002, viewInfo);
-
-
- viewInfo = new BaseViewInfo(3072, ViewInfo.Node, "Interface");
-
- root.addNode(7002, viewInfo);
-
-
- viewInfo = new BaseViewInfo(3074, ViewInfo.Node, "Comment");
-
- root.addNode(7002, viewInfo);
-
-
- viewInfo = new BaseViewInfo(3075, ViewInfo.Node, "Constraint");
-
- root.addNode(7002, viewInfo);
-
- return root;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/AbstractionPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/AbstractionPreferencePage.java
deleted file mode 100644
index c0c545bd75d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/AbstractionPreferencePage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-/**
- * @generated
- */
-public class AbstractionPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * @generated
- */
- public AbstractionPreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_Abstraction");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/CommentPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/CommentPreferencePage.java
deleted file mode 100644
index 3384eed4306..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/CommentPreferencePage.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-
-/**
- * @generated
- */
-public class CommentPreferencePage extends AbstractPapyrusNodePreferencePage {
-
-
-
- /**
- * @generated
- */
- public CommentPreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_Comment");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String key = ComponentDiagramEditPart.MODEL_ID + "_Comment";
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 40);
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 40);
-
-
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
-
- // Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ComponentPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ComponentPreferencePage.java
deleted file mode 100644
index 1215899dfcc..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ComponentPreferencePage.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-
-/**
- * @generated
- */
-public class ComponentPreferencePage extends AbstractPapyrusNodePreferencePage {
-
- /**
- * @generated
- */
- public static final String compartments[] = { "CompositeCompartment" };
-
-
- /**
- * @generated
- */
- public ComponentPreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_Component");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String key = ComponentDiagramEditPart.MODEL_ID + "_Component";
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 150);
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 100);
-
- for(String name : compartments) {
- String preferenceName = PreferenceConstantHelper.getCompartmentElementConstant(key, name, PreferenceConstantHelper.COMPARTMENT_VISIBILITY);
- store.setDefault(preferenceName, true);
- }
-
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
-
- // Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- }
-
- /**
- * @generated
- */
- @Override
- protected void initializeCompartmentsList() {
- for(String name : compartments) {
- this.compartmentsList.add(name);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ComponentRealizationPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ComponentRealizationPreferencePage.java
deleted file mode 100644
index 29faefad1bb..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ComponentRealizationPreferencePage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-/**
- * @generated
- */
-public class ComponentRealizationPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * @generated
- */
- public ComponentRealizationPreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_ComponentRealization");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ConstraintPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ConstraintPreferencePage.java
deleted file mode 100644
index 85460b151a4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ConstraintPreferencePage.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-
-/**
- * @generated
- */
-public class ConstraintPreferencePage extends AbstractPapyrusNodePreferencePage {
-
-
-
- /**
- * @generated
- */
- public ConstraintPreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_Constraint");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String key = ComponentDiagramEditPart.MODEL_ID + "_Constraint";
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 40);
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 40);
-
-
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
-
- // Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DependencyPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DependencyPreferencePage.java
deleted file mode 100644
index 8ada438a635..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DependencyPreferencePage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-/**
- * @generated
- */
-public class DependencyPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * @generated
- */
- public DependencyPreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_Dependency");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramAppearancePreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramAppearancePreferencePage.java
deleted file mode 100644
index 4bbfe6bc4ef..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramAppearancePreferencePage.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramAppearancePreferencePage extends AppearancePreferencePage {
-
- /**
- * @generated
- */
- public DiagramAppearancePreferencePage() {
- setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore());
-
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramConnectionsPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramConnectionsPreferencePage.java
deleted file mode 100644
index 4762c630bb9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramConnectionsPreferencePage.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.gmf.runtime.diagram.ui.preferences.ConnectionsPreferencePage;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramConnectionsPreferencePage extends ConnectionsPreferencePage {
-
- /**
- * @generated
- */
- public DiagramConnectionsPreferencePage() {
- setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore());
-
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramGeneralPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramGeneralPreferencePage.java
deleted file mode 100644
index 61b01f4df6a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramGeneralPreferencePage.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.DiagramPreferencePage;
-
-/**
- * @generated
- */
-public class DiagramGeneralPreferencePage extends DiagramPreferencePage {
-
- /**
- * @generated
- */
- public DiagramGeneralPreferencePage() {
- setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore());
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID);
-
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramPreferenceInitializer.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramPreferenceInitializer.java
deleted file mode 100644
index 9e949c92ec2..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramPreferenceInitializer.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer {
-
- /**
- * @generated
- */
- public void initializeDefaultPreferences() {
- IPreferenceStore store = getPreferenceStore();
-
- InterfacePreferencePage.initDefaults(store);
-
-
- PortPreferencePage.initDefaults(store);
-
-
- ConstraintPreferencePage.initDefaults(store);
-
-
- CommentPreferencePage.initDefaults(store);
-
-
- PackagePreferencePage.initDefaults(store);
-
-
- ComponentPreferencePage.initDefaults(store);
-
-
-
-
- ConstraintConstrainedElementPreferencePage.initDefaults(store);
-
-
- AbstractionPreferencePage.initDefaults(store);
-
-
- CommentAnnotatedElementPreferencePage.initDefaults(store);
-
-
- SubstitutionPreferencePage.initDefaults(store);
-
-
- ManifestationPreferencePage.initDefaults(store);
-
-
- GeneralizationPreferencePage.initDefaults(store);
-
-
-
- DependencyPreferencePage.initDefaults(store);
-
-
- ComponentRealizationPreferencePage.initDefaults(store);
-
-
- InterfaceRealizationPreferencePage.initDefaults(store);
-
-
- UsagePreferencePage.initDefaults(store);
-
-
- }
-
- /**
- * @generated
- */
- protected IPreferenceStore getPreferenceStore() {
- return UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramPrintingPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramPrintingPreferencePage.java
deleted file mode 100644
index 24e701acb38..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramPrintingPreferencePage.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.gmf.runtime.diagram.ui.preferences.PrintingPreferencePage;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramPrintingPreferencePage extends PrintingPreferencePage {
-
- /**
- * @generated
- */
- public DiagramPrintingPreferencePage() {
- setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore());
-
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramRulersAndGridPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramRulersAndGridPreferencePage.java
deleted file mode 100644
index 4a7524745f1..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/DiagramRulersAndGridPreferencePage.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.gmf.runtime.diagram.ui.preferences.RulerGridPreferencePage;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramRulersAndGridPreferencePage extends RulerGridPreferencePage {
-
- /**
- * @generated
- */
- public DiagramRulersAndGridPreferencePage() {
- setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore());
-
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/GeneralizationPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/GeneralizationPreferencePage.java
deleted file mode 100644
index 1defe9bc33a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/GeneralizationPreferencePage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-/**
- * @generated
- */
-public class GeneralizationPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * @generated
- */
- public GeneralizationPreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_Generalization");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/InterfacePreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/InterfacePreferencePage.java
deleted file mode 100644
index 89a7db5857d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/InterfacePreferencePage.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-
-/**
- * @generated
- */
-public class InterfacePreferencePage extends AbstractPapyrusNodePreferencePage {
-
-
-
- /**
- * @generated
- */
- public InterfacePreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_Interface");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String key = ComponentDiagramEditPart.MODEL_ID + "_Interface";
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 20);
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 20);
-
-
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
-
- // Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/InterfaceRealizationPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/InterfaceRealizationPreferencePage.java
deleted file mode 100644
index ef56bfc858d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/InterfaceRealizationPreferencePage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-/**
- * @generated
- */
-public class InterfaceRealizationPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * @generated
- */
- public InterfaceRealizationPreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_InterfaceRealization");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ManifestationPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ManifestationPreferencePage.java
deleted file mode 100644
index fe52cc0d6fc..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/ManifestationPreferencePage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-/**
- * @generated
- */
-public class ManifestationPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * @generated
- */
- public ManifestationPreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_Manifestation");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/PackagePreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/PackagePreferencePage.java
deleted file mode 100644
index 9283dccd8a0..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/PackagePreferencePage.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-
-/**
- * @generated
- */
-public class PackagePreferencePage extends AbstractPapyrusNodePreferencePage {
-
- /**
- * @generated
- */
- public static final String compartments[] = { "PackageableElementCompartment" };
-
-
- /**
- * @generated
- */
- public PackagePreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_Package");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String key = ComponentDiagramEditPart.MODEL_ID + "_Package";
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 150);
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 150);
-
- for(String name : compartments) {
- String preferenceName = PreferenceConstantHelper.getCompartmentElementConstant(key, name, PreferenceConstantHelper.COMPARTMENT_VISIBILITY);
- store.setDefault(preferenceName, true);
- }
-
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
-
- // Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- }
-
- /**
- * @generated
- */
- @Override
- protected void initializeCompartmentsList() {
- for(String name : compartments) {
- this.compartmentsList.add(name);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/PortPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/PortPreferencePage.java
deleted file mode 100644
index 605c71ba413..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/PortPreferencePage.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-
-/**
- * @generated
- */
-public class PortPreferencePage extends AbstractPapyrusNodePreferencePage {
-
-
-
- /**
- * @generated
- */
- public PortPreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_Port");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String key = ComponentDiagramEditPart.MODEL_ID + "_Port";
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 20);
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 20);
-
-
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
-
- // Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/SubstitutionPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/SubstitutionPreferencePage.java
deleted file mode 100644
index e299534d5cc..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/SubstitutionPreferencePage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-/**
- * @generated
- */
-public class SubstitutionPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * @generated
- */
- public SubstitutionPreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_Substitution");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/UsagePreferencePage.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/UsagePreferencePage.java
deleted file mode 100644
index 29d9d673704..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/preferences/UsagePreferencePage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.papyrus.diagram.component.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-/**
- * @generated
- */
-public class UsagePreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * @generated
- */
- public UsagePreferencePage() {
- super();
- setPreferenceKey(ComponentDiagramEditPart.MODEL_ID + "_Usage");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/ElementInitializers.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/ElementInitializers.java
deleted file mode 100644
index 58e9a870398..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/ElementInitializers.java
+++ /dev/null
@@ -1,351 +0,0 @@
-package org.eclipse.papyrus.diagram.component.providers;
-
-import org.eclipse.papyrus.diagram.common.helper.NamedElementHelper;
-import org.eclipse.papyrus.diagram.component.expressions.UMLOCLFactory;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.uml2.uml.Abstraction;
-import org.eclipse.uml2.uml.AggregationKind;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Component;
-import org.eclipse.uml2.uml.ComponentRealization;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.InterfaceRealization;
-import org.eclipse.uml2.uml.LiteralString;
-import org.eclipse.uml2.uml.Manifestation;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Substitution;
-import org.eclipse.uml2.uml.UMLFactory;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.Usage;
-import org.eclipse.uml2.uml.ValueSpecification;
-
-/**
- * @generated
- */
-public class ElementInitializers {
-
- protected ElementInitializers() {
- // use #getInstance to access cached instance
- }
-
- /**
- * @generated
- */
- public void init_Component_2002(Component instance) {
- try {
- Object value_0 = UMLOCLFactory.getExpression(0, UMLPackage.eINSTANCE.getComponent(), null).evaluate(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Interface_2003(Interface instance) {
- try {
- Object value_0 = UMLOCLFactory.getExpression(2, UMLPackage.eINSTANCE.getInterface(), null).evaluate(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Package_3200(Package instance) {
- try {
- Object value_0 = UMLOCLFactory.getExpression(5, UMLPackage.eINSTANCE.getPackage(), null).evaluate(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Comment_3201(Comment instance) {
- try {
- Object value_0 = body_Comment_3201(instance);
- instance.setBody((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Constraint_3199(Constraint instance) {
- try {
- Object value_0 = name_Constraint_3199(instance);
- instance.setName((String)value_0);
- Object value_1 = specification_Constraint_3199(instance);
- instance.setSpecification((ValueSpecification)value_1);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Port_3069(Port instance) {
- try {
- Object value_0 = UMLOCLFactory.getExpression(1, UMLPackage.eINSTANCE.getPort(), null).evaluate(instance);
- instance.setName((String)value_0);
- instance.setAggregation(AggregationKind.COMPOSITE_LITERAL);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Component_3070(Component instance) {
- try {
- Object value_0 = UMLOCLFactory.getExpression(0, UMLPackage.eINSTANCE.getComponent(), null).evaluate(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Component_3071(Component instance) {
- try {
- Object value_0 = UMLOCLFactory.getExpression(0, UMLPackage.eINSTANCE.getComponent(), null).evaluate(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Interface_3072(Interface instance) {
- try {
- Object value_0 = UMLOCLFactory.getExpression(2, UMLPackage.eINSTANCE.getInterface(), null).evaluate(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Comment_3074(Comment instance) {
- try {
- Object value_0 = body_Comment_3074(instance);
- instance.setBody((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Constraint_3075(Constraint instance) {
- try {
- Object value_0 = name_Constraint_3075(instance);
- instance.setName((String)value_0);
- Object value_1 = specification_Constraint_3075(instance);
- instance.setSpecification((ValueSpecification)value_1);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Usage_4001(Usage instance) {
- try {
- Object value_0 = UMLOCLFactory.getExpression(3, UMLPackage.eINSTANCE.getUsage(), null).evaluate(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_InterfaceRealization_4006(InterfaceRealization instance) {
- try {
- Object value_0 = UMLOCLFactory.getExpression(4, UMLPackage.eINSTANCE.getInterfaceRealization(), null).evaluate(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Substitution_4012(Substitution instance) {
- try {
- Object value_0 = name_Substitution_4012(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Manifestation_4014(Manifestation instance) {
- try {
- Object value_0 = name_Manifestation_4014(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_ComponentRealization_4007(ComponentRealization instance) {
- try {
- Object value_0 = name_ComponentRealization_4007(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Abstraction_4013(Abstraction instance) {
- try {
- Object value_0 = name_Abstraction_4013(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Dependency_4010(Dependency instance) {
- try {
- Object value_0 = name_Dependency_4010(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- private String body_Comment_3201(Comment self) {
- // Comment body init
- return "";
- }
-
- /**
- * @generated
- */
- private String name_Constraint_3199(Constraint self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private ValueSpecification specification_Constraint_3199(Constraint self) {
- // Constraint specification init
- LiteralString value = UMLFactory.eINSTANCE.createLiteralString();
- value.setValue("");
- return value;
- }
-
- /**
- * @generated
- */
- private String body_Comment_3074(Comment self) {
- // Comment body init
- return "";
- }
-
- /**
- * @generated
- */
- private String name_Constraint_3075(Constraint self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private ValueSpecification specification_Constraint_3075(Constraint self) {
- // Constraint specification init
- LiteralString value = UMLFactory.eINSTANCE.createLiteralString();
- value.setValue("");
- return value;
- }
-
- /**
- * @generated
- */
- private String name_Substitution_4012(Substitution self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private String name_Manifestation_4014(Manifestation self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private String name_ComponentRealization_4007(ComponentRealization self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private String name_Abstraction_4013(Abstraction self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private String name_Dependency_4010(Dependency self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
-
- /**
- * @generated
- */
- public static ElementInitializers getInstance() {
- ElementInitializers cached = UMLDiagramEditorPlugin.getInstance().getElementInitializers();
- if(cached == null) {
- UMLDiagramEditorPlugin.getInstance().setElementInitializers(cached = new ElementInitializers());
- }
- return cached;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLEditPartProvider.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLEditPartProvider.java
deleted file mode 100644
index 922d3e0f1c4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLEditPartProvider.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package org.eclipse.papyrus.diagram.component.providers;
-
-import java.lang.ref.WeakReference;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.AbstractEditPartProvider;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UMLEditPartFactory;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-
-/**
- * @generated
- */
-public class UMLEditPartProvider extends AbstractEditPartProvider {
-
- /**
- * @generated
- */
- private EditPartFactory factory;
-
- /**
- * @generated
- */
- private boolean allowCaching;
-
- /**
- * @generated
- */
- private WeakReference cachedPart;
-
- /**
- * @generated
- */
- private WeakReference cachedView;
-
- /**
- * @generated
- */
- public UMLEditPartProvider() {
- setFactory(new UMLEditPartFactory());
- setAllowCaching(true);
- }
-
- /**
- * @generated
- */
- public final EditPartFactory getFactory() {
- return factory;
- }
-
- /**
- * @generated
- */
- protected void setFactory(EditPartFactory factory) {
- this.factory = factory;
- }
-
- /**
- * @generated
- */
- public final boolean isAllowCaching() {
- return allowCaching;
- }
-
- /**
- * @generated
- */
- protected synchronized void setAllowCaching(boolean allowCaching) {
- this.allowCaching = allowCaching;
- if(!allowCaching) {
- cachedPart = null;
- cachedView = null;
- }
- }
-
- /**
- * @generated
- */
- protected IGraphicalEditPart createEditPart(View view) {
- EditPart part = factory.createEditPart(null, view);
- if(part instanceof IGraphicalEditPart) {
- return (IGraphicalEditPart)part;
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected IGraphicalEditPart getCachedPart(View view) {
- if(cachedView != null && cachedView.get() == view) {
- return (IGraphicalEditPart)cachedPart.get();
- }
- return null;
- }
-
- /**
- * @generated
- */
- public synchronized IGraphicalEditPart createGraphicEditPart(View view) {
- if(isAllowCaching()) {
- IGraphicalEditPart part = getCachedPart(view);
- cachedPart = null;
- cachedView = null;
- if(part != null) {
- return part;
- }
- }
- return createEditPart(view);
- }
-
- /**
- * @generated
- */
- public synchronized boolean provides(IOperation operation) {
- if(operation instanceof CreateGraphicEditPartOperation) {
- View view = ((IEditPartOperation)operation).getView();
- if(!ComponentDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view))) {
- return false;
- }
- if(isAllowCaching() && getCachedPart(view) != null) {
- return true;
- }
- IGraphicalEditPart part = createEditPart(view);
- if(part != null) {
- if(isAllowCaching()) {
- cachedPart = new WeakReference(part);
- cachedView = new WeakReference(view);
- }
- return true;
- }
- }
- return false;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLElementTypes.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLElementTypes.java
deleted file mode 100644
index 44b138992cc..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLElementTypes.java
+++ /dev/null
@@ -1,452 +0,0 @@
-package org.eclipse.papyrus.diagram.component.providers;
-
-import java.util.HashSet;
-import java.util.IdentityHashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.LinkDescriptorEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PackageEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class UMLElementTypes {
-
- /**
- * @generated
- */
- private UMLElementTypes() {
- }
-
- /**
- * @generated
- */
- private static Map<IElementType, ENamedElement> elements;
-
- /**
- * @generated
- */
- private static ImageRegistry imageRegistry;
-
- /**
- * @generated
- */
- private static Set<IElementType> KNOWN_ELEMENT_TYPES;
-
- /**
- * @generated
- */
- public static final IElementType Model_1000 = getElementType("org.eclipse.papyrus.diagram.component.Model_1000"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Component_2002 = getElementType("org.eclipse.papyrus.diagram.component.Component_2002"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Interface_2003 = getElementType("org.eclipse.papyrus.diagram.component.Interface_2003"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Package_3200 = getElementType("org.eclipse.papyrus.diagram.component.Package_3200"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Comment_3201 = getElementType("org.eclipse.papyrus.diagram.component.Comment_3201"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Constraint_3199 = getElementType("org.eclipse.papyrus.diagram.component.Comment_3199"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Port_3069 = getElementType("org.eclipse.papyrus.diagram.component.Port_3069"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Component_3070 = getElementType("org.eclipse.papyrus.diagram.component.Component_3070"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Component_3071 = getElementType("org.eclipse.papyrus.diagram.component.Component_3071"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Interface_3072 = getElementType("org.eclipse.papyrus.diagram.component.Interface_3072"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Comment_3074 = getElementType("org.eclipse.papyrus.diagram.component.Comment_3074"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Constraint_3075 = getElementType("org.eclipse.papyrus.diagram.component.Constraint_3075"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Usage_4001 = getElementType("org.eclipse.papyrus.diagram.component.Usage_4001"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType InterfaceRealization_4006 = getElementType("org.eclipse.papyrus.diagram.component.InterfaceRealization_4006"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Generalization_4003 = getElementType("org.eclipse.papyrus.diagram.component.Generalization_4003"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Substitution_4012 = getElementType("org.eclipse.papyrus.diagram.component.Substitution_4012"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Manifestation_4014 = getElementType("org.eclipse.papyrus.diagram.component.Manifestation_4014"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType ComponentRealization_4007 = getElementType("org.eclipse.papyrus.diagram.component.ComponentRealization_4007"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Abstraction_4013 = getElementType("org.eclipse.papyrus.diagram.component.Abstraction_4013"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Link_4016 = getElementType("org.eclipse.papyrus.diagram.component.Link_4016"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType CommentAnnotatedElement_4015 = getElementType("org.eclipse.papyrus.diagram.component.CommentAnnotatedElement_4008"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType ConstraintConstrainedElement_4009 = getElementType("org.eclipse.papyrus.diagram.component.ConstraintConstrainedElement_4009"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Dependency_4010 = getElementType("org.eclipse.papyrus.diagram.component.Dependency_4010"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- private static ImageRegistry getImageRegistry() {
- if(imageRegistry == null) {
- imageRegistry = new ImageRegistry();
- }
- return imageRegistry;
- }
-
- /**
- * @generated
- */
- private static String getImageRegistryKey(ENamedElement element) {
- return element.getName();
- }
-
- /**
- * @generated
- */
- private static ImageDescriptor getProvidedImageDescriptor(ENamedElement element) {
- if(element instanceof EStructuralFeature) {
- EStructuralFeature feature = ((EStructuralFeature)element);
- EClass eContainingClass = feature.getEContainingClass();
- EClassifier eType = feature.getEType();
- if(eContainingClass != null && !eContainingClass.isAbstract()) {
- element = eContainingClass;
- } else if(eType instanceof EClass && !((EClass)eType).isAbstract()) {
- element = eType;
- }
- }
- if(element instanceof EClass) {
- EClass eClass = (EClass)element;
- if(!eClass.isAbstract()) {
- return UMLDiagramEditorPlugin.getInstance().getItemImageDescriptor(eClass.getEPackage().getEFactoryInstance().create(eClass));
- }
- }
- // TODO : support structural features
- return null;
- }
-
- /**
- * @generated
- */
- public static ImageDescriptor getImageDescriptor(ENamedElement element) {
- String key = getImageRegistryKey(element);
- ImageDescriptor imageDescriptor = getImageRegistry().getDescriptor(key);
- if(imageDescriptor == null) {
- imageDescriptor = getProvidedImageDescriptor(element);
- if(imageDescriptor == null) {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- getImageRegistry().put(key, imageDescriptor);
- }
- return imageDescriptor;
- }
-
- /**
- * @generated
- */
- public static Image getImage(ENamedElement element) {
- String key = getImageRegistryKey(element);
- Image image = getImageRegistry().get(key);
- if(image == null) {
- ImageDescriptor imageDescriptor = getProvidedImageDescriptor(element);
- if(imageDescriptor == null) {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- getImageRegistry().put(key, imageDescriptor);
- image = getImageRegistry().get(key);
- }
- return image;
- }
-
- /**
- * @generated
- */
- public static ImageDescriptor getImageDescriptor(IAdaptable hint) {
- ENamedElement element = getElement(hint);
- if(element == null) {
- return null;
- }
- return getImageDescriptor(element);
- }
-
- /**
- * @generated
- */
- public static Image getImage(IAdaptable hint) {
- ENamedElement element = getElement(hint);
- if(element == null) {
- return null;
- }
- return getImage(element);
- }
-
- /**
- * Returns 'type' of the ecore object associated with the hint.
- *
- * @generated
- */
- public static ENamedElement getElement(IAdaptable hint) {
- Object type = hint.getAdapter(IElementType.class);
- if(elements == null) {
- elements = new IdentityHashMap<IElementType, ENamedElement>();
-
- elements.put(Model_1000, UMLPackage.eINSTANCE.getModel());
-
-
- elements.put(Component_2002, UMLPackage.eINSTANCE.getComponent());
-
-
- elements.put(Interface_2003, UMLPackage.eINSTANCE.getInterface());
-
-
- elements.put(Package_3200, UMLPackage.eINSTANCE.getPackage());
-
-
- elements.put(Comment_3201, UMLPackage.eINSTANCE.getComment());
-
-
- elements.put(Constraint_3199, UMLPackage.eINSTANCE.getConstraint());
-
-
- elements.put(Port_3069, UMLPackage.eINSTANCE.getPort());
-
-
- elements.put(Component_3070, UMLPackage.eINSTANCE.getComponent());
-
-
- elements.put(Component_3071, UMLPackage.eINSTANCE.getComponent());
-
-
- elements.put(Interface_3072, UMLPackage.eINSTANCE.getInterface());
-
-
- elements.put(Comment_3074, UMLPackage.eINSTANCE.getComment());
-
-
- elements.put(Constraint_3075, UMLPackage.eINSTANCE.getConstraint());
-
-
- elements.put(Usage_4001, UMLPackage.eINSTANCE.getUsage());
-
-
- elements.put(InterfaceRealization_4006, UMLPackage.eINSTANCE.getInterfaceRealization());
-
-
- elements.put(Generalization_4003, UMLPackage.eINSTANCE.getGeneralization());
-
-
- elements.put(Substitution_4012, UMLPackage.eINSTANCE.getSubstitution());
-
-
- elements.put(Manifestation_4014, UMLPackage.eINSTANCE.getManifestation());
-
-
- elements.put(ComponentRealization_4007, UMLPackage.eINSTANCE.getComponentRealization());
-
-
- elements.put(Abstraction_4013, UMLPackage.eINSTANCE.getAbstraction());
-
- elements.put(CommentAnnotatedElement_4015, UMLPackage.eINSTANCE.getComment_AnnotatedElement());
-
- elements.put(ConstraintConstrainedElement_4009, UMLPackage.eINSTANCE.getConstraint_ConstrainedElement());
-
-
- elements.put(Dependency_4010, UMLPackage.eINSTANCE.getDependency());
- }
- return (ENamedElement)elements.get(type);
- }
-
- /**
- * @generated
- */
- private static IElementType getElementType(String id) {
- return ElementTypeRegistry.getInstance().getType(id);
- }
-
- /**
- * @generated
- */
- public static boolean isKnownElementType(IElementType elementType) {
- if(KNOWN_ELEMENT_TYPES == null) {
- KNOWN_ELEMENT_TYPES = new HashSet<IElementType>();
- KNOWN_ELEMENT_TYPES.add(Model_1000);
- KNOWN_ELEMENT_TYPES.add(Component_2002);
- KNOWN_ELEMENT_TYPES.add(Interface_2003);
- KNOWN_ELEMENT_TYPES.add(Package_3200);
- KNOWN_ELEMENT_TYPES.add(Comment_3201);
- KNOWN_ELEMENT_TYPES.add(Constraint_3199);
- KNOWN_ELEMENT_TYPES.add(Port_3069);
- KNOWN_ELEMENT_TYPES.add(Component_3070);
- KNOWN_ELEMENT_TYPES.add(Component_3071);
- KNOWN_ELEMENT_TYPES.add(Interface_3072);
- KNOWN_ELEMENT_TYPES.add(Comment_3074);
- KNOWN_ELEMENT_TYPES.add(Constraint_3075);
- KNOWN_ELEMENT_TYPES.add(Usage_4001);
- KNOWN_ELEMENT_TYPES.add(InterfaceRealization_4006);
- KNOWN_ELEMENT_TYPES.add(Generalization_4003);
- KNOWN_ELEMENT_TYPES.add(Substitution_4012);
- KNOWN_ELEMENT_TYPES.add(Manifestation_4014);
- KNOWN_ELEMENT_TYPES.add(ComponentRealization_4007);
- KNOWN_ELEMENT_TYPES.add(Abstraction_4013);
- KNOWN_ELEMENT_TYPES.add(Link_4016);
- KNOWN_ELEMENT_TYPES.add(CommentAnnotatedElement_4015);
- KNOWN_ELEMENT_TYPES.add(ConstraintConstrainedElement_4009);
- KNOWN_ELEMENT_TYPES.add(Dependency_4010);
- }
- return KNOWN_ELEMENT_TYPES.contains(elementType);
- }
-
- /**
- * @generated
- */
- public static IElementType getElementType(int visualID) {
- switch(visualID) {
- case ComponentDiagramEditPart.VISUAL_ID:
- return Model_1000;
- case ComponentEditPart.VISUAL_ID:
- return Component_2002;
- case InterfaceEditPart.VISUAL_ID:
- return Interface_2003;
- case PackageEditPart.VISUAL_ID:
- return Package_3200;
- case CommentEditPart.VISUAL_ID:
- return Comment_3201;
- case ConstraintEditPart.VISUAL_ID:
- return Constraint_3199;
- case PortEditPart.VISUAL_ID:
- return Port_3069;
- case ComponentEditPartCN.VISUAL_ID:
- return Component_3070;
- case ComponentEditPartPCN.VISUAL_ID:
- return Component_3071;
- case InterfaceEditPartPCN.VISUAL_ID:
- return Interface_3072;
- case CommentEditPartPCN.VISUAL_ID:
- return Comment_3074;
- case ConstraintEditPartPCN.VISUAL_ID:
- return Constraint_3075;
- case UsageEditPart.VISUAL_ID:
- return Usage_4001;
- case InterfaceRealizationEditPart.VISUAL_ID:
- return InterfaceRealization_4006;
- case GeneralizationEditPart.VISUAL_ID:
- return Generalization_4003;
- case SubstitutionEditPart.VISUAL_ID:
- return Substitution_4012;
- case ManifestationEditPart.VISUAL_ID:
- return Manifestation_4014;
- case ComponentRealizationEditPart.VISUAL_ID:
- return ComponentRealization_4007;
- case AbstractionEditPart.VISUAL_ID:
- return Abstraction_4013;
- case LinkDescriptorEditPart.VISUAL_ID:
- return Link_4016;
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return CommentAnnotatedElement_4015;
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return ConstraintConstrainedElement_4009;
- case DependencyEditPart.VISUAL_ID:
- return Dependency_4010;
- }
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLIconProvider.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLIconProvider.java
deleted file mode 100644
index 00cf836ebdc..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLIconProvider.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.papyrus.diagram.component.providers;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.ui.services.icon.GetIconOperation;
-import org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @generated
- */
-public class UMLIconProvider extends AbstractProvider implements IIconProvider {
-
- /**
- * @generated
- */
- public Image getIcon(IAdaptable hint, int flags) {
- return UMLElementTypes.getImage(hint);
- }
-
- /**
- * @generated
- */
- public boolean provides(IOperation operation) {
- if(operation instanceof GetIconOperation) {
- return ((GetIconOperation)operation).execute(this) != null;
- }
- return false;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLModelingAssistantProvider.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLModelingAssistantProvider.java
deleted file mode 100644
index 5dc06cb4823..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLModelingAssistantProvider.java
+++ /dev/null
@@ -1,372 +0,0 @@
-package org.eclipse.papyrus.diagram.component.providers;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.ui.services.modelingassistant.ModelingAssistantProvider;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentCompositeCompartmentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.PackageEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PackagePackageableElementCompartmentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart;
-import org.eclipse.papyrus.diagram.component.part.Messages;
-import org.eclipse.papyrus.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
-/**
- * @generated
- */
-public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
-
- /**
- * @generated
- */
- public List getTypesForPopupBar(IAdaptable host) {
- IGraphicalEditPart editPart = (IGraphicalEditPart)host.getAdapter(IGraphicalEditPart.class);
- if(editPart instanceof ComponentDiagramEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(5);
- types.add(UMLElementTypes.Component_2002);
- types.add(UMLElementTypes.Interface_2003);
- types.add(UMLElementTypes.Package_3200);
- types.add(UMLElementTypes.Comment_3201);
- types.add(UMLElementTypes.Constraint_3199);
- return types;
- }
- if(editPart instanceof ComponentEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Port_3069);
- return types;
- }
- if(editPart instanceof ComponentEditPartCN) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Port_3069);
- return types;
- }
- if(editPart instanceof ComponentEditPartPCN) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Port_3069);
- return types;
- }
- if(editPart instanceof ComponentCompositeCompartmentEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Component_3070);
- return types;
- }
- if(editPart instanceof PackagePackageableElementCompartmentEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(4);
- types.add(UMLElementTypes.Interface_3072);
- types.add(UMLElementTypes.Comment_3074);
- types.add(UMLElementTypes.Constraint_3075);
- types.add(UMLElementTypes.Component_3071);
- return types;
- }
- if(editPart instanceof ComponentCompositeCompartmentEditPartCN) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Component_3070);
- return types;
- }
- if(editPart instanceof ComponentCompositeCompartmentEditPartPCN) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Component_3070);
- return types;
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getRelTypesOnSource(IAdaptable source) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
- if(sourceEditPart instanceof ComponentEditPart) {
- return ((ComponentEditPart)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof InterfaceEditPart) {
- return ((InterfaceEditPart)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof PackageEditPart) {
- return ((PackageEditPart)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof CommentEditPart) {
- return ((CommentEditPart)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof ConstraintEditPart) {
- return ((ConstraintEditPart)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof PortEditPart) {
- return ((PortEditPart)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof ComponentEditPartCN) {
- return ((ComponentEditPartCN)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof ComponentEditPartPCN) {
- return ((ComponentEditPartPCN)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof InterfaceEditPartPCN) {
- return ((InterfaceEditPartPCN)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof CommentEditPartPCN) {
- return ((CommentEditPartPCN)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof ConstraintEditPartPCN) {
- return ((ConstraintEditPartPCN)sourceEditPart).getMARelTypesOnSource();
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getRelTypesOnTarget(IAdaptable target) {
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart)target.getAdapter(IGraphicalEditPart.class);
- if(targetEditPart instanceof ComponentEditPart) {
- return ((ComponentEditPart)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- return ((InterfaceEditPart)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof PackageEditPart) {
- return ((PackageEditPart)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof CommentEditPart) {
- return ((CommentEditPart)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- return ((ConstraintEditPart)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof PortEditPart) {
- return ((PortEditPart)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- return ((ComponentEditPartCN)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- return ((ComponentEditPartPCN)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- return ((InterfaceEditPartPCN)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof CommentEditPartPCN) {
- return ((CommentEditPartPCN)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- return ((ConstraintEditPartPCN)targetEditPart).getMARelTypesOnTarget();
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getRelTypesOnSourceAndTarget(IAdaptable source, IAdaptable target) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart)target.getAdapter(IGraphicalEditPart.class);
- if(sourceEditPart instanceof ComponentEditPart) {
- return ((ComponentEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof InterfaceEditPart) {
- return ((InterfaceEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof PackageEditPart) {
- return ((PackageEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof CommentEditPart) {
- return ((CommentEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof ConstraintEditPart) {
- return ((ConstraintEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof PortEditPart) {
- return ((PortEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof ComponentEditPartCN) {
- return ((ComponentEditPartCN)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof ComponentEditPartPCN) {
- return ((ComponentEditPartPCN)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof InterfaceEditPartPCN) {
- return ((InterfaceEditPartPCN)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof CommentEditPartPCN) {
- return ((CommentEditPartPCN)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof ConstraintEditPartPCN) {
- return ((ConstraintEditPartPCN)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getTypesForSource(IAdaptable target, IElementType relationshipType) {
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart)target.getAdapter(IGraphicalEditPart.class);
- if(targetEditPart instanceof ComponentEditPart) {
- return ((ComponentEditPart)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof InterfaceEditPart) {
- return ((InterfaceEditPart)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof PackageEditPart) {
- return ((PackageEditPart)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof CommentEditPart) {
- return ((CommentEditPart)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- return ((ConstraintEditPart)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof PortEditPart) {
- return ((PortEditPart)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof ComponentEditPartCN) {
- return ((ComponentEditPartCN)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof ComponentEditPartPCN) {
- return ((ComponentEditPartPCN)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof InterfaceEditPartPCN) {
- return ((InterfaceEditPartPCN)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof CommentEditPartPCN) {
- return ((CommentEditPartPCN)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof ConstraintEditPartPCN) {
- return ((ConstraintEditPartPCN)targetEditPart).getMATypesForSource(relationshipType);
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getTypesForTarget(IAdaptable source, IElementType relationshipType) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
- if(sourceEditPart instanceof ComponentEditPart) {
- return ((ComponentEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof InterfaceEditPart) {
- return ((InterfaceEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof PackageEditPart) {
- return ((PackageEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof CommentEditPart) {
- return ((CommentEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof ConstraintEditPart) {
- return ((ConstraintEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof PortEditPart) {
- return ((PortEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof ComponentEditPartCN) {
- return ((ComponentEditPartCN)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof ComponentEditPartPCN) {
- return ((ComponentEditPartPCN)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof InterfaceEditPartPCN) {
- return ((InterfaceEditPartPCN)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof CommentEditPartPCN) {
- return ((CommentEditPartPCN)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof ConstraintEditPartPCN) {
- return ((ConstraintEditPartPCN)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public EObject selectExistingElementForSource(IAdaptable target, IElementType relationshipType) {
- return selectExistingElement(target, getTypesForSource(target, relationshipType));
- }
-
- /**
- * @generated
- */
- public EObject selectExistingElementForTarget(IAdaptable source, IElementType relationshipType) {
- return selectExistingElement(source, getTypesForTarget(source, relationshipType));
- }
-
- /**
- * @generated
- */
- protected EObject selectExistingElement(IAdaptable host, Collection types) {
- if(types.isEmpty()) {
- return null;
- }
- IGraphicalEditPart editPart = (IGraphicalEditPart)host.getAdapter(IGraphicalEditPart.class);
- if(editPart == null) {
- return null;
- }
- Diagram diagram = (Diagram)editPart.getRoot().getContents().getModel();
- HashSet<EObject> elements = new HashSet<EObject>();
- for(Iterator<EObject> it = diagram.getElement().eAllContents(); it.hasNext();) {
- EObject element = it.next();
- if(isApplicableElement(element, types)) {
- elements.add(element);
- }
- }
- if(elements.isEmpty()) {
- return null;
- }
- return selectElement((EObject[])elements.toArray(new EObject[elements.size()]));
- }
-
- /**
- * @generated
- */
- protected boolean isApplicableElement(EObject element, Collection types) {
- IElementType type = ElementTypeRegistry.getInstance().getElementType(element);
- return types.contains(type);
- }
-
- /**
- * @generated
- */
- protected EObject selectElement(EObject[] elements) {
- Shell shell = Display.getCurrent().getActiveShell();
- ILabelProvider labelProvider = new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, labelProvider);
- dialog.setMessage(Messages.UMLModelingAssistantProviderMessage);
- dialog.setTitle(Messages.UMLModelingAssistantProviderTitle);
- dialog.setMultipleSelection(false);
- dialog.setElements(elements);
- EObject selected = null;
- if(dialog.open() == Window.OK) {
- selected = (EObject)dialog.getFirstResult();
- }
- return selected;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLParserProvider.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLParserProvider.java
deleted file mode 100644
index 3d40e19a96a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLParserProvider.java
+++ /dev/null
@@ -1,590 +0,0 @@
-package org.eclipse.papyrus.diagram.component.providers;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.ui.services.parser.GetParserOperation;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserProvider;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ParserHintAdapter;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.parser.CommentParser;
-import org.eclipse.papyrus.diagram.common.parser.ConstraintParser;
-import org.eclipse.papyrus.diagram.common.parser.stereotype.AppliedStereotypeParser;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentBodyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentBodyEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentNameEditPartCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentNameEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintNameEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintSpecificationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintSpecificationEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.GeneralizationAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceNameEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PackageNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionNameEditPart;
-import org.eclipse.papyrus.diagram.component.parsers.MessageFormatParser;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class UMLParserProvider extends AbstractProvider implements IParserProvider {
-
- /**
- * @generated
- */
- private IParser componentName_5004Parser;
-
- /**
- * @generated
- */
- private IParser getComponentName_5004Parser() {
- if(componentName_5004Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- componentName_5004Parser = parser;
- }
- return componentName_5004Parser;
- }
-
- /**
- * @generated
- */
- private IParser interfaceName_5005Parser;
-
- /**
- * @generated
- */
- private IParser getInterfaceName_5005Parser() {
- if(interfaceName_5005Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- interfaceName_5005Parser = parser;
- }
- return interfaceName_5005Parser;
- }
-
- /**
- * @generated
- */
- private IParser packageName_5254Parser;
-
- /**
- * @generated
- */
- private IParser getPackageName_5254Parser() {
- if(packageName_5254Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- packageName_5254Parser = parser;
- }
- return packageName_5254Parser;
- }
-
- /**
- * @generated
- */
- private CommentParser commentBody_5255Parser;
-
- /**
- * @generated
- */
- private IParser getCommentBody_5255Parser() {
- if(commentBody_5255Parser == null) {
- commentBody_5255Parser = new CommentParser();
- }
- return commentBody_5255Parser;
- }
-
- /**
- * @generated
- */
- private IParser constraintName_5252Parser;
-
- /**
- * @generated
- */
- private IParser getConstraintName_5252Parser() {
- if(constraintName_5252Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- constraintName_5252Parser = parser;
- }
- return constraintName_5252Parser;
- }
-
- /**
- * @generated
- */
- private ConstraintParser constraintSpecification_5253Parser;
-
- /**
- * @generated
- */
- private IParser getConstraintSpecification_5253Parser() {
- if(constraintSpecification_5253Parser == null) {
- constraintSpecification_5253Parser = new ConstraintParser();
- }
- return constraintSpecification_5253Parser;
- }
-
-
- /**
- * @generated
- */
- private IParser portName_5006Parser;
-
- /**
- * @generated
- */
- private IParser getPortName_5006Parser() {
- if(portName_5006Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- portName_5006Parser = parser;
- }
- return portName_5006Parser;
- }
-
- /**
- * @generated
- */
- private AppliedStereotypeParser portName_5007Parser;
-
- /**
- * @generated
- */
- private IParser getPortName_5007Parser() {
- if(portName_5007Parser == null) {
- portName_5007Parser = new AppliedStereotypeParser();
- }
- return portName_5007Parser;
- }
-
- /**
- * @generated
- */
- private IParser componentName_5256Parser;
-
- /**
- * @generated
- */
- private IParser getComponentName_5256Parser() {
- if(componentName_5256Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- parser.setViewPattern("{0}"); //$NON-NLS-1$
- parser.setEditorPattern("{0}"); //$NON-NLS-1$
- parser.setEditPattern("{0}"); //$NON-NLS-1$
- componentName_5256Parser = parser;
- }
- return componentName_5256Parser;
- }
-
- /**
- * @generated
- */
- private IParser componentName_5257Parser;
-
- /**
- * @generated
- */
- private IParser getComponentName_5257Parser() {
- if(componentName_5257Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- parser.setViewPattern("{0}"); //$NON-NLS-1$
- parser.setEditorPattern("{0}"); //$NON-NLS-1$
- parser.setEditPattern("{0}"); //$NON-NLS-1$
- componentName_5257Parser = parser;
- }
- return componentName_5257Parser;
- }
-
- /**
- * @generated
- */
- private IParser interfaceName_0Parser;
-
- /**
- * @generated
- */
- private IParser getInterfaceName_0Parser() {
- if(interfaceName_0Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- interfaceName_0Parser = parser;
- }
- return interfaceName_0Parser;
- }
-
- /**
- * @generated
- */
- private CommentParser commentBody_5258Parser;
-
- /**
- * @generated
- */
- private IParser getCommentBody_5258Parser() {
- if(commentBody_5258Parser == null) {
- commentBody_5258Parser = new CommentParser();
- }
- return commentBody_5258Parser;
- }
-
- /**
- * @generated
- */
- private IParser constraintName_5259Parser;
-
- /**
- * @generated
- */
- private IParser getConstraintName_5259Parser() {
- if(constraintName_5259Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- constraintName_5259Parser = parser;
- }
- return constraintName_5259Parser;
- }
-
- /**
- * @generated
- */
- private ConstraintParser constraintSpecification_5260Parser;
-
- /**
- * @generated
- */
- private IParser getConstraintSpecification_5260Parser() {
- if(constraintSpecification_5260Parser == null) {
- constraintSpecification_5260Parser = new ConstraintParser();
- }
- return constraintSpecification_5260Parser;
- }
-
-
- /**
- * @generated
- */
- private AppliedStereotypeParser generalizationIsSubstitutable_2Parser;
-
- /**
- * @generated
- */
- private IParser getGeneralizationIsSubstitutable_2Parser() {
- if(generalizationIsSubstitutable_2Parser == null) {
- generalizationIsSubstitutable_2Parser = new AppliedStereotypeParser();
- }
- return generalizationIsSubstitutable_2Parser;
- }
-
- /**
- * @generated
- */
- private IParser substitutionName_6006Parser;
-
- /**
- * @generated
- */
- private IParser getSubstitutionName_6006Parser() {
- if(substitutionName_6006Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- substitutionName_6006Parser = parser;
- }
- return substitutionName_6006Parser;
- }
-
- /**
- * @generated
- */
- private AppliedStereotypeParser substitutionName_6020Parser;
-
- /**
- * @generated
- */
- private IParser getSubstitutionName_6020Parser() {
- if(substitutionName_6020Parser == null) {
- substitutionName_6020Parser = new AppliedStereotypeParser();
- }
- return substitutionName_6020Parser;
- }
-
- /**
- * @generated
- */
- private IParser manifestationName_6008Parser;
-
- /**
- * @generated
- */
- private IParser getManifestationName_6008Parser() {
- if(manifestationName_6008Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- manifestationName_6008Parser = parser;
- }
- return manifestationName_6008Parser;
- }
-
- /**
- * @generated
- */
- private AppliedStereotypeParser manifestationName_6022Parser;
-
- /**
- * @generated
- */
- private IParser getManifestationName_6022Parser() {
- if(manifestationName_6022Parser == null) {
- manifestationName_6022Parser = new AppliedStereotypeParser();
- }
- return manifestationName_6022Parser;
- }
-
- /**
- * @generated
- */
- private IParser componentRealizationName_3Parser;
-
- /**
- * @generated
- */
- private IParser getComponentRealizationName_3Parser() {
- if(componentRealizationName_3Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- componentRealizationName_3Parser = parser;
- }
- return componentRealizationName_3Parser;
- }
-
- /**
- * @generated
- */
- private AppliedStereotypeParser componentRealizationName_4Parser;
-
- /**
- * @generated
- */
- private IParser getComponentRealizationName_4Parser() {
- if(componentRealizationName_4Parser == null) {
- componentRealizationName_4Parser = new AppliedStereotypeParser();
- }
- return componentRealizationName_4Parser;
- }
-
- /**
- * @generated
- */
- private IParser abstractionName_6007Parser;
-
- /**
- * @generated
- */
- private IParser getAbstractionName_6007Parser() {
- if(abstractionName_6007Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- abstractionName_6007Parser = parser;
- }
- return abstractionName_6007Parser;
- }
-
- /**
- * @generated
- */
- private AppliedStereotypeParser abstractionName_6021Parser;
-
- /**
- * @generated
- */
- private IParser getAbstractionName_6021Parser() {
- if(abstractionName_6021Parser == null) {
- abstractionName_6021Parser = new AppliedStereotypeParser();
- }
- return abstractionName_6021Parser;
- }
-
- /**
- * @generated
- */
- private IParser dependencyName_6009Parser;
-
- /**
- * @generated
- */
- private IParser getDependencyName_6009Parser() {
- if(dependencyName_6009Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- dependencyName_6009Parser = parser;
- }
- return dependencyName_6009Parser;
- }
-
- /**
- * @generated
- */
- private AppliedStereotypeParser dependencyName_6023Parser;
-
- /**
- * @generated
- */
- private IParser getDependencyName_6023Parser() {
- if(dependencyName_6023Parser == null) {
- dependencyName_6023Parser = new AppliedStereotypeParser();
- }
- return dependencyName_6023Parser;
- }
-
-
- /**
- * @generated
- */
- protected IParser getParser(int visualID) {
- switch(visualID) {
- case ComponentNameEditPart.VISUAL_ID:
- return getComponentName_5004Parser();
- case InterfaceNameEditPart.VISUAL_ID:
- return getInterfaceName_5005Parser();
- case PackageNameEditPart.VISUAL_ID:
- return getPackageName_5254Parser();
- case CommentBodyEditPart.VISUAL_ID:
- return getCommentBody_5255Parser();
- case ConstraintNameEditPart.VISUAL_ID:
- return getConstraintName_5252Parser();
- case ConstraintSpecificationEditPart.VISUAL_ID:
- return getConstraintSpecification_5253Parser();
- case PortNameEditPart.VISUAL_ID:
- return getPortName_5006Parser();
- case PortAppliedStereotypeEditPart.VISUAL_ID:
- return getPortName_5007Parser();
- case ComponentNameEditPartCN.VISUAL_ID:
- return getComponentName_5256Parser();
- case ComponentNameEditPartPCN.VISUAL_ID:
- return getComponentName_5257Parser();
- case InterfaceNameEditPartPCN.VISUAL_ID:
- return getInterfaceName_0Parser();
- case CommentBodyEditPartPCN.VISUAL_ID:
- return getCommentBody_5258Parser();
- case ConstraintNameEditPartPCN.VISUAL_ID:
- return getConstraintName_5259Parser();
- case ConstraintSpecificationEditPartPCN.VISUAL_ID:
- return getConstraintSpecification_5260Parser();
- case GeneralizationAppliedStereotypeEditPart.VISUAL_ID:
- return getGeneralizationIsSubstitutable_2Parser();
- case SubstitutionNameEditPart.VISUAL_ID:
- return getSubstitutionName_6006Parser();
- case SubstitutionAppliedStereotypeEditPart.VISUAL_ID:
- return getSubstitutionName_6020Parser();
- case ManifestationNameEditPart.VISUAL_ID:
- return getManifestationName_6008Parser();
- case ManifestationAppliedStereotypeEditPart.VISUAL_ID:
- return getManifestationName_6022Parser();
- case ComponentRealizationNameEditPart.VISUAL_ID:
- return getComponentRealizationName_3Parser();
- case ComponentRealizationAppliedStereotypeEditPart.VISUAL_ID:
- return getComponentRealizationName_4Parser();
- case AbstractionNameEditPart.VISUAL_ID:
- return getAbstractionName_6007Parser();
- case AbstractionAppliedStereotypeEditPart.VISUAL_ID:
- return getAbstractionName_6021Parser();
- case DependencyNameEditPart.VISUAL_ID:
- return getDependencyName_6009Parser();
- case DependencyAppliedStereotypeEditPart.VISUAL_ID:
- return getDependencyName_6023Parser();
- }
- return null;
- }
-
- /**
- * Utility method that consults ParserService
- * @generated
- */
- public static IParser getParser(IElementType type, EObject object, String parserHint) {
- return ParserService.getInstance().getParser(new HintAdapter(type, object, parserHint));
- }
-
- /**
- * @generated
- */
- public IParser getParser(IAdaptable hint) {
- String vid = (String)hint.getAdapter(String.class);
- if(vid != null) {
- return getParser(UMLVisualIDRegistry.getVisualID(vid));
- }
- View view = (View)hint.getAdapter(View.class);
- if(view != null) {
- return getParser(UMLVisualIDRegistry.getVisualID(view));
- }
- return null;
- }
-
- /**
- * @generated
- */
- public boolean provides(IOperation operation) {
- if(operation instanceof GetParserOperation) {
- IAdaptable hint = ((GetParserOperation)operation).getHint();
- if(UMLElementTypes.getElement(hint) == null) {
- return false;
- }
- return getParser(hint) != null;
- }
- return false;
- }
-
- /**
- * @generated
- */
- private static class HintAdapter extends ParserHintAdapter {
-
- /**
- * @generated
- */
- private final IElementType elementType;
-
- /**
- * @generated
- */
- public HintAdapter(IElementType type, EObject object, String parserHint) {
- super(object, parserHint);
- assert type != null;
- elementType = type;
- }
-
- /**
- * @generated
- */
- public Object getAdapter(Class adapter) {
- if(IElementType.class.equals(adapter)) {
- return elementType;
- }
- return super.getAdapter(adapter);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLViewProvider.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLViewProvider.java
deleted file mode 100644
index 918be2884a5..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/providers/UMLViewProvider.java
+++ /dev/null
@@ -1,1206 +0,0 @@
-package org.eclipse.papyrus.diagram.component.providers;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EcoreFactory;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.core.providers.IViewProvider;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.notation.Connector;
-import org.eclipse.gmf.runtime.notation.DecorationNode;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.FillStyle;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.Location;
-import org.eclipse.gmf.runtime.notation.MeasurementUnit;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.RelativeBendpoints;
-import org.eclipse.gmf.runtime.notation.Shape;
-import org.eclipse.gmf.runtime.notation.TitleStyle;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.AbstractionNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentBodyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentBodyEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.CommentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentCompositeCompartmentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentDiagramEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentNameEditPartCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentNameEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ComponentRealizationNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintNameEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintSpecificationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ConstraintSpecificationEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.DependencyNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.GeneralizationAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceNameEditPartPCN;
-import org.eclipse.papyrus.diagram.component.edit.parts.InterfaceRealizationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.LinkDescriptorEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.ManifestationNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PackageEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PackageNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PackagePackageableElementCompartmentEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.PortNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.SubstitutionNameEditPart;
-import org.eclipse.papyrus.diagram.component.edit.parts.UsageEditPart;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontData;
-
-/**
- * @generated
- */
-public class UMLViewProvider extends AbstractProvider implements IViewProvider {
-
- /**
- * @generated
- */
- public final boolean provides(IOperation operation) {
- if(operation instanceof CreateViewForKindOperation) {
- return provides((CreateViewForKindOperation)operation);
- }
- assert operation instanceof CreateViewOperation;
- if(operation instanceof CreateDiagramViewOperation) {
- return provides((CreateDiagramViewOperation)operation);
- } else if(operation instanceof CreateEdgeViewOperation) {
- return provides((CreateEdgeViewOperation)operation);
- } else if(operation instanceof CreateNodeViewOperation) {
- return provides((CreateNodeViewOperation)operation);
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateViewForKindOperation op) {
- /*
- if (op.getViewKind() == Node.class)
- return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
- if (op.getViewKind() == Edge.class)
- return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
- */
- return true;
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateDiagramViewOperation op) {
- return ComponentDiagramEditPart.MODEL_ID.equals(op.getSemanticHint()) && UMLVisualIDRegistry.getDiagramVisualID(getSemanticElement(op.getSemanticAdapter())) != -1;
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateNodeViewOperation op) {
- if(op.getContainerView() == null) {
- return false;
- }
- IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
- EObject domainElement = getSemanticElement(op.getSemanticAdapter());
- int visualID;
- if(op.getSemanticHint() == null) {
- // Semantic hint is not specified. Can be a result of call from CanonicalEditPolicy.
- // In this situation there should be NO elementType, visualID will be determined
- // by VisualIDRegistry.getNodeVisualID() for domainElement.
- if(elementType != null || domainElement == null) {
- return false;
- }
- visualID = UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement);
- } else {
- visualID = UMLVisualIDRegistry.getVisualID(op.getSemanticHint());
- if(elementType != null) {
- if(!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
- return false; // foreign element type
- }
- String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
- if(!op.getSemanticHint().equals(elementTypeHint)) {
- return false; // if semantic hint is specified it should be the same as in element type
- }
- if(domainElement != null && visualID != UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
- return false; // visual id for node EClass should match visual id from element type
- }
- } else {
- if(!ComponentDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(op.getContainerView()))) {
- return false; // foreign diagram
- }
- switch(visualID) {
- case ComponentEditPart.VISUAL_ID:
- case InterfaceEditPart.VISUAL_ID:
- case PackageEditPart.VISUAL_ID:
- case CommentEditPart.VISUAL_ID:
- case ConstraintEditPart.VISUAL_ID:
- case PortEditPart.VISUAL_ID:
- case ComponentEditPartCN.VISUAL_ID:
- case ComponentEditPartPCN.VISUAL_ID:
- case InterfaceEditPartPCN.VISUAL_ID:
- case CommentEditPartPCN.VISUAL_ID:
- case ConstraintEditPartPCN.VISUAL_ID:
- if(domainElement == null || visualID != UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
- return false; // visual id in semantic hint should match visual id for domain element
- }
- break;
- default:
- return false;
- }
- }
- }
- return ComponentEditPart.VISUAL_ID == visualID || InterfaceEditPart.VISUAL_ID == visualID || PackageEditPart.VISUAL_ID == visualID || CommentEditPart.VISUAL_ID == visualID || ConstraintEditPart.VISUAL_ID == visualID || PortEditPart.VISUAL_ID == visualID || ComponentEditPartCN.VISUAL_ID == visualID || ComponentEditPartPCN.VISUAL_ID == visualID || InterfaceEditPartPCN.VISUAL_ID == visualID || CommentEditPartPCN.VISUAL_ID == visualID || ConstraintEditPartPCN.VISUAL_ID == visualID;
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateEdgeViewOperation op) {
- IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
- if(!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
- return false; // foreign element type
- }
- String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
- if(elementTypeHint == null || (op.getSemanticHint() != null && !elementTypeHint.equals(op.getSemanticHint()))) {
- return false; // our hint is visual id and must be specified, and it should be the same as in element type
- }
- int visualID = UMLVisualIDRegistry.getVisualID(elementTypeHint);
- EObject domainElement = getSemanticElement(op.getSemanticAdapter());
- if(domainElement != null && visualID != UMLVisualIDRegistry.getLinkWithClassVisualID(domainElement)) {
- return false; // visual id for link EClass should match visual id from element type
- }
- return true;
- }
-
- /**
- * @generated
- */
- public Diagram createDiagram(IAdaptable semanticAdapter, String diagramKind, PreferencesHint preferencesHint) {
- Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
- diagram.getStyles().add(NotationFactory.eINSTANCE.createDiagramStyle());
- diagram.setType(ComponentDiagramEditPart.MODEL_ID);
- diagram.setElement(getSemanticElement(semanticAdapter));
- diagram.setMeasurementUnit(MeasurementUnit.PIXEL_LITERAL);
- return diagram;
- }
-
- /**
- * @generated
- */
- public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
- final EObject domainElement = getSemanticElement(semanticAdapter);
- final int visualID;
- if(semanticHint == null) {
- visualID = UMLVisualIDRegistry.getNodeVisualID(containerView, domainElement);
- } else {
- visualID = UMLVisualIDRegistry.getVisualID(semanticHint);
- }
- switch(visualID) {
- case ComponentEditPart.VISUAL_ID:
- return createComponent_2002(domainElement, containerView, index, persisted, preferencesHint);
- case InterfaceEditPart.VISUAL_ID:
- return createInterface_2003(domainElement, containerView, index, persisted, preferencesHint);
- case PackageEditPart.VISUAL_ID:
- return createPackage_3200(domainElement, containerView, index, persisted, preferencesHint);
- case CommentEditPart.VISUAL_ID:
- return createComment_3201(domainElement, containerView, index, persisted, preferencesHint);
- case ConstraintEditPart.VISUAL_ID:
- return createConstraint_3199(domainElement, containerView, index, persisted, preferencesHint);
- case PortEditPart.VISUAL_ID:
- return createPort_3069(domainElement, containerView, index, persisted, preferencesHint);
- case ComponentEditPartCN.VISUAL_ID:
- return createComponent_3070(domainElement, containerView, index, persisted, preferencesHint);
- case ComponentEditPartPCN.VISUAL_ID:
- return createComponent_3071(domainElement, containerView, index, persisted, preferencesHint);
- case InterfaceEditPartPCN.VISUAL_ID:
- return createInterface_3072(domainElement, containerView, index, persisted, preferencesHint);
- case CommentEditPartPCN.VISUAL_ID:
- return createComment_3074(domainElement, containerView, index, persisted, preferencesHint);
- case ConstraintEditPartPCN.VISUAL_ID:
- return createConstraint_3075(domainElement, containerView, index, persisted, preferencesHint);
- }
- // can't happen, provided #provides(CreateNodeViewOperation) is correct
- return null;
- }
-
- /**
- * @generated
- */
- public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
- IElementType elementType = getSemanticElementType(semanticAdapter);
- String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
- switch(UMLVisualIDRegistry.getVisualID(elementTypeHint)) {
- case UsageEditPart.VISUAL_ID:
- return createUsage_4001(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
- case InterfaceRealizationEditPart.VISUAL_ID:
- return createInterfaceRealization_4006(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
- case GeneralizationEditPart.VISUAL_ID:
- return createGeneralization_4003(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
- case SubstitutionEditPart.VISUAL_ID:
- return createSubstitution_4012(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
- case ManifestationEditPart.VISUAL_ID:
- return createManifestation_4014(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
- case ComponentRealizationEditPart.VISUAL_ID:
- return createComponentRealization_4007(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
- case AbstractionEditPart.VISUAL_ID:
- return createAbstraction_4013(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
- case LinkDescriptorEditPart.VISUAL_ID:
- return createLink_4016(containerView, index, persisted, preferencesHint);
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return createCommentAnnotatedElement_4015(containerView, index, persisted, preferencesHint);
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return createConstraintConstrainedElement_4009(containerView, index, persisted, preferencesHint);
- case DependencyEditPart.VISUAL_ID:
- return createDependency_4010(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
- }
- // can never happen, provided #provides(CreateEdgeViewOperation) is correct
- return null;
- }
-
- /**
- * @generated
- */
- public Node createComponent_2002(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Node node = NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(ComponentEditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Component");
-
- Node label5004 = createLabel(node, UMLVisualIDRegistry.getType(ComponentNameEditPart.VISUAL_ID));
- createCompartment(node, UMLVisualIDRegistry.getType(ComponentCompositeCompartmentEditPart.VISUAL_ID), true, false, false, false);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Component");
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createInterface_2003(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Node node = NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFillStyle());
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(InterfaceEditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Interface");
-
-
-
- PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Interface");
-
- Node label5005 = createLabel(node, UMLVisualIDRegistry.getType(InterfaceNameEditPart.VISUAL_ID));
- label5005.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
-
- Location location5005 = (Location)label5005.getLayoutConstraint();
- location5005.setX(0);
- location5005.setY(5);
-
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createPackage_3200(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(PackageEditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Package");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Package");
-
-
-
- PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Package");
-
- Node label5254 = createLabel(node, UMLVisualIDRegistry.getType(PackageNameEditPart.VISUAL_ID));
- createCompartment(node, UMLVisualIDRegistry.getType(PackagePackageableElementCompartmentEditPart.VISUAL_ID), false, false, false, false);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Package");
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createComment_3201(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(CommentEditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Comment");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Comment");
-
-
-
- PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Comment");
-
- Node label5255 = createLabel(node, UMLVisualIDRegistry.getType(CommentBodyEditPart.VISUAL_ID));
-
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createConstraint_3199(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Constraint");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Constraint");
-
-
-
- PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Constraint");
-
- Node label5252 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintNameEditPart.VISUAL_ID));
- Node label5253 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintSpecificationEditPart.VISUAL_ID));
-
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createPort_3069(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(PortEditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Port");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Port");
-
-
-
- PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Port");
-
- Node label5006 = createLabel(node, UMLVisualIDRegistry.getType(PortNameEditPart.VISUAL_ID));
- label5006.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
-
- Location location5006 = (Location)label5006.getLayoutConstraint();
- location5006.setX(0);
- location5006.setY(5);
- Node label5007 = createLabel(node, UMLVisualIDRegistry.getType(PortAppliedStereotypeEditPart.VISUAL_ID));
- label5007.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
-
- Location location5007 = (Location)label5007.getLayoutConstraint();
- location5007.setX(25);
- location5007.setY(-10);
-
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createComponent_3070(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Node node = NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(ComponentEditPartCN.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Component");
-
- Node label5256 = createLabel(node, UMLVisualIDRegistry.getType(ComponentNameEditPartCN.VISUAL_ID));
- createCompartment(node, UMLVisualIDRegistry.getType(ComponentCompositeCompartmentEditPartCN.VISUAL_ID), true, false, false, false);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Component");
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createComponent_3071(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Node node = NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(ComponentEditPartPCN.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Component");
-
- Node label5257 = createLabel(node, UMLVisualIDRegistry.getType(ComponentNameEditPartPCN.VISUAL_ID));
- createCompartment(node, UMLVisualIDRegistry.getType(ComponentCompositeCompartmentEditPartPCN.VISUAL_ID), true, false, false, false);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Component");
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createInterface_3072(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Node node = NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFillStyle());
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(InterfaceEditPartPCN.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Interface");
-
-
-
- PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Interface");
-
- Node label0 = createLabel(node, UMLVisualIDRegistry.getType(InterfaceNameEditPartPCN.VISUAL_ID));
- label0.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
-
- Location location0 = (Location)label0.getLayoutConstraint();
- location0.setX(0);
- location0.setY(5);
-
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createComment_3074(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(CommentEditPartPCN.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Comment");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Comment");
-
-
-
- PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Comment");
-
- Node label5258 = createLabel(node, UMLVisualIDRegistry.getType(CommentBodyEditPartPCN.VISUAL_ID));
-
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createConstraint_3075(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(ConstraintEditPartPCN.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Constraint");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Constraint");
-
-
-
- PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Constraint");
-
- Node label5259 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintNameEditPartPCN.VISUAL_ID));
- Node label5260 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintSpecificationEditPartPCN.VISUAL_ID));
-
-
- return node;
- }
-
- /**
- * @generated
- */
- public Edge createUsage_4001(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID));
- edge.setElement(domainElement);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Usage");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Usage");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Usage");
-
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createInterfaceRealization_4006(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Edge edge = NotationFactory.eINSTANCE.createEdge();
- edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle());
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(InterfaceRealizationEditPart.VISUAL_ID));
- edge.setElement(domainElement);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "InterfaceRealization");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "InterfaceRealization");
-
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createGeneralization_4003(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID));
- edge.setElement(domainElement);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Generalization");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Generalization");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Generalization");
-
- Node label2 = createLabel(edge, UMLVisualIDRegistry.getType(GeneralizationAppliedStereotypeEditPart.VISUAL_ID));
- label2.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location2 = (Location)label2.getLayoutConstraint();
- location2.setX(0);
- location2.setY(60);
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createSubstitution_4012(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(SubstitutionEditPart.VISUAL_ID));
- edge.setElement(domainElement);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Substitution");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Substitution");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Substitution");
-
- Node label6006 = createLabel(edge, UMLVisualIDRegistry.getType(SubstitutionNameEditPart.VISUAL_ID));
- label6006.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6006 = (Location)label6006.getLayoutConstraint();
- location6006.setX(0);
- location6006.setY(60);
- Node label6020 = createLabel(edge, UMLVisualIDRegistry.getType(SubstitutionAppliedStereotypeEditPart.VISUAL_ID));
- label6020.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6020 = (Location)label6020.getLayoutConstraint();
- location6020.setX(0);
- location6020.setY(30);
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createManifestation_4014(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(ManifestationEditPart.VISUAL_ID));
- edge.setElement(domainElement);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Manifestation");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Manifestation");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Manifestation");
-
- Node label6008 = createLabel(edge, UMLVisualIDRegistry.getType(ManifestationNameEditPart.VISUAL_ID));
- label6008.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6008 = (Location)label6008.getLayoutConstraint();
- location6008.setX(0);
- location6008.setY(60);
- Node label6022 = createLabel(edge, UMLVisualIDRegistry.getType(ManifestationAppliedStereotypeEditPart.VISUAL_ID));
- label6022.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6022 = (Location)label6022.getLayoutConstraint();
- location6022.setX(0);
- location6022.setY(30);
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createComponentRealization_4007(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(ComponentRealizationEditPart.VISUAL_ID));
- edge.setElement(domainElement);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "ComponentRealization");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "ComponentRealization");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "ComponentRealization");
-
- Node label3 = createLabel(edge, UMLVisualIDRegistry.getType(ComponentRealizationNameEditPart.VISUAL_ID));
- label3.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location3 = (Location)label3.getLayoutConstraint();
- location3.setX(0);
- location3.setY(60);
- Node label4 = createLabel(edge, UMLVisualIDRegistry.getType(ComponentRealizationAppliedStereotypeEditPart.VISUAL_ID));
- label4.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location4 = (Location)label4.getLayoutConstraint();
- location4.setX(0);
- location4.setY(30);
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createAbstraction_4013(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(AbstractionEditPart.VISUAL_ID));
- edge.setElement(domainElement);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Abstraction");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Abstraction");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Abstraction");
-
- Node label6007 = createLabel(edge, UMLVisualIDRegistry.getType(AbstractionNameEditPart.VISUAL_ID));
- label6007.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6007 = (Location)label6007.getLayoutConstraint();
- location6007.setX(0);
- location6007.setY(60);
- Node label6021 = createLabel(edge, UMLVisualIDRegistry.getType(AbstractionAppliedStereotypeEditPart.VISUAL_ID));
- label6021.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6021 = (Location)label6021.getLayoutConstraint();
- location6021.setX(0);
- location6021.setY(30);
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createLink_4016(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(LinkDescriptorEditPart.VISUAL_ID));
- edge.setElement(null);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Undefined");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Undefined");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Undefined");
-
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createCommentAnnotatedElement_4015(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(CommentAnnotatedElementEditPart.VISUAL_ID));
- edge.setElement(null);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "CommentAnnotatedElement");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "CommentAnnotatedElement");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "CommentAnnotatedElement");
-
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createConstraintConstrainedElement_4009(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
- edge.setElement(null);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "ConstraintConstrainedElement");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "ConstraintConstrainedElement");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "ConstraintConstrainedElement");
-
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createDependency_4010(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(DependencyEditPart.VISUAL_ID));
- edge.setElement(domainElement);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Dependency");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Dependency");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Dependency");
-
- Node label6009 = createLabel(edge, UMLVisualIDRegistry.getType(DependencyNameEditPart.VISUAL_ID));
- label6009.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6009 = (Location)label6009.getLayoutConstraint();
- location6009.setX(0);
- location6009.setY(60);
- Node label6023 = createLabel(edge, UMLVisualIDRegistry.getType(DependencyAppliedStereotypeEditPart.VISUAL_ID));
- label6023.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6023 = (Location)label6023.getLayoutConstraint();
- location6023.setX(0);
- location6023.setY(60);
- return edge;
- }
-
-
-
- /**
- * @generated
- */
- protected void stampShortcut(View containerView, Node target) {
- if(!ComponentDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
- EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
- shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
- shortcutAnnotation.getDetails().put("modelID", ComponentDiagramEditPart.MODEL_ID); //$NON-NLS-1$
- target.getEAnnotations().add(shortcutAnnotation);
- }
- }
-
-
- /**
- * @generated
- */
- protected Node createLabel(View owner, String hint) {
- DecorationNode rv = NotationFactory.eINSTANCE.createDecorationNode();
- rv.setType(hint);
- ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true);
- return rv;
- }
-
-
- /**
- * @generated
- */
- protected Node createCompartment(View owner, String hint, boolean canCollapse, boolean hasTitle, boolean canSort, boolean canFilter) {
- //SemanticListCompartment rv = NotationFactory.eINSTANCE.createSemanticListCompartment();
- //rv.setShowTitle(showTitle);
- //rv.setCollapsed(isCollapsed);
- Node rv;
- if(canCollapse) {
- rv = NotationFactory.eINSTANCE.createBasicCompartment();
- } else {
- rv = NotationFactory.eINSTANCE.createDecorationNode();
- }
- rv.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
-
- if(hasTitle) {
- TitleStyle ts = NotationFactory.eINSTANCE.createTitleStyle();
- ts.setShowTitle(true);
- rv.getStyles().add(ts);
- }
- if(canSort) {
- rv.getStyles().add(NotationFactory.eINSTANCE.createSortingStyle());
- }
- if(canFilter) {
- rv.getStyles().add(NotationFactory.eINSTANCE.createFilteringStyle());
- }
- rv.setType(hint);
- ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true);
- return rv;
- }
-
- /**
- * @generated
- */
- protected EObject getSemanticElement(IAdaptable semanticAdapter) {
- if(semanticAdapter == null) {
- return null;
- }
- EObject eObject = (EObject)semanticAdapter.getAdapter(EObject.class);
- if(eObject != null) {
- return EMFCoreUtil.resolve(TransactionUtil.getEditingDomain(eObject), eObject);
- }
- return null;
- }
-
-
- /**
- * @generated
- */
- protected IElementType getSemanticElementType(IAdaptable semanticAdapter) {
- if(semanticAdapter == null) {
- return null;
- }
- return (IElementType)semanticAdapter.getAdapter(IElementType.class);
- }
-
-
- /**
- * @generated
- */
- private void initFontStyleFromPrefs(View view, final IPreferenceStore store, String elementName) {
- String fontConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.FONT);
- String fontColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FONT);
-
- FontStyle viewFontStyle = (FontStyle)view.getStyle(NotationPackage.Literals.FONT_STYLE);
- if(viewFontStyle != null) {
- FontData fontData = PreferenceConverter.getFontData(store, fontConstant);
- viewFontStyle.setFontName(fontData.getName());
- viewFontStyle.setFontHeight(fontData.getHeight());
- viewFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
- viewFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
-
- org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(store, fontColorConstant);
- viewFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
- }
- }
-
- /**
- * @generated
- */
- private void initForegroundFromPrefs(View view, final IPreferenceStore store, String elementName) {
- String lineColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_LINE);
- org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(store, lineColorConstant);
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
- }
-
- /**
- * @generated
- */
- private void initBackgroundFromPrefs(View view, final IPreferenceStore store, String elementName) {
- String fillColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FILL);
- String gradientColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_GRADIENT);
- String gradientPolicyConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.GRADIENT_POLICY);
-
-
- org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(store, fillColorConstant);
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
-
-
- FillStyle fillStyle = (FillStyle)view.getStyle(NotationPackage.Literals.FILL_STYLE);
- fillStyle.setFillColor(FigureUtilities.RGBToInteger(fillRGB).intValue());
-
- ;
- if(store.getBoolean(gradientPolicyConstant)) {
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(store.getString(gradientColorConstant));
- fillStyle.setGradient(gradientPreferenceConverter.getGradientData());
- fillStyle.setTransparency(gradientPreferenceConverter.getTransparency());
- }
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/sheet/UMLPropertySection.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/sheet/UMLPropertySection.java
deleted file mode 100644
index e5aa2061aab..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/sheet/UMLPropertySection.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package org.eclipse.papyrus.diagram.component.sheet;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.provider.IItemPropertySource;
-import org.eclipse.emf.edit.ui.provider.PropertySource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.properties.sections.AdvancedPropertySection;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-
-/**
- * @generated
- */
-public class UMLPropertySection extends AdvancedPropertySection implements IPropertySourceProvider {
-
- /**
- * @generated
- */
- public IPropertySource getPropertySource(Object object) {
- if(object instanceof IPropertySource) {
- return (IPropertySource)object;
- }
- AdapterFactory af = getAdapterFactory(object);
- if(af != null) {
- IItemPropertySource ips = (IItemPropertySource)af.adapt(object, IItemPropertySource.class);
- if(ips != null) {
- return new PropertySource(object, ips);
- }
- }
- if(object instanceof IAdaptable) {
- return (IPropertySource)((IAdaptable)object).getAdapter(IPropertySource.class);
- }
- return null;
- }
-
-
-
- /**
- * @generated
- */
- protected IPropertySourceProvider getPropertySourceProvider() {
- return this;
- }
-
-
- /**
- * Modify/unwrap selection.
- * @generated
- */
- protected Object transformSelection(Object selected) {
-
- if(selected instanceof EditPart) {
- Object model = ((EditPart)selected).getModel();
- return model instanceof View ? ((View)model).getElement() : null;
- }
- if(selected instanceof View) {
- return ((View)selected).getElement();
- }
- if(selected instanceof IAdaptable) {
- View view = (View)((IAdaptable)selected).getAdapter(View.class);
- if(view != null) {
- return view.getElement();
- }
- }
- return selected;
- }
-
-
- /**
- * @generated
- */
- public void setInput(IWorkbenchPart part, ISelection selection) {
- if(selection.isEmpty() || false == selection instanceof StructuredSelection) {
- super.setInput(part, selection);
- return;
- }
- final StructuredSelection structuredSelection = ((StructuredSelection)selection);
- ArrayList transformedSelection = new ArrayList(structuredSelection.size());
- for(Iterator it = structuredSelection.iterator(); it.hasNext();) {
- Object r = transformSelection(it.next());
- if(r != null) {
- transformedSelection.add(r);
- }
- }
- super.setInput(part, new StructuredSelection(transformedSelection));
- }
-
-
- /**
- * @generated
- */
- protected AdapterFactory getAdapterFactory(Object object) {
- if(getEditingDomain() instanceof AdapterFactoryEditingDomain) {
- return ((AdapterFactoryEditingDomain)getEditingDomain()).getAdapterFactory();
- }
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(object);
- if(editingDomain != null) {
- return ((AdapterFactoryEditingDomain)editingDomain).getAdapterFactory();
- }
- return null;
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/sheet/UMLSheetLabelProvider.java b/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/sheet/UMLSheetLabelProvider.java
deleted file mode 100644
index 2b18cdc41bc..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.component/src/org/eclipse/papyrus/diagram/component/sheet/UMLSheetLabelProvider.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.eclipse.papyrus.diagram.component.sheet;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.diagram.component.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.component.providers.UMLElementTypes;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @generated
- */
-public class UMLSheetLabelProvider extends BaseLabelProvider implements ILabelProvider {
-
-
- /**
- * @generated
- */
- public String getText(Object element) {
- element = unwrap(element);
- IElementType etype = getElementType(getView(element));
- return etype == null ? "" : etype.getDisplayName();
- }
-
-
- /**
- * @generated
- */
- public Image getImage(Object element) {
- IElementType etype = getElementType(getView(unwrap(element)));
- return etype == null ? null : UMLElementTypes.getImage(etype);
- }
-
-
- /**
- * @generated
- */
- private Object unwrap(Object element) {
- if(element instanceof IStructuredSelection) {
- return ((IStructuredSelection)element).getFirstElement();
- }
- return element;
- }
-
- /**
- * @generated
- */
- private View getView(Object element) {
- if(element instanceof View) {
- return (View)element;
- }
- if(element instanceof IAdaptable) {
- return (View)((IAdaptable)element).getAdapter(View.class);
- }
- return null;
- }
-
- /**
- * @generated
- */
- private IElementType getElementType(View view) {
- // For intermediate views climb up the containment hierarchy to find the one associated with an element type.
- while(view != null) {
- int vid = UMLVisualIDRegistry.getVisualID(view);
- IElementType etype = UMLElementTypes.getElementType(vid);
- if(etype != null) {
- return etype;
- }
- view = view.eContainer() instanceof View ? (View)view.eContainer() : null;
- }
- return null;
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/.classpath b/incoming/org.eclipse.papyrus.diagram.deployment/.classpath
deleted file mode 100644
index b2164fd1b7f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="custom-src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/.options b/incoming/org.eclipse.papyrus.diagram.deployment/.options
deleted file mode 100644
index 1cb9907401a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/.options
+++ /dev/null
@@ -1,7 +0,0 @@
-# Tracing options for the org.eclipse.papyrus.diagram.deployment plug-in
-
-# Common issues
-org.eclipse.papyrus.diagram.deployment/debug=false
-
-# Visual IDs
-org.eclipse.papyrus.diagram.deployment/debug/visualID=false
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/.project b/incoming/org.eclipse.papyrus.diagram.deployment/.project
deleted file mode 100644
index 0f9669f8ba6..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.diagram.deployment</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/META-INF/MANIFEST.MF b/incoming/org.eclipse.papyrus.diagram.deployment/META-INF/MANIFEST.MF
deleted file mode 100644
index 2a00d46877d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,56 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.papyrus.diagram.deployment; singleton:=true
-Bundle-Version: 0.8.0.qualifier
-Bundle-Activator: org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin
-Bundle-Vendor: %providerName
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.eclipse.core.expressions,
- org.eclipse.jface,
- org.eclipse.ui.ide,
- org.eclipse.ui.views,
- org.eclipse.ui.navigator,
- org.eclipse.ui.navigator.resources,
- org.eclipse.emf.ecore,
- org.eclipse.emf.ecore.xmi,
- org.eclipse.emf.edit.ui,
- org.eclipse.gmf.runtime.emf.core,
- org.eclipse.gmf.runtime.emf.commands.core,
- org.eclipse.gmf.runtime.emf.ui.properties,
- org.eclipse.gmf.runtime.diagram.ui,
- org.eclipse.gmf.runtime.diagram.ui.properties,
- org.eclipse.gmf.runtime.diagram.ui.providers,
- org.eclipse.gmf.runtime.diagram.ui.providers.ide,
- org.eclipse.gmf.runtime.diagram.ui.render,
- org.eclipse.gmf.runtime.diagram.ui.resources.editor,
- org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide,
- org.eclipse.draw2d;visibility:=reexport,
- org.eclipse.gmf.runtime.draw2d.ui;visibility:=reexport,
- org.eclipse.uml2.uml;visibility:=reexport,
- org.eclipse.uml2.uml.edit;visibility:=reexport,
- org.eclipse.emf.ecore;visibility:=reexport,
- org.eclipse.emf.ecore.edit;visibility:=reexport,
- org.eclipse.ocl.ecore;visibility:=reexport,
- org.eclipse.gef,
- org.eclipse.papyrus.preferences,
- org.eclipse.papyrus.extensionpoints.editors,
- org.eclipse.papyrus.service.edit,
- org.eclipse.papyrus.diagram.common
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Export-Package: org.eclipse.papyrus.diagram.deployment.edit.parts,
- org.eclipse.papyrus.diagram.deployment.part,
- org.eclipse.papyrus.diagram.deployment.providers
-Import-Package: org.eclipse.papyrus.core.adaptor.gmf,
- org.eclipse.papyrus.diagram.common.figure.node,
- org.eclipse.papyrus.diagram.deployment.edit.parts,
- org.eclipse.papyrus.diagram.deployment.part,
- org.eclipse.papyrus.editor,
- org.eclipse.papyrus.service.edit.service,
- org.eclipse.papyrus.uml.service.types.element
-Eclipse-LazyStart: true
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/about.html b/incoming/org.eclipse.papyrus.diagram.deployment/about.html
deleted file mode 100644
index 82d49bf5f81..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/build.properties b/incoming/org.eclipse.papyrus.diagram.deployment/build.properties
deleted file mode 100644
index cf473991117..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-bin.includes = .,\
- icons/,\
- META-INF/,\
- plugin.xml,\
- plugin.properties,\
- messages.properties,\
- about.html
-jars.compile.order = .
-source.. = src/,\
- custom-src/
-output.. = bin/
-src.includes = about.html,\
- model/,\
- icons/,\
- messages.properties
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/CreateDeploymentDiagramCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/CreateDeploymentDiagramCommand.java
deleted file mode 100644
index f5d822015fc..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/CreateDeploymentDiagramCommand.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment;
-
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.papyrus.core.adaptor.gmf.AbstractPapyrusGmfCreateDiagramCommandHandler;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-
-
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class CreateDeploymentDiagramCommand.
- */
-public class CreateDeploymentDiagramCommand extends AbstractPapyrusGmfCreateDiagramCommandHandler {
-
-
-
-
- /**
- * Gets the default diagram name.
- *
- * @return the default diagram name
- * @see org.eclipse.papyrus.core.adaptor.gmf.AbstractPapyrusGmfCreateDiagramCommandHandler#getDefaultDiagramName()
- */
-
- @Override
- protected String getDefaultDiagramName() {
- return "NewDeploymentDiagram";
- }
-
-
-
-
-
- /**
- * Gets the diagram notation id.
- *
- * @return the diagram notation id
- * @see org.eclipse.papyrus.core.adaptor.gmf.AbstractPapyrusGmfCreateDiagramCommandHandler#getDiagramNotationID()
- */
-
- @Override
- protected String getDiagramNotationID() {
- return DeploymentDiagramEditPart.MODEL_ID;
- }
-
-
-
- /**
- * Gets the preference hint.
- *
- * @return the preference hint
- * @see org.eclipse.papyrus.core.adaptor.gmf.AbstractPapyrusGmfCreateDiagramCommandHandler#getPreferenceHint()
- */
-
- @Override
- protected PreferencesHint getPreferenceHint() {
- return org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/DeploymentDiagramEditorFactory.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/DeploymentDiagramEditorFactory.java
deleted file mode 100644
index 75bb49baaff..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/DeploymentDiagramEditorFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment;
-
-import org.eclipse.papyrus.core.adaptor.gmf.GmfEditorFactory;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-
-
-// TODO: Auto-generated Javadoc
-/**
- * A factory for creating DeploymentDiagramEditor objects.
- */
-public class DeploymentDiagramEditorFactory extends GmfEditorFactory {
-
-
- /**
- * Instantiates a new deployment diagram editor factory.
- */
- public DeploymentDiagramEditorFactory() {
- super(UmlDeploymentDiagramForMultiEditor.class, DeploymentDiagramEditPart.MODEL_ID);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/UmlDeploymentDiagramForMultiEditor.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/UmlDeploymentDiagramForMultiEditor.java
deleted file mode 100644
index 693bad6e9d7..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/UmlDeploymentDiagramForMultiEditor.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.core.editor.BackboneException;
-import org.eclipse.papyrus.core.services.ServicesRegistry;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditor;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PartInitException;
-import org.osgi.framework.ServiceException;
-
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class UmlDeploymentDiagramForMultiEditor.
- */
-public class UmlDeploymentDiagramForMultiEditor extends UMLDiagramEditor {
-
- /** The location of diagram icon in the plug-in. */
- private static final String DIAG_IMG_PATH = "icons/obj16/DeploymentDiagram.gif";
-
- /** The image descriptor of the diagram icon. */
- private static final ImageDescriptor DIAG_IMG_DESC = UMLDiagramEditorPlugin.getBundledImageDescriptor(UmlDeploymentDiagramForMultiEditor.DIAG_IMG_PATH);
-
- /** The editor splitter. */
- private Composite splitter;
-
- /**
- * Constructor for SashSystem v2. Context and required objects are retrieved from the
- * ServiceRegistry.
- *
- * @param servicesRegistry
- * the services registry
- * @param diagram
- * the diagram
- * @throws BackboneException
- * the backbone exception
- * @throws ServiceException
- * the service exception
- * @throws ServiceException
- * the service exception
- */
- public UmlDeploymentDiagramForMultiEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws BackboneException, ServiceException, org.eclipse.papyrus.core.services.ServiceException {
- super(servicesRegistry, diagram);
- }
-
-
- /**
- * Inits the.
- *
- * @param site
- * the site
- * @param input
- * the input
- * @throws PartInitException
- * the part init exception
- * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor#init(org.eclipse.ui.IEditorSite,
- * org.eclipse.ui.IEditorInput)
- */
-
- @Override
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- super.init(site, input);
- setPartName(getDiagram().getName());
- setTitleImage(DIAG_IMG_DESC.createImage());
- }
-
-
- /**
- * Sets the input.
- *
- * @param input
- * the new input
- * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor#setInput(org.eclipse.ui.IEditorInput)
- */
-
- @Override
- public void setInput(IEditorInput input) {
- try {
- // Provide an URI with fragment in order to reuse the same Resource
- // and set the diagram to the fragment.
- URIEditorInput uriInput = new URIEditorInput(EcoreUtil.getURI(getDiagram()));
- doSetInput(uriInput, true);
- } catch (CoreException x) {
- String title = "Problem opening";
- String msg = "Cannot open input element:";
- Shell shell = getSite().getShell();
- ErrorDialog.openError(shell, title, msg, x.getStatus());
- }
- }
-
-
- /**
- * Creates the graphical viewer.
- *
- * @param parent
- * the parent
- * @see org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor#createGraphicalViewer(org.eclipse.swt.widgets.Composite)
- */
-
- @Override
- protected void createGraphicalViewer(Composite parent) {
- splitter = parent;
- super.createGraphicalViewer(parent);
- }
-
-
- /**
- * Sets the focus.
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette#setFocus()
- */
-
- @Override
- public void setFocus() {
- splitter.setFocus();
- super.setFocus();
- }
-
- /**
- * Gets the editing domain id.
- *
- * @return the editing domain id
- * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor#getEditingDomainID()
- */
-
- @Override
- public String getEditingDomainID() {
- return "org.eclipse.papyrus.diagram.deployment.EditingDomain";
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/actions/ShowHideRelatedContentsAction.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/actions/ShowHideRelatedContentsAction.java
deleted file mode 100644
index 277806c6366..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/actions/ShowHideRelatedContentsAction.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment.custom.actions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.actions.AbstractShowHideAction;
-import org.eclipse.papyrus.diagram.common.actions.ShowHideContentsAction;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideRelatedContentsEditPolicy;
-import org.eclipse.papyrus.diagram.common.providers.EditorLabelProvider;
-import org.eclipse.papyrus.diagram.deployment.custom.messages.Messages;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Type;
-
-public class ShowHideRelatedContentsAction extends ShowHideContentsAction {
-
- /**
- *
- * Constructor.
- *
- */
- public ShowHideRelatedContentsAction() {
- super(Messages.ShowHideRelatedContentsAction_Title, Messages.ShowHideRelatedContentsAction_Message, ShowHideRelatedContentsEditPolicy.SHOW_HIDE_RELATED_CONTENTS_POLICY);
- }
-
- /**
- *
- * @see org.eclipse.papyrus.diagram.common.actions.AbstractShowHideAction#initAction()
- *
- */
- @Override
- protected void initAction() {
- super.initAction();
- setEditorLabelProvider(new EditorLabelProvider());
- this.representations = new ArrayList<AbstractShowHideAction.EditPartRepresentation>();
-
- for(EditPart current : this.selectedElements) {
- //the selected elements which aren't Classifier are ignored
- EObject element = ((View)current.getModel()).getElement();
- if(element instanceof Property) {
- Type type = ((Property)element).getType();
- if(type instanceof Classifier) {
- this.representations.add(new CustomEditPartRepresentation(current, (Classifier)type));
- }
- }
- }
- this.setEditorLabelProvider(new CustomEditorLabelProvider());
- this.setContentProvider(new CustomContentProvider());
-
- }
-
- protected class CustomContentProvider extends ShowHideContentsAction.ContentProvider {
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public Object getParent(Object element) {
- if(!(element instanceof EditPartRepresentation)) {
- EditPartRepresentation rep = findEditPartRepresentation(element);
- if(rep != null) {
- //element can be owned by the class (rep), or by a superclass (ClassifierRepresentation)
- List<ClassifierRepresentation> classes = ((CustomEditPartRepresentation)rep).getSuperClasses();
- for(ClassifierRepresentation classifierRepresentation : classes) {
- if(classifierRepresentation.getRepresentedClassifier().getOwnedMembers().contains(element)) {
- return classifierRepresentation;
- }
- }
- }
- return rep;
- }
- return null;
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/actions/ShowHideRelatedContentsHandler.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/actions/ShowHideRelatedContentsHandler.java
deleted file mode 100644
index 5d1bcc2b6ae..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/actions/ShowHideRelatedContentsHandler.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment.custom.actions;
-
-import org.eclipse.papyrus.diagram.common.actions.handlers.AbstractShowHideHandler;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideRelatedContentsEditPolicy;
-
-
-/**
- *
- * Handler for the {@link ShowHideRelatedContentsAction}
- *
- */
-public class ShowHideRelatedContentsHandler extends AbstractShowHideHandler {
-
- /**
- *
- * Constructor.
- *
- */
- public ShowHideRelatedContentsHandler() {
- super(new ShowHideRelatedContentsAction(), ShowHideRelatedContentsEditPolicy.SHOW_HIDE_RELATED_CONTENTS_POLICY);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/command/CreateViewCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/command/CreateViewCommand.java
deleted file mode 100644
index c920385a7b3..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/command/CreateViewCommand.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.diagram.deployment.custom.edit.command;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.notation.View;
-
-public class CreateViewCommand extends CreateCommand {
-
- @Override
- public boolean canExecute() {
- return true;
- }
-
- public CreateViewCommand(TransactionalEditingDomain editingDomain, ViewDescriptor viewDescriptor, View containerView) {
- super(editingDomain, viewDescriptor, containerView);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/helpers/DeploymentLinkMappingHelper.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/helpers/DeploymentLinkMappingHelper.java
deleted file mode 100644
index 935045fcee9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/helpers/DeploymentLinkMappingHelper.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.custom.edit.helpers;
-
-import java.util.Collection;
-
-import org.eclipse.papyrus.diagram.common.helper.ILinkMappingHelper;
-import org.eclipse.papyrus.diagram.common.helper.LinkMappingHelper;
-import org.eclipse.papyrus.diagram.common.helper.LinkMappingHelper.CommonSourceUMLSwitch;
-import org.eclipse.papyrus.diagram.common.helper.LinkMappingHelper.CommonTargetUMLSwitch;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * This helper is used to retrieve Link ends for use in drag and drop behavior
- */
-public class DeploymentLinkMappingHelper implements ILinkMappingHelper {
-
- /**
- * Singleton management
- */
- private static class SingletonHolder {
-
- /**
- * Singleton instance
- */
- private final static DeploymentLinkMappingHelper instance = new DeploymentLinkMappingHelper();
- }
-
- /**
- * Get singleton instance
- *
- * @return the instance
- */
- public static DeploymentLinkMappingHelper getInstance() {
- return SingletonHolder.instance;
- }
-
- /**
- * private constructor
- */
- private DeploymentLinkMappingHelper() {
- // do nothing
- }
-
- /**
- * {@inheritDoc}
- */
- public Collection<?> getSource(Element link) {
- return LinkMappingHelper.getSource(link, new CommonSourceUMLSwitch() {
-
- @Override
- public java.util.Collection<?> caseDependency(org.eclipse.uml2.uml.Dependency object) {
- return object.getSources();
- };
-
- @Override
- public java.util.Collection<?> caseConnector(org.eclipse.uml2.uml.Connector object) {
- return object.getEnds();
- };
- });
- }
-
- /**
- * {@inheritDoc}
- */
- public Collection<?> getTarget(Element link) {
- return LinkMappingHelper.getTarget(link, new CommonTargetUMLSwitch() {
-
- @Override
- public java.util.Collection<?> caseDependency(org.eclipse.uml2.uml.Dependency object) {
- return object.getTargets();
- };
-
- @Override
- public java.util.Collection<?> caseConnector(org.eclipse.uml2.uml.Connector object) {
- return object.getEnds();
- };
- });
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/policies/CustomDiagramDragDropEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/policies/CustomDiagramDragDropEditPolicy.java
deleted file mode 100644
index aa14cea37fb..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/policies/CustomDiagramDragDropEditPolicy.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment.custom.edit.policies;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.OldCommonDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.command.CreateViewCommand;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.helpers.DeploymentLinkMappingHelper;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Collaboration;
-import org.eclipse.uml2.uml.CollaborationUse;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.StructuredClassifier;
-import org.eclipse.uml2.uml.Type;
-import org.eclipse.uml2.uml.TypedElement;
-
-// TODO: Auto-generated Javadoc
-/**
- * This class provides an implementation for specific behavior of Drag and Drop
- * in the Composite Diagram.
- */
-public class CustomDiagramDragDropEditPolicy extends OldCommonDiagramDragDropEditPolicy {
-
- /**
- * Default constructor.
- */
- public CustomDiagramDragDropEditPolicy() {
- super(DeploymentLinkMappingHelper.getInstance());
- }
-
- /**
- * Gets the droppable element visual id.
- *
- * @return the droppable element visual id {@inheritDoc}
- */
- @Override
- protected Set<Integer> getDroppableElementVisualId() {
- // TopLevelNodes
- Set<Integer> droppableElementsVisualId = new HashSet<Integer>();
- droppableElementsVisualId.add(NodeEditPart.VISUAL_ID);
- droppableElementsVisualId.add(DeviceEditPart.VISUAL_ID);
- droppableElementsVisualId.add(ExecutionEnvironmentEditPart.VISUAL_ID);
- droppableElementsVisualId.add(ArtifactEditPart.VISUAL_ID);
- droppableElementsVisualId.add(CommentEditPart.VISUAL_ID);
- droppableElementsVisualId.add(ConstraintEditPart.VISUAL_ID);
-
- // Class CN
- droppableElementsVisualId.add(ArtifactEditPartCN.VISUAL_ID);
- droppableElementsVisualId.add(ArtifactEditPartACN.VISUAL_ID);
- droppableElementsVisualId.add(NodeEditPartCN.VISUAL_ID);
- droppableElementsVisualId.add(DeviceEditPartCN.VISUAL_ID);
- droppableElementsVisualId.add(ExecutionEnvironmentEditPartCN.VISUAL_ID);
-
- return droppableElementsVisualId;
- }
-
- /**
- * Gets the uML element type.
- *
- * @param elementID
- * the element id
- * @return the uML element type {@inheritDoc}
- */
- @Override
- public IElementType getUMLElementType(int elementID) {
- return UMLElementTypes.getElementType(elementID);
- }
-
- /**
- * Gets the node visual id.
- *
- * @param containerView
- * the container view
- * @param domainElement
- * the domain element
- * @return the node visual id {@inheritDoc}
- */
- @Override
- public int getNodeVisualID(View containerView, EObject domainElement) {
- return UMLVisualIDRegistry.getNodeVisualID(containerView, domainElement);
- }
-
- /**
- * Gets the link with class visual id.
- *
- * @param domainElement
- * the domain element
- * @return the link with class visual id {@inheritDoc}
- */
- @Override
- public int getLinkWithClassVisualID(EObject domainElement) {
- return UMLVisualIDRegistry.getLinkWithClassVisualID(domainElement);
- }
-
- /**
- * Gets the specific drop command.
- *
- * @param dropRequest
- * the drop request
- * @param semanticElement
- * the semantic element
- * @param nodeVISUALID
- * the node visualid
- * @param linkVISUALID
- * the link visualid
- * @return the specific drop command {@inheritDoc}
- */
- @Override
- protected Command getSpecificDropCommand(DropObjectsRequest dropRequest, Element semanticElement, int nodeVISUALID, int linkVISUALID) {
-
- // Switch test over linkVisualID
- switch(linkVISUALID) {
- case DependencyEditPart.VISUAL_ID:
- return dropDependency(dropRequest, semanticElement, linkVISUALID);
- default:
- // Switch test over nodeVISUALID
- switch(nodeVISUALID) {
- // Test TopLevelNode... Start
- case NodeEditPart.VISUAL_ID:
- case DeviceEditPart.VISUAL_ID:
- case ExecutionEnvironmentEditPart.VISUAL_ID:
- case ArtifactEditPart.VISUAL_ID:
- return dropTopLevelNode(dropRequest, semanticElement, nodeVISUALID, linkVISUALID);
- // Test TopLevelNode... End
- case CommentEditPart.VISUAL_ID:
- case ConstraintEditPart.VISUAL_ID:
-
- default:
- return super.getSpecificDropCommand(dropRequest, semanticElement, nodeVISUALID, linkVISUALID);
- }
- }
- }
-
-
- /**
- * Returns the drop command for Dependency links.
- *
- * @param dropRequest
- * the drop request
- * @param semanticLink
- * the element to drop
- * @param linkVISUALID
- * the visual identifier of the EditPart of the dropped element
- * @return the drop command
- */
- protected Command dropDependency(DropObjectsRequest dropRequest, Element semanticLink, int linkVISUALID) {
- Collection<?> sourceEnds = DeploymentLinkMappingHelper.getInstance().getSource(semanticLink);
- Collection<?> targetEnds = DeploymentLinkMappingHelper.getInstance().getTarget(semanticLink);
-
- // Dependency with Unary ends
- if((sourceEnds != null) && (targetEnds != null) && (sourceEnds.size() == 1) && (targetEnds.size() == 1)) {
-
- Element source = (Element)sourceEnds.toArray()[0];
- Element target = (Element)targetEnds.toArray()[0];
- return new ICommandProxy(dropBinaryLink(new CompositeCommand("drop Dependency"), source, target, //$NON-NLS-1$
- linkVISUALID, dropRequest.getLocation(), semanticLink));
- } else {
- return UnexecutableCommand.INSTANCE;
- }
- }
-
-
- /**
- * Returns the drop command for Property nodes.
- *
- * @param dropRequest
- * the drop request
- * @param droppedElement
- * the element to drop
- * @param nodeVISUALID
- * the visual identifier of the EditPart of the dropped element
- * @return the drop command
- */
- protected Command dropProperty(DropObjectsRequest dropRequest, Property droppedElement, int nodeVISUALID) {
-
- GraphicalEditPart graphicalParentEditPart = (GraphicalEditPart)getHost();
- EObject graphicalParentObject = graphicalParentEditPart.resolveSemanticElement();
-
- // Default drop location
- Point location = dropRequest.getLocation().getCopy();
-
- // Port inherits from Property this case should be excluded and treated
- // separately
- if(!(droppedElement instanceof Port)) {
-
- if((graphicalParentObject instanceof Classifier) && (((Classifier)graphicalParentObject).getAllAttributes().contains(droppedElement))) {
- // The graphical parent is the real owner of the dropped
- // property.
- // The dropped property may also be an inherited attribute of
- // the graphical parent.
- return new ICommandProxy(getDefaultDropNodeCommand(nodeVISUALID, location, droppedElement));
-
- } else if(graphicalParentObject instanceof ConnectableElement) {
- Type type = ((ConnectableElement)graphicalParentObject).getType();
- if((type != null) && (type instanceof Classifier) && (((Classifier)type).getAllAttributes().contains(droppedElement))) {
- // The graphical parent is a Property typed by a Classifier
- // that owns or inherits the
- // dropped property.
- return new ICommandProxy(getDefaultDropNodeCommand(nodeVISUALID, location, droppedElement));
- }
- }
- }
-
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * <pre>
- * This method return a drop command for TopLevelNode.
- * It returns an {@link org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand} in
- * case the element is dropped on a canvas referencing a domain element that is not a Package.
- * </pre>
- *
- * @param dropRequest
- * the drop request
- * @param semanticElement
- * the semantic element
- * @param nodeVISUALID
- * the visual identifier of the EditPart of the dropped element
- * @param linkVISUALID
- * the visual identifier of the EditPart of the dropped element
- * @return the drop command
- */
- protected Command dropTopLevelNode(DropObjectsRequest dropRequest, Element semanticElement, int nodeVISUALID, int linkVISUALID) {
-
- GraphicalEditPart graphicalParentEditPart = (GraphicalEditPart)getHost();
- EObject graphicalParentObject = graphicalParentEditPart.resolveSemanticElement();
- if(graphicalParentObject instanceof org.eclipse.uml2.uml.Package) {
- return new ICommandProxy(getDefaultDropNodeCommand(nodeVISUALID, dropRequest.getLocation(), semanticElement));
- }
-
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * <pre>
- * This method returns the drop command for AffixedNode (Port, Parameter)
- * in case the node is dropped on a ShapeCompartmentEditPart.
- * </pre>
- *
- * @param nodeVISUALID
- * the node visual identifier
- * @param location
- * the drop location
- * @param droppedObject
- * the object to drop
- * @return a CompositeCommand for Drop
- */
- protected CompoundCommand getDropAffixedNodeInCompartmentCommand(int nodeVISUALID, Point location, EObject droppedObject) {
- CompoundCommand cc = new CompoundCommand("Drop");
- IAdaptable elementAdapter = new EObjectAdapter(droppedObject);
-
- ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, ((IHintedType)getUMLElementType(nodeVISUALID)).getSemanticHint(), ViewUtil.APPEND, false, getDiagramPreferencesHint());
- // Create the command targeting host parent (owner of the
- // ShapeCompartmentEditPart)
- CreateViewCommand createCommand = new CreateViewCommand(getEditingDomain(), descriptor, ((View)(getHost().getParent().getModel())));
- cc.add(new ICommandProxy(createCommand));
-
- SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), "move", (IAdaptable)createCommand.getCommandResult().getReturnValue(), location);
- cc.add(new ICommandProxy(setBoundsCommand));
-
- return cc;
- }
-
-
- /**
- * Avoid dropped element to get orphaned for DND action resulting in a
- * specific action (not a move).
- *
- * @param request
- * the request
- * @return the drag command
- */
- @Override
- protected Command getDragCommand(ChangeBoundsRequest request) {
-
- Boolean isSpecificDrag = false;
-
- Iterator<?> iter = request.getEditParts().iterator();
- EObject graphicalParentObject = ((GraphicalEditPart)getHost()).resolveSemanticElement();
- while((graphicalParentObject != null) && (iter.hasNext())) {
-
- EObject droppedObject = null;
- EditPart droppedEditPart = (EditPart)iter.next();
- if(droppedEditPart instanceof GraphicalEditPart) {
- droppedObject = ((GraphicalEditPart)droppedEditPart).resolveSemanticElement();
- }
-
- isSpecificDrag = isSpecificDropActionExpected((GraphicalEditPart)getHost(), droppedObject);
- }
-
- if(isSpecificDrag) {
- return null;
- }
-
- return super.getDragCommand(request);
- }
-
- /**
- * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.DiagramDragDropEditPolicy#getDropCommand(org.eclipse.gef.requests.ChangeBoundsRequest)
- *
- * @param request
- * @return
- */
-
- @Override
- protected Command getDropCommand(ChangeBoundsRequest request) {
- Boolean isSpecificDrop = false;
-
- Iterator<?> iter = request.getEditParts().iterator();
- EObject graphicalParentObject = ((GraphicalEditPart)getHost()).resolveSemanticElement();
- while((graphicalParentObject != null) && (iter.hasNext())) {
- EObject droppedObject = null;
- EditPart droppedEditPart = (EditPart)iter.next();
- if(droppedEditPart instanceof GraphicalEditPart) {
- droppedObject = ((GraphicalEditPart)droppedEditPart).resolveSemanticElement();
- }
-
- isSpecificDrop = isSpecificDropActionExpected((GraphicalEditPart)getHost(), droppedObject);
- }
-
- if(isSpecificDrop) {
- return getDropObjectsCommand(castToDropObjectsRequest(request));
- }
-
- return super.getDropCommand(request);
- }
-
- /**
- * Test if a specific drop action shall is expected.
- *
- * @param graphicalParent
- * the graphical parent
- * @param droppedObject
- * the dropped object
- * @return true, if is specific drop action expected
- */
- protected boolean isSpecificDropActionExpected(GraphicalEditPart graphicalParent, EObject droppedObject) {
- boolean isSpecificDropActionExpected = false;
-
- EObject graphicalParentObject = graphicalParent.resolveSemanticElement();
- if(graphicalParentObject != null) {
-
- if(graphicalParentObject instanceof Collaboration) {
-
- if((droppedObject instanceof Collaboration) || (droppedObject instanceof Class)) {
- isSpecificDropActionExpected = true;
- }
-
- } else if(graphicalParentObject instanceof StructuredClassifier) {
-
- if((droppedObject instanceof Collaboration) || (droppedObject instanceof Class)) {
- isSpecificDropActionExpected = true;
- }
-
- } else if(graphicalParentObject instanceof TypedElement) {
-
- if(droppedObject instanceof Type) {
- isSpecificDropActionExpected = true;
- }
-
- } else if(graphicalParentObject instanceof CollaborationUse) {
-
- if(droppedObject instanceof Collaboration) {
- isSpecificDropActionExpected = true;
- }
- }
- }
-
- return isSpecificDropActionExpected;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/policies/RemoveOrphanViewPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/policies/RemoveOrphanViewPolicy.java
deleted file mode 100644
index 89c1ddb7b8f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/edit/policies/RemoveOrphanViewPolicy.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.Tessier@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Adaptation for Composite Diagram
-
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment.custom.edit.policies;
-
-import org.eclipse.gmf.runtime.notation.BasicCompartment;
-import org.eclipse.gmf.runtime.notation.DecorationNode;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.OrphanViewPolicy;
-
-/**
- * <pre>
- * This policy is used to suppress orphan node view in GMF view.
- * The policy to remove orphan connection is more complex.
- *
- * See RemoveOrphanViewPolicy in Class Diagram
- * </pre>
- */
-public class RemoveOrphanViewPolicy extends OrphanViewPolicy {
-
- /**
- *
- * @see org.eclipse.papyrus.diagram.common.editpolicies.OrphanViewPolicy#isOrphaned(org.eclipse.gmf.runtime.notation.View)
- *
- * @param view
- * @return true is the view is Orphaned
- */
- protected boolean isOrphaned(View view) {
- // Always treat Compartment and Decoration as not orphaned nodes
- if((view instanceof BasicCompartment) || (view instanceof DecorationNode)) {
- return false;
- }
- return !view.isSetElement();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/ArtifactFigure.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/ArtifactFigure.java
deleted file mode 100644
index e80224369c4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/ArtifactFigure.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment.custom.figure.nodes;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.diagram.common.Activator;
-import org.eclipse.papyrus.diagram.common.figure.node.CompartmentFigure;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.swt.graphics.Image;
-
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class ArtifactFigure.
- */
-public class ArtifactFigure extends CompartmentFigure {
-
-
- /** The Internal Structure Compartment. */
- private final static String COMPOSITE_COMPARTMENT = "compositeCompartment";
-
- /** The List of Compartment. */
- private final static List<String> COMPARTMENT = new ArrayList<String>() {
-
- private static final long serialVersionUID = 1L;
- {
- add(COMPOSITE_COMPARTMENT);
- }
- };
-
- /**
- * Instantiates a new artifact figure.
- */
- public ArtifactFigure() {
- this("artifact");
- }
-
- /**
- * Instantiates a new artifact figure.
- *
- * @param tagvalue
- * the tagvalue
- */
- public ArtifactFigure(String tagvalue) {
- super(COMPARTMENT, tagvalue);
- Image img = Activator.getPluginIconImage(UMLDiagramEditorPlugin.ID, "icons/obj16/ArtifactIcon.gif");
- setAppliedStereotypeIcon(img, PositionConstants.RIGHT);
- }
-
- /**
- * Gets the composite compartment figure.
- *
- * @return the composite compartment figure
- */
- public IFigure getCompositeCompartmentFigure() {
- return getCompartment(COMPOSITE_COMPARTMENT);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/DeviceFigure.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/DeviceFigure.java
deleted file mode 100644
index a799fed8cd9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/DeviceFigure.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment.custom.figure.nodes;
-
-import org.eclipse.draw2d.IFigure;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class DeviceFigure.
- */
-public class DeviceFigure extends NodeFigure {
-
- /**
- * Constructor.
- *
- */
- public DeviceFigure() {
- super("device");
- }
-
- /**
- * Gets the composite compartment figure.
- *
- * @return the composite compartment figure
- * @see org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.NodeFigure#getCompositeCompartmentFigure()
- */
-
- @Override
- public IFigure getCompositeCompartmentFigure() {
- return super.getCompositeCompartmentFigure();
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/ExecutionEnvironmentFigure.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/ExecutionEnvironmentFigure.java
deleted file mode 100644
index 7f8b6272f98..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/ExecutionEnvironmentFigure.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment.custom.figure.nodes;
-
-import org.eclipse.draw2d.IFigure;
-
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class ExecutionEnvironmentFigure.
- */
-public class ExecutionEnvironmentFigure extends NodeFigure {
-
- /**
- * Constructor.
- *
- */
- public ExecutionEnvironmentFigure() {
- super("executionEnvironment");
- }
-
- /**
- * Gets the composite compartment figure.
- *
- * @return the composite compartment figure
- * @see org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.NodeFigure#getCompositeCompartmentFigure()
- */
-
- @Override
- public IFigure getCompositeCompartmentFigure() {
- return super.getCompositeCompartmentFigure();
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/NodeFigure.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/NodeFigure.java
deleted file mode 100644
index f3752278802..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/figure/nodes/NodeFigure.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment.custom.figure.nodes;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.papyrus.diagram.common.figure.node.CompartmentFigure;
-import org.eclipse.papyrus.diagram.common.figure.node.Rectangular3DBorder;
-
-
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class NodeFigure.
- */
-public class NodeFigure extends CompartmentFigure {
-
- /** The Internal Structure Compartment. */
- private final static String COMPOSITE_COMPARTMENT = "compositeCompartment";
-
- /** The effectborder. */
- private final LineBorder effectborder;
-
- /** The List of Compartment. */
- private final static List<String> COMPARTMENT = new ArrayList<String>() {
-
- private static final long serialVersionUID = 1L;
- {
- add(COMPOSITE_COMPARTMENT);
- }
- };
-
- /**
- * Instantiates a new node figure.
- */
- public NodeFigure() {
- this("node");
- }
-
- /**
- * Instantiates a new node figure.
- *
- * @param tagvalue
- * the tagvalue
- */
- public NodeFigure(String tagvalue) {
- super(COMPARTMENT, tagvalue);
- effectborder = new Rectangular3DBorder(19, getForegroundColor());
- setBorder(getBorderedFigure(), effectborder);
- }
-
- /**
- * Gets the composite compartment figure.
- *
- * @return the composite compartment figure
- */
- public IFigure getCompositeCompartmentFigure() {
- return getCompartment(COMPOSITE_COMPARTMENT);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/messages/Messages.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/messages/Messages.java
deleted file mode 100644
index 7955cfa3d49..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/messages/Messages.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment.custom.messages;
-
-import org.eclipse.osgi.util.NLS;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class Messages.
- */
-public class Messages extends NLS {
-
- /** The Constant BUNDLE_NAME. */
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.diagram.deployment.custom.messages.messages"; //$NON-NLS-1$
-
-
- /** The Create uml element dialog_ new_ element_ name. */
- public static String CreateUmlElementDialog_New_Element_Name;
-
- /** The Selection validated. */
- public static String SelectionValidated;
-
- /** The Show hide related contents action_ message. */
- public static String ShowHideRelatedContentsAction_Message;
-
- /** The Show hide related contents action_ title. */
- public static String ShowHideRelatedContentsAction_Title;
-
- /** The No selection found. */
- public static String NoSelectionFound;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- /**
- * Instantiates a new messages.
- */
- private Messages() {
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/messages/messages.properties b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/messages/messages.properties
deleted file mode 100644
index bd7d9a9ef89..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/messages/messages.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 CEA LIST.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
-###############################################################################
-ConnectorCreateCommand_INVALID_ARGS_MSG=Invalid arguments in create link command
-ConnectorCreateCommand_INVALID_SOURCE_MSG=Invalid source in create Connector command
-ConnectorCreateCommand_INVALID_TARGET_MSG=Invalid target in create Connector command
-CreateUmlElementDialog_New_Element_Name=New Element Name
-SelectionValidated=Selection validated.
-ShowHideRelatedContentsAction_Message=Choose the elements to show
-ShowHideRelatedContentsAction_Title=Show/Hide Related Contents
-ShowHideRelatedContentsAction_Message=Choose the elements to show
-ShowHideRelatedContentsAction_Title=Show/Hide Related Contents
-NoSelectionFound=No selection found. \ No newline at end of file
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/providers/ActionStateSourceProvider.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/providers/ActionStateSourceProvider.java
deleted file mode 100644
index 686146fee64..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/providers/ActionStateSourceProvider.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment.custom.providers;
-
-import org.eclipse.papyrus.diagram.common.providers.AbstractActionStateSourceProvider;
-import org.eclipse.papyrus.diagram.deployment.custom.actions.ShowHideRelatedContentsHandler;
-import org.eclipse.ui.ISources;
-
-/**
- * This class provides the state of the actions. It's used to refresh
- * the status of these actions in the menu. (in toolbar and popup, it's not needed)
- *
- * To get the status, we listen the selection service AND the part service!
- * The part service is used to know if the selection is in the Model Explorer or not!
- * When the selection is not in the model explorer, the handlers listening the variable need to be disabled
- */
-public class ActionStateSourceProvider extends AbstractActionStateSourceProvider {
-
- /**
- * The name of the variable to check.
- */
- public static final String SHOW_HIDE_RELATED_CONTENTS = "showHideRelatedContents"; //$NON-NLS-1$
-
- /**
- *
- * Constructor.
- *
- */
- public ActionStateSourceProvider() {
- super();
- currentState.put(SHOW_HIDE_RELATED_CONTENTS, DISABLED);
- }
-
-
- /**
- *
- * @see org.eclipse.ui.ISourceProvider#getProvidedSourceNames()
- *
- * @return
- */
- @Override
- public String[] getProvidedSourceNames() {
- return new String[]{ SHOW_HIDE_RELATED_CONTENTS };
- }
-
-
- /**
- * Refresh the state of the Delete Action
- */
- protected void refreshShowHideRelatedContentsAction() {
- String oldState = currentState.get(SHOW_HIDE_RELATED_CONTENTS);
- String newState = (testShowHideRelatedContents() ? ENABLED : DISABLED);
-
- if(oldState != newState) {
- currentState.put(SHOW_HIDE_RELATED_CONTENTS, newState);
- fireSourceChanged(ISources.WORKBENCH, currentState);
- }
- }
-
- /**
- * Tests if the action DeleteFromDiagram (now called Delete Selected Element can be executed
- *
- * @return
- * <code>true</code> if the action DeleteFromDiagram (now called Delete Selected Element can be executed <code>false</code> if not
- */
- protected boolean testShowHideRelatedContents() {
- ShowHideRelatedContentsHandler handler = new ShowHideRelatedContentsHandler();
- return isSelectionInDiagram() && handler.isEnabled();
- }
-
- /**
- *
- * @see org.eclipse.papyrus.diagram.common.providers.AbstractActionStateSourceProvider#refreshActions()
- *
- */
- @Override
- protected void refreshActions() {
- refreshShowHideRelatedContentsAction();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/providers/CustomEditPolicyProvider.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/providers/CustomEditPolicyProvider.java
deleted file mode 100644
index d13c44519a7..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/custom/providers/CustomEditPolicyProvider.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment.custom.providers;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.NavigationEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-
-/**
- * this is an editpolicy provider in charge to install a policy to navigate between diagrams and elements
- *
- */
-public class CustomEditPolicyProvider implements IEditPolicyProvider {
-
- /**
- *
- * {@inheritDoc}
- */
- public void addProviderChangeListener(IProviderChangeListener listener) {
-
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void createEditPolicies(EditPart editPart) {
- editPart.installEditPolicy(NavigationEditPolicy.NAVIGATION_POLICY, new NavigationEditPolicy());
- if( editPart instanceof IPrimaryEditPart){
- editPart.installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- }
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public boolean provides(IOperation operation) {
- CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation)operation;
- if(!(epOperation.getEditPart() instanceof GraphicalEditPart)) {
- return false;
- }
- GraphicalEditPart gep = (GraphicalEditPart)epOperation.getEditPart();
- String diagramType = gep.getNotationView().getDiagram().getType();
- if(DeploymentDiagramEditPart.MODEL_ID.equals(diagramType)) {
- return true;
- }
-
-
- return false;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void removeProviderChangeListener(IProviderChangeListener listener) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/preferences/CommentAnnotatedElementPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/preferences/CommentAnnotatedElementPreferencePage.java
deleted file mode 100644
index 1540baeb954..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/preferences/CommentAnnotatedElementPreferencePage.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-// TODO: Auto-generated Javadoc
-/**
- * Preference page for CommentAnnotatedElement notation element.
- * Currently not generated.
- */
-public class CommentAnnotatedElementPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * Instantiates a new comment annotated element preference page.
- *
- * @generated
- */
- public CommentAnnotatedElementPreferencePage() {
- super();
- setPreferenceKey(DeploymentDiagramEditPart.MODEL_ID + "_CommentAnnotatedElement");
- }
-
- /**
- * Gets the bundle id.
- *
- * @return the bundle id
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * Inits the defaults.
- *
- * @param store
- * the store
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/preferences/ConstraintConstrainedElementPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/preferences/ConstraintConstrainedElementPreferencePage.java
deleted file mode 100644
index ad0928bbaf2..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/custom-src/org/eclipse/papyrus/diagram/deployment/preferences/ConstraintConstrainedElementPreferencePage.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-// TODO: Auto-generated Javadoc
-/**
- * Preference page for ConstraintConstrainedElement notation element.
- * Currently not generated.
- */
-public class ConstraintConstrainedElementPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * Instantiates a new constraint constrained element preference page.
- *
- * @generated
- */
- public ConstraintConstrainedElementPreferencePage() {
- super();
- setPreferenceKey(DeploymentDiagramEditPart.MODEL_ID + "_ConstraintConstrainedElement");
- }
-
- /**
- * Gets the bundle id.
- *
- * @return the bundle id
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * Inits the defaults.
- *
- * @param store
- * the store
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/incomingLinksNavigatorGroup.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/incomingLinksNavigatorGroup.gif
deleted file mode 100644
index fca9c53e629..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/incomingLinksNavigatorGroup.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/linkSourceNavigatorGroup.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/linkSourceNavigatorGroup.gif
deleted file mode 100644
index fca9c53e629..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/linkSourceNavigatorGroup.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/linkTargetNavigatorGroup.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/linkTargetNavigatorGroup.gif
deleted file mode 100644
index fca9c53e629..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/linkTargetNavigatorGroup.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/linksNavigatorGroup.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/linksNavigatorGroup.gif
deleted file mode 100644
index fca9c53e629..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/linksNavigatorGroup.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Artifact.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Artifact.gif
deleted file mode 100644
index ef05ed2dd97..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Artifact.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/ArtifactIcon.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/ArtifactIcon.gif
deleted file mode 100644
index fc0895b3d8e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/ArtifactIcon.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Comment.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Comment.gif
deleted file mode 100644
index c495731c682..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Comment.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Constraint.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Constraint.gif
deleted file mode 100644
index eed6acec1ee..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Constraint.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Dependency.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Dependency.gif
deleted file mode 100644
index add6dec9b61..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Dependency.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Deployment.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Deployment.gif
deleted file mode 100644
index bc0c7865987..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Deployment.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/DeploymentDiagram.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/DeploymentDiagram.gif
deleted file mode 100644
index 76be20ee9dd..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/DeploymentDiagram.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Device.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Device.gif
deleted file mode 100644
index f9e56eea8ab..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Device.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/ExecutionEnvironment.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/ExecutionEnvironment.gif
deleted file mode 100644
index 65dcecb94af..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/ExecutionEnvironment.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Generalization.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Generalization.gif
deleted file mode 100644
index 6f3189ac5aa..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Generalization.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Link.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Link.gif
deleted file mode 100644
index 13fb22e4bfe..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Link.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Manifestation.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Manifestation.gif
deleted file mode 100644
index 0aff25b401d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Manifestation.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Node.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Node.gif
deleted file mode 100644
index 047a553f7f0..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/Node.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/UMLDiagramFile.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/UMLDiagramFile.gif
deleted file mode 100644
index de938070dea..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/obj16/UMLDiagramFile.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/outgoingLinksNavigatorGroup.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/outgoingLinksNavigatorGroup.gif
deleted file mode 100644
index fca9c53e629..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/outgoingLinksNavigatorGroup.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/icons/wizban/NewUMLWizard.gif b/incoming/org.eclipse.papyrus.diagram.deployment/icons/wizban/NewUMLWizard.gif
deleted file mode 100644
index 83e03bf39bf..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/icons/wizban/NewUMLWizard.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/messages.properties b/incoming/org.eclipse.papyrus.diagram.deployment/messages.properties
deleted file mode 100644
index 92870deac55..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/messages.properties
+++ /dev/null
@@ -1,314 +0,0 @@
-
-# TODO: manually put keys and values
-UMLCreationWizardTitle=New PapyrusUMLComponentDiagram Diagram
-UMLCreationWizard_DiagramModelFilePageTitle=Create PapyrusUMLComponentDiagram Diagram
-UMLCreationWizard_DiagramModelFilePageDescription=Select file that will contain diagram model.
-UMLCreationWizard_DomainModelFilePageTitle=Create PapyrusUMLComponentDiagram Domain Model
-UMLCreationWizard_DomainModelFilePageDescription=Select file that will contain domain model.
-UMLCreationWizardOpenEditorError=Error opening diagram editor
-UMLCreationWizardCreationError=Creation Problems
-UMLCreationWizardPageExtensionError=File name should have {0} extension.
-UMLDiagramEditorUtil_OpenModelResourceErrorDialogTitle=Error
-UMLDiagramEditorUtil_OpenModelResourceErrorDialogMessage=Failed to load model file {0}
-UMLDiagramEditorUtil_CreateDiagramProgressTask=Creating diagram and model files
-UMLDiagramEditorUtil_CreateDiagramCommandLabel=Creating diagram and model
-UMLDocumentProvider_isModifiable=Updating cache failed
-UMLDocumentProvider_handleElementContentChanged=Failed to refresh hierarchy for changed resource
-UMLDocumentProvider_IncorrectInputError={1}
-UMLDocumentProvider_NoDiagramInResourceError=Diagram is not present in resource
-UMLDocumentProvider_DiagramLoadingError=Error loading diagram
-UMLDocumentProvider_UnsynchronizedFileSaveError=The file has been changed on the file system
-UMLDocumentProvider_SaveDiagramTask=Saving diagram
-UMLDocumentProvider_SaveNextResourceTask=Saving {0}
-UMLDocumentProvider_SaveAsOperation=Saving {0} diagram as
-InitDiagramFile_ResourceErrorDialogTitle=Error
-InitDiagramFile_ResourceErrorDialogMessage=Model file loading failed
-InitDiagramFile_WizardTitle=Initialize new {0} diagram file
-InitDiagramFile_OpenModelFileDialogTitle=Select domain model
-UMLNewDiagramFileWizard_CreationPageName=Initialize new diagram file
-UMLNewDiagramFileWizard_CreationPageTitle=Diagram file
-UMLNewDiagramFileWizard_CreationPageDescription=Create new diagram based on {0} model content
-UMLNewDiagramFileWizard_RootSelectionPageName=Select diagram root element
-UMLNewDiagramFileWizard_RootSelectionPageTitle=Diagram root element
-UMLNewDiagramFileWizard_RootSelectionPageDescription=Select semantic model element to be depicted on diagram
-UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle=Select diagram root element:
-UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage=Diagram root element is not selected
-UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage=Invalid diagram root element is selected
-UMLNewDiagramFileWizard_InitDiagramCommand=Initializing diagram contents
-UMLNewDiagramFileWizard_IncorrectRootError=Incorrect model object stored as a root resource object
-UMLDiagramEditor_SavingDeletedFile=The original file "{0}" has been deleted.
-UMLDiagramEditor_SaveAsErrorTitle=Problem During Save As...
-UMLDiagramEditor_SaveAsErrorMessage=Save could not be completed. Target file is already open in another editor.
-UMLDiagramEditor_SaveErrorTitle=Save Problems
-UMLDiagramEditor_SaveErrorMessage=Could not save file.
-UMLElementChooserDialog_SelectModelElementTitle=Select model element
-ModelElementSelectionPageMessage=Select model element:
-ValidateActionMessage=Validate
-Nodes1Group_title=Nodes
-Nodes1Group_desc=Diagram Nodes
-Links2Group_title=Links
-Links2Group_desc=Diagram Links
-Package1CreationTool_title=Package
-Package1CreationTool_desc=Create a Package
-Component2CreationTool_title=Component
-Component2CreationTool_desc=Create a Component
-InterfaceasCercle3CreationTool_title=Interface as Cercle
-InterfaceasCercle3CreationTool_desc=Create an Interface as a cercle
-Interface4CreationTool_title=Interface
-Interface4CreationTool_desc=Create an Interface
-Property5CreationTool_title=Property
-Property5CreationTool_desc=Create a Property
-Operation6CreationTool_title=Operation
-Operation6CreationTool_desc=Create an Operation
-NestedClassifier7CreationTool_title=Nested Classifier
-NestedClassifier7CreationTool_desc=Create a Nested Classifier
-Requirementlink1CreationTool_title=Requirement link
-Requirementlink1CreationTool_desc=Create a Requirement link
-Providinglink2CreationTool_title=Providing link
-Providinglink2CreationTool_desc=Create a Providing link
-Generalization3CreationTool_title=Generalization
-Generalization3CreationTool_desc=Create a Generalization link
-InterfaceAttributeCompartmentEditPart_title=AttributeCompartment
-InterfaceOperationCompartmentEditPart_title=OperationCompartment
-InterfaceNestedClassifierCompartementEditPart_title=NestedClassifierCompartement
-PackagePackageContentsCompartmentEditPart_title=PackageContentsCompartment
-InterfaceAttributeCompartment2EditPart_title=AttributeCompartment
-InterfaceOperationCompartment2EditPart_title=OperationCompartment
-InterfaceNestedClassifierCompartement2EditPart_title=NestedClassifierCompartement
-
-CommandName_OpenDiagram=Open Diagram
-NavigatorGroupName_Usage_4001_target=target
-NavigatorGroupName_Usage_4001_incominglinks=incoming links
-NavigatorGroupName_Usage_4001_source=source
-NavigatorGroupName_Usage_4001_outgoinglinks=outgoing links
-NavigatorGroupName_Interface_2002_incominglinks=incoming links
-NavigatorGroupName_Interface_2002_outgoinglinks=outgoing links
-NavigatorGroupName_Component_2001_incominglinks=incoming links
-NavigatorGroupName_Component_2001_outgoinglinks=outgoing links
-NavigatorGroupName_Generalization_4003_target=target
-NavigatorGroupName_Generalization_4003_source=source
-NavigatorGroupName_Realization_4002_target=target
-NavigatorGroupName_Realization_4002_incominglinks=incoming links
-NavigatorGroupName_Realization_4002_source=source
-NavigatorGroupName_Realization_4002_outgoinglinks=outgoing links
-NavigatorGroupName_Component_3004_incominglinks=incoming links
-NavigatorGroupName_Component_3004_outgoinglinks=outgoing links
-NavigatorGroupName_Model_1000_links=links
-NavigatorGroupName_Interface_3005_incominglinks=incoming links
-NavigatorGroupName_Interface_3005_outgoinglinks=outgoing links
-NavigatorGroupName_Package_2003_incominglinks=incoming links
-NavigatorGroupName_Package_2003_outgoinglinks=outgoing links
-NavigatorActionProvider_OpenDiagramActionName=Open Diagram
-AbstractParser_UnexpectedValueType=Value of type {0} is expected
-AbstractParser_WrongStringConversion=String value does not convert to {0} value
-AbstractParser_UnknownLiteral=Unknown literal: {0}
-
-MessageFormatParser_InvalidInputError=Invalid input at {0}
-UMLModelingAssistantProviderTitle=Select domain model element
-UMLModelingAssistantProviderMessage=Available domain model elements:
-NavigatorGroupName_Interface_2004_incominglinks=incoming links
-NavigatorGroupName_Interface_2004_outgoinglinks=outgoing links
-createNodes1Group_title=Nodes
-createNodes1Group_desc=Diagram Nodes
-createLinks2Group_title=Links
-createLinks2Group_desc=Diagram Links
-createPackage1CreationTool_title=Package
-createPackage1CreationTool_desc=Create a Package
-createComponent2CreationTool_title=Component
-createComponent2CreationTool_desc=Create a Component
-createInterfaceasCercle3CreationTool_title=Interface as Cercle
-createInterfaceasCercle3CreationTool_desc=Create an Interface as a cercle
-createRequirementlink1CreationTool_title=Requirement link
-createRequirementlink1CreationTool_desc=Create a Requirement link
-createProvidinglink2CreationTool_title=Providing link
-createProvidinglink2CreationTool_desc=Create a Providing link
-createGeneralization3CreationTool_title=Generalization
-createGeneralization3CreationTool_desc=Create a Generalization link
-NavigatorGroupName_Interface_3002_incominglinks=incoming links
-NavigatorGroupName_Interface_3002_outgoinglinks=outgoing links
-NavigatorGroupName_Component_3001_incominglinks=incoming links
-NavigatorGroupName_Component_3001_outgoinglinks=outgoing links
-NavigatorGroupName_Interface_2003_incominglinks=incoming links
-NavigatorGroupName_Interface_2003_outgoinglinks=outgoing links
-NavigatorGroupName_Package_2001_incominglinks=incoming links
-NavigatorGroupName_Package_2001_outgoinglinks=outgoing links
-NavigatorGroupName_Component_2002_incominglinks=incoming links
-NavigatorGroupName_Component_2002_outgoinglinks=outgoing links
-createInterface3CreationTool_title=Interface
-createInterface3CreationTool_desc=Create an Interface
-createProperty4CreationTool_title=Property
-createProperty4CreationTool_desc=Create a Property
-createOperation5CreationTool_title=Operation
-createOperation5CreationTool_desc=Create an Operation
-createNestedClassifier6CreationTool_title=Nested Classifier
-createNestedClassifier6CreationTool_desc=Create a Nested Classifier
-createUsage1CreationTool_title=Usage
-createUsage1CreationTool_desc=Create an Usage link
-createRealization2CreationTool_title=Realization
-createRealization2CreationTool_desc=Create a Realization link
-NavigatorGroupName_Realization_4003_target=target
-NavigatorGroupName_Realization_4003_incominglinks=incoming links
-NavigatorGroupName_Realization_4003_source=source
-NavigatorGroupName_Realization_4003_outgoinglinks=outgoing links
-NavigatorGroupName_Generalization_4004_target=target
-NavigatorGroupName_Generalization_4004_source=source
-ModelPackageContentsCompartmentEditPart_title=PackageContentsCompartment
-NavigatorGroupName_Model_2004_incominglinks=incoming links
-NavigatorGroupName_Model_2004_outgoinglinks=outgoing links
-Component1CreationTool_title=Component
-Component1CreationTool_desc=Create a Component
-InterfaceasCercle2CreationTool_title=Interface as Cercle
-InterfaceasCercle2CreationTool_desc=Create an Interface as a cercle
-Interface2CreationTool_title=Interface
-Interface2CreationTool_desc=Create an Interface
-NavigatorGroupName_InterfaceRealization_4004_target=target
-NavigatorGroupName_InterfaceRealization_4004_incominglinks=incoming links
-NavigatorGroupName_InterfaceRealization_4004_source=source
-NavigatorGroupName_InterfaceRealization_4004_outgoinglinks=outgoing links
-Interface23CreationTool_title=Interface 2
-Property4CreationTool_title=Property
-Property4CreationTool_desc=Create a Property
-Operation5CreationTool_title=Operation
-Operation5CreationTool_desc=Create an Operation
-NestedClassifier6CreationTool_title=Nested Classifier
-NestedClassifier6CreationTool_desc=Create a Nested Classifier
-createComponent1CreationTool_title=Component
-createComponent1CreationTool_desc=Create a Component
-createInterface2CreationTool_title=Interface
-createInterface2CreationTool_desc=Create an Interface
-createInterface23CreationTool_title=Interface 2
-NavigatorGroupName_Package_2005_incominglinks=incoming links
-NavigatorGroupName_Package_2005_outgoinglinks=outgoing links
-NavigatorGroupName_Realization_4005_target=target
-NavigatorGroupName_Realization_4005_incominglinks=incoming links
-NavigatorGroupName_Realization_4005_source=source
-NavigatorGroupName_Realization_4005_outgoinglinks=outgoing links
-NavigatorGroupName_InterfaceRealization_4006_target=target
-NavigatorGroupName_InterfaceRealization_4006_source=source
-NavigatorGroupName_InterfaceRealization_4006_outgoinglinks=outgoing links
-createPortCreationTool_title=Port
-createPortCreationTool_desc=Create new Port
-PackagePackageableElementCompartmentEditPart_title=PackageableElementCompartment
-PackagePackageableElementCompartment2EditPart_title=PackageableElementCompartment
-createPackage3CreationTool_title=Package
-NavigatorGroupName_Package_2004_incominglinks=incoming links
-NavigatorGroupName_Package_2004_outgoinglinks=outgoing links
-NavigatorGroupName_File_incominglinks=incoming links
-NavigatorGroupName_File_outgoinglinks=outgoing links
-createPort3CreationTool_title=Port
-createPort3CreationTool_desc=Create a Port
-ComponentCompositeCompartmentEditPart_title=CompositeCompartment
-ComponentCompositeCompartmentEditPartCN_title=CompositeCompartment
-createNodesGroup_title=Nodes
-createNodesGroup_desc=Diagram Nodes
-createLinksGroup_title=Links
-createLinksGroup_desc=Diagram Links
-createPackageCreationTool_title=Package
-createPackageCreationTool_desc=Create a Package
-createComponentCreationTool_title=Component
-createComponentCreationTool_desc=Create a Component
-createInterfaceCreationTool_title=Interface
-createInterfaceCreationTool_desc=Create an Interface
-createCommentCreationTool_title=Comment
-createCommentCreationTool_desc=Create a Comment
-createConstraintCreationTool_title=Constraint
-createConstraintCreationTool_desc=Create a Constraint
-createLinkCreationTool_title=Link
-createLinkCreationTool_desc=Create new Link (Comment / Constraint)
-createDependencyCreationTool_title=Dependency
-createDependencyCreationTool_desc=Create a Dependency
-createRequirementlinkCreationTool_title=Requirement link
-createRequirementlinkCreationTool_desc=Create a Requirement link
-createProvidinglinkCreationTool_title=Providing link
-createProvidinglinkCreationTool_desc=Create a Providing link
-createGeneralizationCreationTool_title=Generalization
-createGeneralizationCreationTool_desc=Create a Generalization link
-createComponentRealizationCreationTool_title=Component Realization
-createComponentRealizationCreationTool_desc=Create a Component Realization
-ComponentCompositeCompartmentEditPartPCN_title=CompositeCompartmentPCN
-createAbstractionCreationTool_title=Abstraction
-createAbstractionCreationTool_desc=Create an Abstraction
-createManifestationCreationTool_title=Manifestation
-createManifestationCreationTool_desc=Create a Manifestation
-createSubstitutionCreationTool_title=Substitution
-createSubstitutionCreationTool_desc=Create a Substitution
-createAssociationCreationTool_title=Association
-createManifestCreationTool_title=Manifest
-createManifestCreationTool_desc=Create a Substitution
-createAssociationCreationTool_desc=Create an Association
-createUsageCreationTool_title=Usage
-createUsageCreationTool_desc=Create an Usage
-createInterfaceRealizationCreationTool_title=Interface Realization
-createInterfaceRealizationCreationTool_desc=Create an Interface Realization
-createArtifactCreationTool_title=Artifact
-createArtifactCreationTool_desc=Create an Artefact
-createNodeCreationTool_title=Node
-createNodeCreationTool_desc=Create a Node
-createUml1Group_title=uml
-createDependency2CreationTool_title=Dependency
-createDependency2CreationTool_desc=Create new Dependency
-createConstraint3CreationTool_title=Constraint
-createConstraint3CreationTool_desc=Create new Constraint
-createAssociation4CreationTool_title=Association
-createAssociation4CreationTool_desc=Create new Association
-createGeneralization5CreationTool_title=Generalization
-createGeneralization5CreationTool_desc=Create new Generalization
-createProperty6CreationTool_title=Property
-createProperty6CreationTool_desc=Create new Property
-createDeploymentSpecification8CreationTool_title=DeploymentSpecification
-createDeploymentSpecification8CreationTool_desc=Create new DeploymentSpecification
-createArtifact9CreationTool_title=Artifact
-createArtifact9CreationTool_desc=Create new Artifact
-createInstanceSpecification11CreationTool_title=InstanceSpecification
-createInstanceSpecification11CreationTool_desc=Create new InstanceSpecification
-createDevice13CreationTool_title=Device
-createDevice13CreationTool_desc=Create new Device
-NavigatorGroupName_Artifact_2006_incominglinks=incoming links
-NavigatorGroupName_Artifact_2006_outgoinglinks=outgoing links
-NavigatorGroupName_Dependency_4004_target=target
-NavigatorGroupName_Dependency_4004_incominglinks=incoming links
-NavigatorGroupName_Dependency_4004_source=source
-NavigatorGroupName_Dependency_4004_outgoinglinks=outgoing links
-NavigatorGroupName_Device_2003_incominglinks=incoming links
-NavigatorGroupName_Device_2003_outgoinglinks=outgoing links
-NavigatorGroupName_Constraint_2005_incominglinks=incoming links
-NavigatorGroupName_Constraint_2005_outgoinglinks=outgoing links
-NavigatorGroupName_Association_4005_target=target
-NavigatorGroupName_Association_4005_incominglinks=incoming links
-NavigatorGroupName_Association_4005_source=source
-NavigatorGroupName_Association_4005_outgoinglinks=outgoing links
-NavigatorGroupName_DeploymentSpecification_2004_incominglinks=incoming links
-NavigatorGroupName_DeploymentSpecification_2004_outgoinglinks=outgoing links
-NavigatorGroupName_ExecutionEnvironment_2002_incominglinks=incoming links
-NavigatorGroupName_ExecutionEnvironment_2002_outgoinglinks=outgoing links
-NavigatorGroupName_Deployment_4001_target=target
-NavigatorGroupName_Deployment_4001_incominglinks=incoming links
-NavigatorGroupName_Deployment_4001_source=source
-NavigatorGroupName_Deployment_4001_outgoinglinks=outgoing links
-NavigatorGroupName_Manifestation_4002_target=target
-NavigatorGroupName_Manifestation_4002_incominglinks=incoming links
-NavigatorGroupName_Manifestation_4002_source=source
-NavigatorGroupName_Manifestation_4002_outgoinglinks=outgoing links
-NavigatorGroupName_InstanceSpecification_2007_incominglinks=incoming links
-NavigatorGroupName_InstanceSpecification_2007_outgoinglinks=outgoing links
-createDeploymentCreationTool_title=Deployment
-createDeploymentCreationTool_desc=Create new Deployment
-createDeploymentSpecificationCreationTool_title=DeploymentSpecification
-createDeploymentSpecificationCreationTool_desc=Create new DeploymentSpecification
-createInstanceSpecificationCreationTool_title=InstanceSpecification
-createInstanceSpecificationCreationTool_desc=Create new InstanceSpecification
-createDeviceCreationTool_title=Device
-createDeviceCreationTool_desc=Create new Device
-createExecutionEnvironmentCreationTool_title=ExecutionEnvironment
-createExecutionEnvironmentCreationTool_desc=Create new ExecutionEnvironment
-NavigatorGroupName_File_target=target
-NavigatorGroupName_File_source=source
-NodeCompositeCompartmentEditPart_title=CompositeCompartment
-DeviceCompositeCompartmentEditPart_title=DeviceCompositeCompartment
-ExecutionEnvironmentCompositeCompartmentEditPart_title=ExecutionEnvironmentCompositeCompartment
-ArtifactCompositeCompartmentEditPart_title=ArtifactCompositeCompartment
-DeviceCompositeCompartmentEditPartCN_title=DeviceCompositeCompartment
-ExecutionEnvironmentCompositeCompartmentEditPartCN_title=ExecutionEnvironmentCompositeCompartment
-NodeCompositeCompartmentEditPartCN_title=CompositeCompartment
-ArtifactCompositeCompartmentEditPartCN_title=ArtifactCompositeCompartment
-ArtifactCompositeCompartmentEditPartACN_title=ArtifactCompositeCompartment
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/model/DeploymentDiagram.gmfgen b/incoming/org.eclipse.papyrus.diagram.deployment/model/DeploymentDiagram.gmfgen
deleted file mode 100644
index 80904928a94..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/model/DeploymentDiagram.gmfgen
+++ /dev/null
@@ -1,1783 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgen="http://www.eclipse.org/gmf/2009/GenModel"
- xmlns:papyrusgmfgenextension="http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension">
- <gmfgen:GenEditorGenerator
- packageNamePrefix="org.eclipse.papyrus.diagram.deployment"
- modelID="PapyrusUMLDeploymentDiagram"
- diagramFileExtension="PapyrusUMLDeployment_diagram"
- domainFileExtension="umlDeployment"
- dynamicTemplates="true"
- templateDirectory="/org.eclipse.papyrus.def/dynamic-templates3.5/codegen"
- pluginDirectory="/org.eclipse.papyrus.diagram.deployment/src">
- <diagram
- visualID="1000"
- editPartClassName="DeploymentDiagramEditPart"
- itemSemanticEditPolicyClassName="DeploymentDiagramItemSemanticEditPolicy"
- canonicalEditPolicyClassName="ModelCanonicalEditPolicy"
- iconProviderPriority="Low"
- validationProviderPriority="Low">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- displayName="DeploymentDiagram"
- editHelperClassName="ModelEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.draw2d.FreeformLayer"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <domainDiagramElement
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Model"/>
- <childNodes
- visualID="23"
- editPartClassName="NodeEditPartCN"
- itemSemanticEditPolicyClassName="NodeItemSemanticEditPolicyCN"
- canonicalEditPolicyClassName="NodeCanonicalEditPolicyCN"
- compartments="/0/@diagram/@compartments.6"
- graphicalNodeEditPolicyClassName="NodeGraphicalNodeEditPolicyCN"
- createCommandClassName="NodeCreateCommandCN"
- containers="/0/@diagram/@compartments.2 /0/@diagram/@compartments.6">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- displayName="Node"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.NodeFigure">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"
- fixedBackground="true"/>
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="150"
- height="150"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Node"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Node/nestedNode"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Node/nestedNode"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="24"
- editPartClassName="NodeNameEditPartCN"
- itemSemanticEditPolicyClassName="NodeNameItemSemanticEditPolicyCN">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"
- fixedForeground="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </childNodes>
- <childNodes
- visualID="16"
- editPartClassName="DeviceEditPartCN"
- itemSemanticEditPolicyClassName="DeviceItemSemanticEditPolicyCN"
- canonicalEditPolicyClassName="DeviceCanonicalEditPolicyCN"
- compartments="/0/@diagram/@compartments.4"
- graphicalNodeEditPolicyClassName="DeviceGraphicalNodeEditPolicyCN"
- createCommandClassName="DeviceCreateCommandCN"
- containers="/0/@diagram/@compartments.2 /0/@diagram/@compartments.6">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.deployment.Device_16"
- displayName="Device"
- metamodelType="/0/@diagram/@topLevelNodes.3/@elementType"
- editHelperAdviceClassName=""/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.DeviceFigure">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"
- fixedBackground="true"/>
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="150"
- height="100"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Device"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Node/nestedNode"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Node/nestedNode"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="20"
- editPartClassName="DeviceNameEditPartCN"
- itemSemanticEditPolicyClassName="DeviceNameItemSemanticEditPolicyCN">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"
- fixedForeground="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </childNodes>
- <childNodes
- visualID="21"
- editPartClassName="ExecutionEnvironmentEditPartCN"
- itemSemanticEditPolicyClassName="ExecutionEnvironmentItemSemanticEditPolicyCN"
- canonicalEditPolicyClassName="ExecutionEnvironmentCanonicalEditPolicyCN"
- compartments="/0/@diagram/@compartments.5"
- graphicalNodeEditPolicyClassName="ExecutionEnvironmentGraphicalNodeEditPolicyCN"
- createCommandClassName="ExecutionEnvironmentCreateCommandCN"
- containers="/0/@diagram/@compartments.2 /0/@diagram/@compartments.0 /0/@diagram/@compartments.1 /0/@diagram/@compartments.4 /0/@diagram/@compartments.5 /0/@diagram/@compartments.6">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.deployment.ExecutionEnvironment_21"
- displayName="ExecutionEnvironment"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.ExecutionEnvironmentFigure">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"
- fixedBackground="true"/>
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="150"
- height="100"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExecutionEnvironment"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Node/nestedNode"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Node/nestedNode"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="22"
- editPartClassName="ExecutionEnvironmentNameEditPartCN"
- itemSemanticEditPolicyClassName="ExecutionEnvironmentNameItemSemanticEditPolicyCN">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"
- fixedForeground="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </childNodes>
- <childNodes
- visualID="25"
- editPartClassName="ArtifactEditPartCN"
- itemSemanticEditPolicyClassName="ArtifactItemSemanticEditPolicyCN"
- canonicalEditPolicyClassName="ArtifactCanonicalEditPolicyCN"
- compartments="/0/@diagram/@compartments.7"
- graphicalNodeEditPolicyClassName="ArtifactGraphicalNodeEditPolicyCN"
- createCommandClassName="ArtifactCreateCommandCN"
- containers="/0/@diagram/@compartments.1 /0/@diagram/@compartments.2 /0/@diagram/@compartments.5 /0/@diagram/@compartments.6">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.deployment.Artifact_25"
- displayName="Artifact"
- metamodelType="/0/@diagram/@topLevelNodes.4/@elementType"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.ArtifactFigure">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"
- fixedBackground="true"/>
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="150"
- height="50"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Artifact"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Class/nestedClassifier"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Class/nestedClassifier"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.0/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Artifact/fileName"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="27"
- editPartClassName="ArtifactNameEditPartCN"
- itemSemanticEditPolicyClassName="ArtifactNameItemSemanticEditPolicyCN">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"
- fixedForeground="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </childNodes>
- <childNodes
- visualID="28"
- editPartClassName="ArtifactEditPartACN"
- itemSemanticEditPolicyClassName="ArtifactItemSemanticEditPolicyACN"
- canonicalEditPolicyClassName="ArtifactCanonicalEditPolicyACN"
- compartments="/0/@diagram/@compartments.8"
- graphicalNodeEditPolicyClassName="ArtifactGraphicalNodeEditPolicyACN"
- createCommandClassName="ArtifactCreateCommandACN"
- containers="/0/@diagram/@compartments.3 /0/@diagram/@compartments.7 /0/@diagram/@compartments.8">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- displayName="Artifact"
- metamodelType="/0/@diagram/@topLevelNodes.4/@elementType"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.ArtifactFigure">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"
- fixedBackground="true"/>
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="150"
- height="50"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Artifact"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Artifact/nestedArtifact"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.0/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Artifact/fileName"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="29"
- editPartClassName="ArtifactNameEditPartACN"
- itemSemanticEditPolicyClassName="ArtifactNameItemSemanticEditPolicyACN">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"
- fixedForeground="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </childNodes>
- <topLevelNodes
- visualID="2001"
- editPartClassName="CommentEditPart"
- itemSemanticEditPolicyClassName="CommentItemSemanticEditPolicy"
- canonicalEditPolicyClassName="CommentCanonicalEditPolicy"
- graphicalNodeEditPolicyClassName="CommentGraphicalNodeEditPolicy"
- createCommandClassName="CommentCreateCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="CommentEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedComment"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedComment"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.2">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/body"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="1"
- editPartClassName="CommentBodyEditPart"
- itemSemanticEditPolicyClassName="CommentBodyEditPart">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCornerBentFigure"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.1">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/body"/>
- </modelFacet>
- </labels>
- </topLevelNodes>
- <topLevelNodes
- visualID="2005"
- editPartClassName="ConstraintEditPart"
- itemSemanticEditPolicyClassName="ConstraintItemSemanticEditPolicy"
- canonicalEditPolicyClassName="ConstraintCanonicalEditPolicy"
- graphicalNodeEditPolicyClassName="ConstraintGraphicalNodeEditPolicy"
- createCommandClassName="ConstraintCreateCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="ConstraintEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.node.ConstraintFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Namespace/ownedRule"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Namespace/ownedRule"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.1">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/specification"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="2"
- editPartClassName="ConstraintNameEditPart"
- itemSemanticEditPolicyClassName="ConstraintNameItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- visualID="3"
- editPartClassName="ConstraintSpecificationEditPart"
- itemSemanticEditPolicyClassName="ConstraintSpecificationItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getConstraintFigure"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.node.ConstraintFigure"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.3">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/specification"/>
- <editableMetaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/specification"/>
- </modelFacet>
- </labels>
- </topLevelNodes>
- <topLevelNodes
- visualID="2002"
- editPartClassName="ExecutionEnvironmentEditPart"
- itemSemanticEditPolicyClassName="ExecutionEnvironmentItemSemanticEditPolicy"
- canonicalEditPolicyClassName="ExecutionEnvironmentCanonicalEditPolicy"
- compartments="/0/@diagram/@compartments.1"
- graphicalNodeEditPolicyClassName="ExecutionEnvironmentGraphicalNodeEditPolicy"
- createCommandClassName="ExecutionEnvironmentCreateCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="ExecutionEnvironmentEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.ExecutionEnvironmentFigure">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"
- fixedBackground="true"/>
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="150"
- height="100"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExecutionEnvironment"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="5"
- editPartClassName="ExecutionEnvironmentNameEditPart"
- itemSemanticEditPolicyClassName="ExecutionEnvironmentNameItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"
- fixedForeground="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </topLevelNodes>
- <topLevelNodes
- visualID="2003"
- editPartClassName="DeviceEditPart"
- itemSemanticEditPolicyClassName="DeviceItemSemanticEditPolicy"
- canonicalEditPolicyClassName="DeviceCanonicalEditPolicy"
- compartments="/0/@diagram/@compartments.0"
- graphicalNodeEditPolicyClassName="DeviceGraphicalNodeEditPolicy"
- createCommandClassName="DeviceCreateCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="DeviceEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.DeviceFigure">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"
- fixedBackground="true"/>
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="150"
- height="100"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Device"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="6"
- editPartClassName="DeviceNameEditPart"
- itemSemanticEditPolicyClassName="DeviceNameItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"
- fixedForeground="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </topLevelNodes>
- <topLevelNodes
- visualID="2006"
- editPartClassName="ArtifactEditPart"
- itemSemanticEditPolicyClassName="ArtifactItemSemanticEditPolicy"
- canonicalEditPolicyClassName="ArtifactCanonicalEditPolicy"
- compartments="/0/@diagram/@compartments.3"
- graphicalNodeEditPolicyClassName="ArtifactGraphicalNodeEditPolicy"
- createCommandClassName="ArtifactCreateCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="ArtifactEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.ArtifactFigure">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"
- fixedBackground="true"/>
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="150"
- height="50"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Artifact"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.0/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Artifact/fileName"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="8"
- editPartClassName="ArtifactNameEditPart"
- itemSemanticEditPolicyClassName="ArtifactNameItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"
- fixedForeground="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </topLevelNodes>
- <topLevelNodes
- visualID="2008"
- compartments="/0/@diagram/@compartments.2">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="NodeEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.NodeFigure">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"
- fixedBackground="true"/>
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="150"
- height="150"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="&quot;REMOVE_ORPHAN_VIEW&quot;"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Node"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="9"
- editPartClassName="NodeNameEditPart"
- itemSemanticEditPolicyClassName="NodeNameItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"
- fixedForeground="true"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0"
- editPattern="">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </topLevelNodes>
- <links
- visualID="4005"
- editPartClassName="LinkDescriptorEditPart"
- itemSemanticEditPolicyClassName="LinkDescriptorItemSemanticEditPolicy"
- createCommandClassName="LinkDescriptorCreateCommand"
- reorientCommandClassName="LinkDescriptorReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:NotationType"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="LinkDescriptor"
- classBody="&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class LinkDescriptor extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public LinkDescriptor() {&#xD;&#xA;&#x9;&#x9;this.setLineWidth(1);&#xD;&#xA;this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASH);&#xD;&#xA;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#xD;&#xA;"/>
- </links>
- <links
- visualID="4008"
- editPartClassName="CommentAnnotatedElementEditPart"
- itemSemanticEditPolicyClassName="CommentAnnotatedElementItemSemanticEditPolicy"
- createCommandClassName="CommentAnnotatedElementCreateCommand"
- reorientCommandClassName="CommentAnnotatedElementReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.deployment.CommentAnnotatedElement_4006"
- displayName="CommentAnnotatedElement"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="LinkDescriptor"
- classBody="&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class LinkDescriptor extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public LinkDescriptor() {&#xD;&#xA;&#x9;&#x9;this.setLineWidth(1);&#xD;&#xA;this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASH);&#xD;&#xA;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#xD;&#xA;"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLinkModelFacet">
- <metaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/annotatedElement"/>
- </modelFacet>
- </links>
- <links
- visualID="4009"
- editPartClassName="ConstraintConstrainedElementEditPart"
- itemSemanticEditPolicyClassName="ConstraintConstrainedElementItemSemanticEditPolicy"
- createCommandClassName="ConstraintConstrainedElementCreateCommand"
- reorientCommandClassName="ConstraintConstrainedElementReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.diagram.deployment.ConstraintConstrainedElement_4007"
- displayName="ConstraintConstrainedElement"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="LinkDescriptor"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class LinkDescriptor extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public LinkDescriptor() {&#xA;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASH);&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLinkModelFacet">
- <metaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/constrainedElement"/>
- </modelFacet>
- </links>
- <links
- visualID="4001"
- editPartClassName="DeploymentEditPart"
- itemSemanticEditPolicyClassName="DeploymentItemSemanticEditPolicy"
- createCommandClassName="DeploymentCreateCommand"
- reorientCommandClassName="DeploymentReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="DeploymentEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.edge.DashedEdgeFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeDeploymentLabelDisplayEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:TypeLinkModelFacet">
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Deployment"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DeploymentTarget/deployment"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DeploymentTarget/deployment"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- <sourceMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/client"/>
- <targetMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/supplier"/>
- </modelFacet>
- <labels
- visualID="13"
- editPartClassName="DeploymentNameEditPart"
- itemSemanticEditPolicyClassName="DeploymentNameItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="60"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- visualID="14"
- editPartClassName="DeploymentAppliedStereotypeEditPart"
- itemSemanticEditPolicyClassName="DeploymentAppliedStereotypeItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getAppliedStereotypeLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="60"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.2"
- viewPattern="&lt;&lt;{0}>>"
- editorPattern="&lt;&lt;{0}>>"
- editPattern="&lt;&lt;{0}>>">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </links>
- <links
- visualID="4002"
- editPartClassName="ManifestationEditPart"
- itemSemanticEditPolicyClassName="ManifestationItemSemanticEditPolicy"
- createCommandClassName="ManifestationCreateCommand"
- reorientCommandClassName="ManifestationReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="ManifestationEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.edge.DashedEdgeFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeManifestationLabelDisplayEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:TypeLinkModelFacet">
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Manifestation"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Artifact/manifestation"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Artifact/manifestation"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- <sourceMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/client"/>
- <targetMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/supplier"/>
- </modelFacet>
- <labels
- visualID="10"
- editPartClassName="ManifestationNameEditPart"
- itemSemanticEditPolicyClassName="ManifestationNameItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="60"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- visualID="11"
- editPartClassName="ManifestationAppliedStereotypeEditPart"
- itemSemanticEditPolicyClassName="ManifestationAppliedStereotypeItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getAppliedStereotypeLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="30"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.2"
- viewPattern="&lt;&lt;{0}>>"
- editorPattern="&lt;&lt;{0}>>"
- editPattern="&lt;&lt;{0}>>">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </links>
- <links
- visualID="4003"
- editPartClassName="GeneralizationEditPart"
- itemSemanticEditPolicyClassName="GeneralizationItemSemanticEditPolicy"
- createCommandClassName="GeneralizationCreateCommand"
- reorientCommandClassName="GeneralizationReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="GeneralizationEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.edge.GeneralizationFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:TypeLinkModelFacet">
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Generalization"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Classifier/generalization"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Classifier/generalization"/>
- <sourceMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Generalization/specific"/>
- <targetMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Generalization/general"/>
- </modelFacet>
- <labels
- visualID="4"
- editPartClassName="GeneralizationAppliedStereotypeEditPart"
- itemSemanticEditPolicyClassName="GeneralizationAppliedStereotypeItemSemanticEditPolicy"
- readOnly="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getAppliedStereotypeLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="60"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.2"
- viewPattern="&lt;&lt;{0}>>"
- editorPattern="&lt;&lt;{0}>>"
- editPattern="&lt;&lt;{0}>>">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Generalization/isSubstitutable"/>
- </modelFacet>
- </labels>
- </links>
- <links
- visualID="4004"
- editPartClassName="DependencyEditPart"
- itemSemanticEditPolicyClassName="DependencyItemSemanticEditPolicy"
- createCommandClassName="DependencyCreateCommand"
- reorientCommandClassName="DependencyReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="DependencyEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.diagram.common.figure.edge.DashedEdgeFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:TypeLinkModelFacet">
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.0">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- <sourceMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/client"/>
- <targetMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency/supplier"/>
- </modelFacet>
- <labels
- visualID="12"
- editPartClassName="DependencyNameEditPart"
- itemSemanticEditPolicyClassName="DependencyNameItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="60"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0"
- editorPattern="">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- visualID="15"
- editPartClassName="DependencyAppliedStereotypeEditPart"
- itemSemanticEditPolicyClassName="DependencyAppliedStereotypeItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getAppliedStereotypeLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="60"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.2"
- viewPattern="&lt;&lt;{0}>>"
- editorPattern="&lt;&lt;{0}>>"
- editPattern="&lt;&lt;{0}>>">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </links>
- <compartments
- visualID="17"
- editPartClassName="DeviceCompositeCompartmentEditPart"
- itemSemanticEditPolicyClassName="DeviceCompositeCompartmentItemSemanticEditPolicy"
- canonicalEditPolicyClassName="DeviceCompositeCompartmentCanonicalEditPolicy"
- childNodes="/0/@diagram/@childNodes.2"
- title="DeviceCompositeCompartment"
- canCollapse="false"
- needsTitle="false"
- node="/0/@diagram/@topLevelNodes.3"
- listLayout="false">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCompositeCompartmentFigure"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy"/>
- </compartments>
- <compartments
- visualID="18"
- editPartClassName="ExecutionEnvironmentCompositeCompartmentEditPart"
- itemSemanticEditPolicyClassName="ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicy"
- canonicalEditPolicyClassName="ExecutionEnvironmentCompositeCompartmentCanonicalEditPolicy"
- childNodes="/0/@diagram/@childNodes.2 /0/@diagram/@childNodes.3"
- title="ExecutionEnvironmentCompositeCompartment"
- canCollapse="false"
- needsTitle="false"
- node="/0/@diagram/@topLevelNodes.2"
- listLayout="false">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCompositeCompartmentFigure"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy"/>
- </compartments>
- <compartments
- visualID="19"
- editPartClassName="NodeCompositeCompartmentEditPart"
- itemSemanticEditPolicyClassName="NodeCompositeCompartmentItemSemanticEditPolicy"
- canonicalEditPolicyClassName="NodeCompositeCompartmentCanonicalEditPolicy"
- childNodes="/0/@diagram/@childNodes.1 /0/@diagram/@childNodes.2 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.0"
- title="CompositeCompartment"
- canCollapse="false"
- needsTitle="false"
- node="/0/@diagram/@topLevelNodes.5"
- listLayout="false">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCompositeCompartmentFigure"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy"/>
- </compartments>
- <compartments
- visualID="26"
- editPartClassName="ArtifactCompositeCompartmentEditPart"
- itemSemanticEditPolicyClassName="ArtifactCompositeCompartmentItemSemanticEditPolicy"
- canonicalEditPolicyClassName="ArtifactCompositeCompartmentCanonicalEditPolicy"
- childNodes="/0/@diagram/@childNodes.4"
- title="ArtifactCompositeCompartment"
- needsTitle="false"
- node="/0/@diagram/@topLevelNodes.4"
- listLayout="false">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCompositeCompartmentFigure"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy"/>
- </compartments>
- <compartments
- visualID="30"
- editPartClassName="DeviceCompositeCompartmentEditPartCN"
- itemSemanticEditPolicyClassName="DeviceCompositeCompartmentItemSemanticEditPolicyCN"
- canonicalEditPolicyClassName="DeviceCompositeCompartmentCanonicalEditPolicyCN"
- childNodes="/0/@diagram/@childNodes.2"
- title="DeviceCompositeCompartment"
- needsTitle="false"
- node="/0/@diagram/@childNodes.1"
- listLayout="false">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCompositeCompartmentFigure"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy"/>
- </compartments>
- <compartments
- visualID="31"
- editPartClassName="ExecutionEnvironmentCompositeCompartmentEditPartCN"
- itemSemanticEditPolicyClassName="ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicyCN"
- canonicalEditPolicyClassName="ExecutionEnvironmentCompositeCompartmentCanonicalEditPolicyCN"
- childNodes="/0/@diagram/@childNodes.3 /0/@diagram/@childNodes.2"
- title="ExecutionEnvironmentCompositeCompartment"
- needsTitle="false"
- node="/0/@diagram/@childNodes.2"
- listLayout="false">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCompositeCompartmentFigure"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy"/>
- </compartments>
- <compartments
- visualID="32"
- editPartClassName="NodeCompositeCompartmentEditPartCN"
- itemSemanticEditPolicyClassName="NodeCompositeCompartmentItemSemanticEditPolicyCN"
- canonicalEditPolicyClassName="NodeCompositeCompartmentCanonicalEditPolicyCN"
- childNodes="/0/@diagram/@childNodes.1 /0/@diagram/@childNodes.2 /0/@diagram/@childNodes.0 /0/@diagram/@childNodes.3"
- title="CompositeCompartment"
- needsTitle="false"
- node="/0/@diagram/@childNodes.0"
- listLayout="false">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCompositeCompartmentFigure"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy"/>
- </compartments>
- <compartments
- visualID="33"
- editPartClassName="ArtifactCompositeCompartmentEditPartCN"
- itemSemanticEditPolicyClassName="ArtifactCompositeCompartmentItemSemanticEditPolicyCN"
- canonicalEditPolicyClassName="ArtifactCompositeCompartmentCanonicalEditPolicyCN"
- childNodes="/0/@diagram/@childNodes.4"
- title="ArtifactCompositeCompartment"
- needsTitle="false"
- node="/0/@diagram/@childNodes.3"
- listLayout="false">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCompositeCompartmentFigure"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy"/>
- </compartments>
- <compartments
- visualID="34"
- editPartClassName="ArtifactCompositeCompartmentEditPartACN"
- itemSemanticEditPolicyClassName="ArtifactCompositeCompartmentItemSemanticEditPolicyACN"
- canonicalEditPolicyClassName="ArtifactCompositeCompartmentCanonicalEditPolicyACN"
- childNodes="/0/@diagram/@childNodes.4"
- title="ArtifactCompositeCompartment"
- needsTitle="false"
- node="/0/@diagram/@childNodes.4"
- listLayout="false">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCompositeCompartmentFigure"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy"/>
- </compartments>
- <palette>
- <groups
- title="Nodes"
- description="Nodes"
- largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- createMethodName="createNodesGroup"
- id="&quot;deployment.group.nodes&quot;">
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Node"
- description="Create new Node"
- largeIconPath="icons/obj16/Node.gif"
- smallIconPath="icons/obj16/Node.gif"
- createMethodName="createNodeCreationTool"
- id="&quot;deployment.tool.node&quot;"
- genNodes="/0/@diagram/@topLevelNodes.5 /0/@diagram/@childNodes.0"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Device"
- description="Create new Device"
- largeIconPath="icons/obj16/Device.gif"
- smallIconPath="icons/obj16/Device.gif"
- createMethodName="createDeviceCreationTool"
- id="&quot;deployment.tool.device&quot;"
- genNodes="/0/@diagram/@topLevelNodes.3 /0/@diagram/@childNodes.1"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Execution Environment"
- description="Create new ExecutionEnvironment"
- largeIconPath="icons/obj16/ExecutionEnvironment.gif"
- smallIconPath="icons/obj16/ExecutionEnvironment.gif"
- createMethodName="createExecutionEnvironmentCreationTool"
- id="&quot;deployment.tool.executionEnvironment&quot;"
- genNodes="/0/@diagram/@topLevelNodes.2 /0/@diagram/@childNodes.2"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Artifact"
- description="Create new Artifact"
- largeIconPath="icons/obj16/Artifact.gif"
- smallIconPath="icons/obj16/Artifact.gif"
- createMethodName="createArtifactCreationTool"
- id="&quot;deployment.tool.artifact&quot;"
- genNodes="/0/@diagram/@topLevelNodes.4 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.4"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Comment"
- description="Create new Comment"
- largeIconPath="icons/obj16/Comment.gif"
- smallIconPath="icons/obj16/Comment.gif"
- createMethodName="createCommentCreationTool"
- id="&quot;deployment.tool.comment&quot;"
- genNodes="/0/@diagram/@topLevelNodes.0"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Constraint"
- description="Create new Constraint"
- largeIconPath="icons/obj16/Constraint.gif"
- smallIconPath="icons/obj16/Constraint.gif"
- createMethodName="createConstraintCreationTool"
- id="&quot;deployment.tool.constraint&quot;"
- genNodes="/0/@diagram/@topLevelNodes.1"/>
- </groups>
- <groups
- title="Links"
- description="Links"
- largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- createMethodName="createLinksGroup"
- id="&quot;deployment.group.links&quot;"
- stack="true"
- collapse="true">
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Link"
- description="Create new Link (Comment / Constraint)"
- largeIconPath="icons/obj16/Link.gif"
- smallIconPath="icons/obj16/Link.gif"
- createMethodName="createLinkCreationTool"
- id="&quot;deployment.tool.link&quot;"
- genLinks="/0/@diagram/@links.1 /0/@diagram/@links.2"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Dependency"
- description="Create new Dependency"
- largeIconPath="icons/obj16/Dependency.gif"
- smallIconPath="icons/obj16/Dependency.gif"
- createMethodName="createDependencyCreationTool"
- id="&quot;deployment.tool.dependency&quot;"
- genLinks="/0/@diagram/@links.6"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Generalization"
- description="Create new Generalization"
- largeIconPath="icons/obj16/Generalization.gif"
- smallIconPath="icons/obj16/Generalization.gif"
- createMethodName="createGeneralizationCreationTool"
- id="&quot;deployment.tool.generalization&quot;"
- genLinks="/0/@diagram/@links.5"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Deployment"
- description="Create new Deployment"
- largeIconPath="icons/obj16/Deployment.gif"
- smallIconPath="icons/obj16/Deployment.gif"
- createMethodName="createDeploymentCreationTool"
- id="&quot;deployment.tool.deployment&quot;"
- genLinks="/0/@diagram/@links.3"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Manifestation"
- description="Create new Manifestation"
- largeIconPath="icons/obj16/Manifestation.gif"
- smallIconPath="icons/obj16/Manifestation.gif"
- createMethodName="createManifestationCreationTool"
- id="&quot;deployment.tool.manifestation&quot;"
- genLinks="/0/@diagram/@links.4"/>
- </groups>
- </palette>
- <preferencePages
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.general"
- name="UML Diagram">
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.appearance"
- name="Appearance"
- kind="Appearance"/>
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.connections"
- name="Connections"
- kind="Connections"/>
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.printing"
- name="Printing"
- kind="Printing"/>
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.rulersAndGrid"
- name="Rulers And Grid"
- kind="RulersAndGrid"/>
- </preferencePages>
- </diagram>
- <plugin
- iD="org.eclipse.papyrus.diagram.deployment"
- name="Papyrus Deployment Diagram (Incubation)"
- provider="Eclipse Modeling Project"
- version="0.8.0.qualifier">
- <requiredPlugins>org.eclipse.draw2d</requiredPlugins>
- <requiredPlugins>org.eclipse.gmf.runtime.draw2d.ui</requiredPlugins>
- </plugin>
- <editor
- iconPath="icons/obj16/DeploymentDiagram.gif"/>
- <diagramUpdater/>
- <propertySheet>
- <tabs
- xsi:type="gmfgen:GenStandardPropertyTab"
- iD="appearance"/>
- <tabs
- xsi:type="gmfgen:GenStandardPropertyTab"
- iD="diagram"/>
- <tabs
- xsi:type="gmfgen:GenCustomPropertyTab"
- iD="domain"
- label="Core">
- <filter
- xsi:type="gmfgen:TypeTabFilter">
- <types>org.eclipse.gmf.runtime.notation.View</types>
- <types>org.eclipse.gef.EditPart</types>
- <generatedTypes>abstractNavigatorItem</generatedTypes>
- </filter>
- </tabs>
- </propertySheet>
- <domainGenModel
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#/"/>
- <expressionProviders>
- <providers
- xsi:type="gmfgen:GenExpressionInterpreter">
- <expressions
- body="self.name.concat('.file') "/>
- </providers>
- <providers
- xsi:type="gmfgen:GenJavaExpressionProvider"
- injectExpressionBody="true">
- <expressions
- body="return org.eclipse.papyrus.diagram.common.helper.NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());"/>
- <expressions
- body="// Constraint specification init&#xD;&#xA;org.eclipse.uml2.uml.LiteralString value = org.eclipse.uml2.uml.UMLFactory.eINSTANCE.createLiteralString();&#xD;&#xA;value.setValue(&quot;&quot;);&#xD;&#xA;return value;"/>
- <expressions
- body="// Comment body init&#xD;&#xA;return &quot;&quot;;"/>
- <expressions
- xsi:type="gmfgen:GenConstraint"
- body="// Creation constraint for TopLevelNodes&#xD;&#xA;&#x9;if(! (getElementToEdit() instanceof org.eclipse.uml2.uml.Package)) {&#xD;&#xA;&#x9;&#x9;return false;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;return true;"/>
- </providers>
- </expressionProviders>
- <labelParsers
- extensibleViaService="true">
- <implementations
- xsi:type="gmfgen:PredefinedParser"
- uses="/0/@diagram/@topLevelNodes.1/@labels.0/@modelFacet /0/@diagram/@topLevelNodes.2/@labels.0/@modelFacet /0/@diagram/@topLevelNodes.3/@labels.0/@modelFacet /0/@diagram/@topLevelNodes.4/@labels.0/@modelFacet /0/@diagram/@topLevelNodes.5/@labels.0/@modelFacet /0/@diagram/@links.4/@labels.0/@modelFacet /0/@diagram/@links.6/@labels.0/@modelFacet /0/@diagram/@links.3/@labels.0/@modelFacet /0/@diagram/@childNodes.1/@labels.0/@modelFacet /0/@diagram/@childNodes.2/@labels.0/@modelFacet /0/@diagram/@childNodes.0/@labels.0/@modelFacet /0/@diagram/@childNodes.3/@labels.0/@modelFacet /0/@diagram/@childNodes.4/@labels.0/@modelFacet"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="/0/@diagram/@topLevelNodes.0/@labels.0/@modelFacet"
- qualifiedName="org.eclipse.papyrus.diagram.common.parser.CommentParser"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="/0/@diagram/@links.5/@labels.0/@modelFacet /0/@diagram/@links.4/@labels.1/@modelFacet /0/@diagram/@links.6/@labels.1/@modelFacet /0/@diagram/@links.3/@labels.1/@modelFacet"
- qualifiedName="org.eclipse.papyrus.diagram.common.parser.stereotype.AppliedStereotypeParser"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="/0/@diagram/@topLevelNodes.1/@labels.1/@modelFacet"
- qualifiedName="org.eclipse.papyrus.diagram.common.parser.ConstraintParser"/>
- </labelParsers>
- <contextMenus
- context="/0/@diagram">
- <items
- xsi:type="gmfgen:LoadResourceAction"/>
- </contextMenus>
- </gmfgen:GenEditorGenerator>
- <papyrusgmfgenextension:PapyrusExtensionRootNode
- comment="Papyrus specific extension for GMFGen">
- <extensionNodes
- xsi:type="papyrusgmfgenextension:ExtendedGenView"
- comment="Manages stereotype shown with External Label"
- genView="/0/@diagram/@links.5/@labels.0 /0/@diagram/@links.3/@labels.1 /0/@diagram/@links.4/@labels.1 /0/@diagram/@links.6/@labels.1"
- name="EP_Stereotypes_EXT_NODE"
- superOwnedEditPart="org.eclipse.papyrus.diagram.common.editparts.AbstractLabelEditPart"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:ExtendedGenView"
- comment="Add super class to a Comment edit parts"
- genView="/0/@diagram/@topLevelNodes.0"
- name="EP_Comment_NODE"
- superOwnedEditPart="org.eclipse.papyrus.diagram.common.editparts.AbstractCommentEditPart"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:ExtendedGenView"
- comment="Add super class to a Constraint edit parts"
- genView="/0/@diagram/@topLevelNodes.1"
- name="EP_Constraint_NODE"
- superOwnedEditPart="org.eclipse.papyrus.diagram.common.editparts.AbstractConstraintEditPart"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:GenNodeConstraint"
- comment="Creation constraint for TopLevelNode in virtual canvas"
- genNode="/0/@diagram/@topLevelNodes.0 /0/@diagram/@topLevelNodes.1 /0/@diagram/@topLevelNodes.2 /0/@diagram/@topLevelNodes.3 /0/@diagram/@topLevelNodes.4 /0/@diagram/@topLevelNodes.5"
- genConstraint="/0/@expressionProviders/@providers.1/@expressions.3"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:AdditionalEditPartCandies"
- comment="Indicate specific BaseEditHelper in place of generated EditHelper"
- baseEditHelperPackage="org.eclipse.papyrus.diagram.common.helper"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:EditPartUsingDeleteService"
- comment="The delete service is used on every TopNode Childnode and Link"
- name="Every TopNode ChildNode Link"
- genView="/0/@diagram/@topLevelNodes.0 /0/@diagram/@topLevelNodes.1 /0/@diagram/@topLevelNodes.2 /0/@diagram/@topLevelNodes.3 /0/@diagram/@topLevelNodes.4 /0/@diagram/@topLevelNodes.5 /0/@diagram/@links.3 /0/@diagram/@links.4 /0/@diagram/@links.5 /0/@diagram/@links.6 /0/@diagram/@links.1 /0/@diagram/@links.2"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:EditPartUsingReorientService"
- comment="Use the edit service for reorient command (All DirectedRelationship)"
- name="DirectedRelationship"
- genView="/0/@diagram/@links.3 /0/@diagram/@links.4 /0/@diagram/@links.5 /0/@diagram/@links.6"/>
- </papyrusgmfgenextension:PapyrusExtensionRootNode>
-</xmi:XMI>
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/plugin.properties b/incoming/org.eclipse.papyrus.diagram.deployment/plugin.properties
deleted file mode 100644
index c127b7a5e68..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/plugin.properties
+++ /dev/null
@@ -1,1140 +0,0 @@
-pluginName=Papyrus Component Diagram (Incubation)
-providerName=Eclipse Modeling Project
-_UI_CreateChild_text = {0}
-_UI_CreateChild_text2 = {1} {0}
-_UI_CreateChild_text3 = {1}
-_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
-_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
-_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
- _UI_PropertyDescriptor_description = The {0} of the {1}
- _UI_Connexion_type = Connexion
-_UI_Eclipse_type = Eclipse
-_UI_Rectangle_type = Rectangle
-_UI_Forme_type = Forme
-_UI_FormesDiagram_type = Formes Diagram
-_UI_Unknown_type = Object
- _UI_Unknown_datatype= Value
- _UI_Connexion_source_feature = Source
-_UI_Connexion_destination_feature = Destination
-_UI_Connexion_label_feature = Label
-_UI_Forme_sourceConnexions_feature = Source Connexions
-_UI_Forme_destConnexions_feature = Dest Connexions
-_UI_Forme_nom_feature = Nom
-_UI_FormesDiagram_formes_feature = Formes
-_UI_Unknown_feature = Unspecified
-
-_UI_MyDiagramEditor_menu = &MyDiagram Editor
- _UI_CreateChild_menu_item = &New Child
-_UI_CreateSibling_menu_item = N&ew Sibling
- _UI_ShowPropertiesView_menu_item = Show &Properties View
-_UI_RefreshViewer_menu_item = &Refresh
- _UI_SelectionPage_label = Selection
-_UI_ParentPage_label = Parent
-_UI_ListPage_label = List
-_UI_TreePage_label = Tree
-_UI_TablePage_label = Table
-_UI_TreeWithColumnsPage_label = Tree with Columns
-_UI_ObjectColumn_label = Object
-_UI_SelfColumn_label = Self
- _UI_NoObjectSelected = Selected Nothing
-_UI_SingleObjectSelected = Selected Object: {0}
-_UI_MultiObjectSelected = Selected {0} Objects
- _UI_OpenEditorError_label = Open Editor
- _UI_Wizard_category = Example EMF Model Creation Wizards
- _UI_CreateModelError_message = Problems encountered in file "{0}"
- _UI_MyDiagramModelWizard_label = MyDiagram Model
-_UI_MyDiagramModelWizard_description = Create a new MyDiagram model
- _UI_MyDiagramEditor_label = MyDiagram Model Editor
- _UI_MyDiagramEditorFilenameDefaultBase = My
-_UI_MyDiagramEditorFilenameExtensions = mydiagram
- _UI_Wizard_label = New
- _WARN_FilenameExtension = The file name must end in ''.{0}''
-_WARN_FilenameExtensions = The file name must have one of the following extensions: {0}
- _UI_ModelObject = &Model Object
-_UI_XMLEncoding = &XML Encoding
-_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1
-_UI_Wizard_initial_object_description = Select a model object to create
- _UI_FileConflict_label = File Conflict
-_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
-
-editorName=ComponentDiagram Diagram Editing
-context.description=ComponentDiagram Diagram Editing
-context.name=In ComponentDiagram Diagram Editor
-newWizardName=ComponentDiagram Diagram
-newWizardDesc=Creates ComponentDiagram diagram.
- initDiagramActionLabel=Initialize mydiagram_diagram diagram file
- navigatorContentName=*.mydiagram_diagram diagram contents
-domainNavigatorContentName=*.mydiagram model contents
-update.diagram.name=Update ComponentDiagram diagram
-update.diagram.description=Perform ComponentDiagram diagram update
- tab.appearance=Appearance
-tab.diagram=Rulers & Grid
-tab.domain=Core
- prefpage.org.eclipse.papyrus.diagram.component.diagram.general=ComponentDiagram Diagram
-prefpage.org.eclipse.papyrus.diagram.component.diagram.appearance=Appearance
-prefpage.org.eclipse.papyrus.diagram.component.diagram.connections=Connections
-prefpage.org.eclipse.papyrus.diagram.component.diagram.printing=Printing
-prefpage.org.eclipse.papyrus.diagram.component.diagram.rulersAndGrid=Rulers And Grid
- metatype.name.FormesDiagram_1000=Undefined
-metatype.name.Rectangle_2001=Rectangle
-metatype.name.Eclipse_2002=Eclipse
-metatype.name.Connexion_4001=Connexion
-metatype.name.FormeDestConnexions_4002=Undefined
- cmdcategory.name=ComponentDiagram Editor Commands
-cmdcategory.desc=ComponentDiagram Editor Commands
-
-_UI_org.eclipse.papyrus.diagram.componentEditor_menu = &org.eclipse.papyrus.diagram.component Editor
- _UI_org.eclipse.papyrus.diagram.componentModelWizard_label = org.eclipse.papyrus.diagram.component Model
-_UI_org.eclipse.papyrus.diagram.componentModelWizard_description = Create a new org.eclipse.papyrus.diagram.component model
- _UI_org.eclipse.papyrus.diagram.componentEditor_label = org.eclipse.papyrus.diagram.component Model Editor
- _UI_org.eclipse.papyrus.diagram.componentEditorFilenameDefaultBase = My
-_UI_org.eclipse.papyrus.diagram.componentEditorFilenameExtensions = org.eclipse.papyrus.diagram.component
-
-prefpage.org.eclipse.uml2.uml.diagram.general=UML Diagram
-prefpage.org.eclipse.uml2.uml.diagram.appearance=Appearance
-prefpage.org.eclipse.uml2.uml.diagram.connections=Connections
-prefpage.org.eclipse.uml2.uml.diagram.printing=Printing
-prefpage.org.eclipse.uml2.uml.diagram.rulersAndGrid=Rulers And Grid
- metatype.name.Package_1000=Undefined
-metatype.name.Component_2001=Component
-metatype.name.Usage_4001=Usage
-
-_UI_UML_content_type = UML File
-_UI_Comment_type = Comment
-_UI_Element_type = Element
-_UI_Package_type = Package
-_UI_PackageableElement_type = Packageable Element
-_UI_NamedElement_type = Named Element
-_UI_Dependency_type = Dependency
-_UI_DirectedRelationship_type = Directed Relationship
-_UI_Relationship_type = Relationship
-_UI_Namespace_type = Namespace
-_UI_ElementImport_type = Element Import
-_UI_PackageImport_type = Package Import
-_UI_Constraint_type = Constraint
-_UI_ValueSpecification_type = Value Specification
-_UI_TypedElement_type = Typed Element
-_UI_Type_type = Type
-_UI_Association_type = Association
-_UI_Classifier_type = Classifier
-_UI_RedefinableElement_type = Redefinable Element
-_UI_TemplateableElement_type = Templateable Element
-_UI_TemplateBinding_type = Template Binding
-_UI_TemplateSignature_type = Template Signature
-_UI_TemplateParameter_type = Template Parameter
-_UI_ParameterableElement_type = Parameterable Element
-_UI_TemplateParameterSubstitution_type = Template Parameter Substitution
-_UI_Generalization_type = Generalization
-_UI_GeneralizationSet_type = Generalization Set
-_UI_Feature_type = Feature
-_UI_Substitution_type = Substitution
-_UI_Realization_type = Realization
-_UI_Abstraction_type = Abstraction
-_UI_OpaqueExpression_type = Opaque Expression
-_UI_Parameter_type = Parameter
-_UI_MultiplicityElement_type = Multiplicity Element
-_UI_ConnectableElement_type = Connectable Element
-_UI_ConnectorEnd_type = Connector End
-_UI_Property_type = Property
-_UI_DeploymentTarget_type = Deployment Target
-_UI_Deployment_type = Deployment
-_UI_DeployedArtifact_type = Deployed Artifact
-_UI_DeploymentSpecification_type = Deployment Specification
-_UI_Artifact_type = Artifact
-_UI_Manifestation_type = Manifestation
-_UI_Operation_type = Operation
-_UI_BehavioralFeature_type = Behavioral Feature
-_UI_Behavior_type = Behavior
-_UI_Class_type = Class
-_UI_BehavioredClassifier_type = Behaviored Classifier
-_UI_InterfaceRealization_type = Interface Realization
-_UI_Interface_type = Interface
-_UI_Reception_type = Reception
-_UI_Signal_type = Signal
-_UI_ProtocolStateMachine_type = Protocol State Machine
-_UI_StateMachine_type = State Machine
-_UI_Region_type = Region
-_UI_Vertex_type = Vertex
-_UI_Transition_type = Transition
-_UI_Trigger_type = Trigger
-_UI_Event_type = Event
-_UI_Port_type = Port
-_UI_State_type = State
-_UI_ConnectionPointReference_type = Connection Point Reference
-_UI_Pseudostate_type = Pseudostate
-_UI_ProtocolConformance_type = Protocol Conformance
-_UI_EncapsulatedClassifier_type = Encapsulated Classifier
-_UI_StructuredClassifier_type = Structured Classifier
-_UI_Connector_type = Connector
-_UI_Extension_type = Extension
-_UI_ExtensionEnd_type = Extension End
-_UI_Stereotype_type = Stereotype
-_UI_Image_type = Image
-_UI_Profile_type = Profile
-_UI_Model_type = Model
-_UI_ParameterSet_type = Parameter Set
-_UI_DataType_type = Data Type
-_UI_OperationTemplateParameter_type = Operation Template Parameter
-_UI_StructuralFeature_type = Structural Feature
-_UI_ConnectableElementTemplateParameter_type = Connectable Element Template Parameter
-_UI_CollaborationUse_type = Collaboration Use
-_UI_Collaboration_type = Collaboration
-_UI_UseCase_type = Use Case
-_UI_Include_type = Include
-_UI_Extend_type = Extend
-_UI_ExtensionPoint_type = Extension Point
-_UI_RedefinableTemplateSignature_type = Redefinable Template Signature
-_UI_ClassifierTemplateParameter_type = Classifier Template Parameter
-_UI_StringExpression_type = String Expression
-_UI_Expression_type = Expression
-_UI_Usage_type = Usage
-_UI_PackageMerge_type = Package Merge
-_UI_ProfileApplication_type = Profile Application
-_UI_Enumeration_type = Enumeration
-_UI_EnumerationLiteral_type = Enumeration Literal
-_UI_InstanceSpecification_type = Instance Specification
-_UI_Slot_type = Slot
-_UI_PrimitiveType_type = Primitive Type
-_UI_LiteralSpecification_type = Literal Specification
-_UI_LiteralInteger_type = Literal Integer
-_UI_LiteralString_type = Literal String
-_UI_LiteralBoolean_type = Literal Boolean
-_UI_LiteralNull_type = Literal Null
-_UI_InstanceValue_type = Instance Value
-_UI_LiteralUnlimitedNatural_type = Literal Unlimited Natural
-_UI_OpaqueBehavior_type = Opaque Behavior
-_UI_FunctionBehavior_type = Function Behavior
-_UI_OpaqueAction_type = Opaque Action
-_UI_Action_type = Action
-_UI_ExecutableNode_type = Executable Node
-_UI_ActivityNode_type = Activity Node
-_UI_StructuredActivityNode_type = Structured Activity Node
-_UI_ActivityGroup_type = Activity Group
-_UI_Activity_type = Activity
-_UI_Variable_type = Variable
-_UI_ActivityEdge_type = Activity Edge
-_UI_ActivityPartition_type = Activity Partition
-_UI_InterruptibleActivityRegion_type = Interruptible Activity Region
-_UI_ExceptionHandler_type = Exception Handler
-_UI_ObjectNode_type = Object Node
-_UI_OutputPin_type = Output Pin
-_UI_Pin_type = Pin
-_UI_InputPin_type = Input Pin
-_UI_CallAction_type = Call Action
-_UI_InvocationAction_type = Invocation Action
-_UI_SendSignalAction_type = Send Signal Action
-_UI_CallOperationAction_type = Call Operation Action
-_UI_CallBehaviorAction_type = Call Behavior Action
-_UI_SequenceNode_type = Sequence Node
-_UI_ControlNode_type = Control Node
-_UI_ControlFlow_type = Control Flow
-_UI_InitialNode_type = Initial Node
-_UI_ActivityParameterNode_type = Activity Parameter Node
-_UI_ValuePin_type = Value Pin
-_UI_Message_type = Message
-_UI_MessageEnd_type = Message End
-_UI_Interaction_type = Interaction
-_UI_InteractionFragment_type = Interaction Fragment
-_UI_Lifeline_type = Lifeline
-_UI_PartDecomposition_type = Part Decomposition
-_UI_InteractionUse_type = Interaction Use
-_UI_Gate_type = Gate
-_UI_GeneralOrdering_type = General Ordering
-_UI_OccurrenceSpecification_type = Occurrence Specification
-_UI_InteractionOperand_type = Interaction Operand
-_UI_InteractionConstraint_type = Interaction Constraint
-_UI_ExecutionSpecification_type = Execution Specification
-_UI_StateInvariant_type = State Invariant
-_UI_ActionExecutionSpecification_type = Action Execution Specification
-_UI_BehaviorExecutionSpecification_type = Behavior Execution Specification
-_UI_ExecutionEvent_type = Execution Event
-_UI_CreationEvent_type = Creation Event
-_UI_DestructionEvent_type = Destruction Event
-_UI_SendOperationEvent_type = Send Operation Event
-_UI_MessageEvent_type = Message Event
-_UI_SendSignalEvent_type = Send Signal Event
-_UI_MessageOccurrenceSpecification_type = Message Occurrence Specification
-_UI_ExecutionOccurrenceSpecification_type = Execution Occurrence Specification
-_UI_ReceiveOperationEvent_type = Receive Operation Event
-_UI_ReceiveSignalEvent_type = Receive Signal Event
-_UI_Actor_type = Actor
-_UI_CallEvent_type = Call Event
-_UI_ChangeEvent_type = Change Event
-_UI_SignalEvent_type = Signal Event
-_UI_AnyReceiveEvent_type = Any Receive Event
-_UI_ForkNode_type = Fork Node
-_UI_FlowFinalNode_type = Flow Final Node
-_UI_FinalNode_type = Final Node
-_UI_CentralBufferNode_type = Central Buffer Node
-_UI_MergeNode_type = Merge Node
-_UI_DecisionNode_type = Decision Node
-_UI_ObjectFlow_type = Object Flow
-_UI_ActivityFinalNode_type = Activity Final Node
-_UI_ComponentRealization_type = Component Realization
-_UI_Component_type = Component
-_UI_Node_type = Node
-_UI_CommunicationPath_type = Communication Path
-_UI_Device_type = Device
-_UI_ExecutionEnvironment_type = Execution Environment
-_UI_CombinedFragment_type = Combined Fragment
-_UI_Continuation_type = Continuation
-_UI_ConsiderIgnoreFragment_type = Consider Ignore Fragment
-_UI_CreateObjectAction_type = Create Object Action
-_UI_DestroyObjectAction_type = Destroy Object Action
-_UI_TestIdentityAction_type = Test Identity Action
-_UI_ReadSelfAction_type = Read Self Action
-_UI_StructuralFeatureAction_type = Structural Feature Action
-_UI_ReadStructuralFeatureAction_type = Read Structural Feature Action
-_UI_WriteStructuralFeatureAction_type = Write Structural Feature Action
-_UI_ClearStructuralFeatureAction_type = Clear Structural Feature Action
-_UI_RemoveStructuralFeatureValueAction_type = Remove Structural Feature Value Action
-_UI_AddStructuralFeatureValueAction_type = Add Structural Feature Value Action
-_UI_LinkAction_type = Link Action
-_UI_LinkEndData_type = Link End Data
-_UI_QualifierValue_type = Qualifier Value
-_UI_ReadLinkAction_type = Read Link Action
-_UI_LinkEndCreationData_type = Link End Creation Data
-_UI_CreateLinkAction_type = Create Link Action
-_UI_WriteLinkAction_type = Write Link Action
-_UI_DestroyLinkAction_type = Destroy Link Action
-_UI_LinkEndDestructionData_type = Link End Destruction Data
-_UI_ClearAssociationAction_type = Clear Association Action
-_UI_BroadcastSignalAction_type = Broadcast Signal Action
-_UI_SendObjectAction_type = Send Object Action
-_UI_ValueSpecificationAction_type = Value Specification Action
-_UI_TimeExpression_type = Time Expression
-_UI_Observation_type = Observation
-_UI_Duration_type = Duration
-_UI_DurationInterval_type = Duration Interval
-_UI_Interval_type = Interval
-_UI_TimeConstraint_type = Time Constraint
-_UI_IntervalConstraint_type = Interval Constraint
-_UI_TimeInterval_type = Time Interval
-_UI_DurationConstraint_type = Duration Constraint
-_UI_TimeObservation_type = Time Observation
-_UI_DurationObservation_type = Duration Observation
-_UI_FinalState_type = Final State
-_UI_TimeEvent_type = Time Event
-_UI_VariableAction_type = Variable Action
-_UI_ReadVariableAction_type = Read Variable Action
-_UI_WriteVariableAction_type = Write Variable Action
-_UI_ClearVariableAction_type = Clear Variable Action
-_UI_AddVariableValueAction_type = Add Variable Value Action
-_UI_RemoveVariableValueAction_type = Remove Variable Value Action
-_UI_RaiseExceptionAction_type = Raise Exception Action
-_UI_ActionInputPin_type = Action Input Pin
-_UI_InformationItem_type = Information Item
-_UI_InformationFlow_type = Information Flow
-_UI_ReadExtentAction_type = Read Extent Action
-_UI_ReclassifyObjectAction_type = Reclassify Object Action
-_UI_ReadIsClassifiedObjectAction_type = Read Is Classified Object Action
-_UI_StartClassifierBehaviorAction_type = Start Classifier Behavior Action
-_UI_ReadLinkObjectEndAction_type = Read Link Object End Action
-_UI_ReadLinkObjectEndQualifierAction_type = Read Link Object End Qualifier Action
-_UI_CreateLinkObjectAction_type = Create Link Object Action
-_UI_AcceptEventAction_type = Accept Event Action
-_UI_AcceptCallAction_type = Accept Call Action
-_UI_ReplyAction_type = Reply Action
-_UI_UnmarshallAction_type = Unmarshall Action
-_UI_ReduceAction_type = Reduce Action
-_UI_StartObjectBehaviorAction_type = Start Object Behavior Action
-_UI_JoinNode_type = Join Node
-_UI_DataStoreNode_type = Data Store Node
-_UI_ConditionalNode_type = Conditional Node
-_UI_Clause_type = Clause
-_UI_LoopNode_type = Loop Node
-_UI_ExpansionNode_type = Expansion Node
-_UI_ExpansionRegion_type = Expansion Region
-_UI_ProtocolTransition_type = Protocol Transition
-_UI_AssociationClass_type = Association Class
-_UI_Comment_body_feature = Body
-_UI_Comment_annotatedElement_feature = Annotated Element
-_UI_Element_ownedElement_feature = Owned Element
-_UI_Element_owner_feature = Owner
-_UI_Element_ownedComment_feature = Owned Comment
-_UI_Package_ownedType_feature = Owned Type
-_UI_Package_packageMerge_feature = Package Merge
-_UI_Package_packagedElement_feature = Packaged Element
-_UI_Package_nestedPackage_feature = Nested Package
-_UI_Package_nestingPackage_feature = Nesting Package
-_UI_Package_profileApplication_feature = Profile Application
-_UI_NamedElement_name_feature = Name
-_UI_NamedElement_visibility_feature = Visibility
-_UI_NamedElement_qualifiedName_feature = Qualified Name
-_UI_NamedElement_clientDependency_feature = Client Dependency
-_UI_NamedElement_namespace_feature = Namespace
-_UI_NamedElement_nameExpression_feature = Name Expression
-_UI_Dependency_supplier_feature = Supplier
-_UI_Dependency_client_feature = Client
-_UI_DirectedRelationship_source_feature = Source
-_UI_DirectedRelationship_target_feature = Target
-_UI_Relationship_relatedElement_feature = Related Element
-_UI_Namespace_elementImport_feature = Element Import
-_UI_Namespace_packageImport_feature = Package Import
-_UI_Namespace_ownedRule_feature = Owned Rule
-_UI_Namespace_member_feature = Member
-_UI_Namespace_importedMember_feature = Imported Member
-_UI_Namespace_ownedMember_feature = Owned Member
-_UI_ElementImport_visibility_feature = Visibility
-_UI_ElementImport_alias_feature = Alias
-_UI_ElementImport_importedElement_feature = Imported Element
-_UI_ElementImport_importingNamespace_feature = Importing Namespace
-_UI_PackageImport_visibility_feature = Visibility
-_UI_PackageImport_importedPackage_feature = Imported Package
-_UI_PackageImport_importingNamespace_feature = Importing Namespace
-_UI_Constraint_constrainedElement_feature = Constrained Element
-_UI_Constraint_specification_feature = Specification
-_UI_Constraint_context_feature = Context
-_UI_TypedElement_type_feature = Type
-_UI_Type_package_feature = Package
-_UI_Association_ownedEnd_feature = Owned End
-_UI_Association_memberEnd_feature = Member End
-_UI_Association_isDerived_feature = Is Derived
-_UI_Association_endType_feature = End Type
-_UI_Association_navigableOwnedEnd_feature = Navigable Owned End
-_UI_Classifier_isAbstract_feature = Is Abstract
-_UI_Classifier_generalization_feature = Generalization
-_UI_Classifier_powertypeExtent_feature = Powertype Extent
-_UI_Classifier_feature_feature = Feature
-_UI_Classifier_inheritedMember_feature = Inherited Member
-_UI_Classifier_redefinedClassifier_feature = Redefined Classifier
-_UI_Classifier_general_feature = General
-_UI_Classifier_substitution_feature = Substitution
-_UI_Classifier_attribute_feature = Attribute
-_UI_Classifier_representation_feature = Representation
-_UI_Classifier_collaborationUse_feature = Collaboration Use
-_UI_Classifier_ownedUseCase_feature = Owned Use Case
-_UI_Classifier_useCase_feature = Use Case
-_UI_RedefinableElement_isLeaf_feature = Is Leaf
-_UI_RedefinableElement_redefinedElement_feature = Redefined Element
-_UI_RedefinableElement_redefinitionContext_feature = Redefinition Context
-_UI_TemplateableElement_templateBinding_feature = Template Binding
-_UI_TemplateableElement_ownedTemplateSignature_feature = Owned Template Signature
-_UI_TemplateBinding_signature_feature = Signature
-_UI_TemplateBinding_parameterSubstitution_feature = Parameter Substitution
-_UI_TemplateBinding_boundElement_feature = Bound Element
-_UI_TemplateSignature_parameter_feature = Parameter
-_UI_TemplateSignature_ownedParameter_feature = Owned Parameter
-_UI_TemplateSignature_template_feature = Template
-_UI_TemplateParameter_signature_feature = Signature
-_UI_TemplateParameter_parameteredElement_feature = Parametered Element
-_UI_TemplateParameter_ownedParameteredElement_feature = Owned Parametered Element
-_UI_TemplateParameter_default_feature = Default
-_UI_TemplateParameter_ownedDefault_feature = Owned Default
-_UI_ParameterableElement_owningTemplateParameter_feature = Owning Template Parameter
-_UI_ParameterableElement_templateParameter_feature = Template Parameter
-_UI_TemplateParameterSubstitution_formal_feature = Formal
-_UI_TemplateParameterSubstitution_actual_feature = Actual
-_UI_TemplateParameterSubstitution_ownedActual_feature = Owned Actual
-_UI_TemplateParameterSubstitution_templateBinding_feature = Template Binding
-_UI_Generalization_isSubstitutable_feature = Is Substitutable
-_UI_Generalization_general_feature = General
-_UI_Generalization_generalizationSet_feature = Generalization Set
-_UI_Generalization_specific_feature = Specific
-_UI_GeneralizationSet_isCovering_feature = Is Covering
-_UI_GeneralizationSet_isDisjoint_feature = Is Disjoint
-_UI_GeneralizationSet_powertype_feature = Powertype
-_UI_GeneralizationSet_generalization_feature = Generalization
-_UI_Feature_isStatic_feature = Is Static
-_UI_Feature_featuringClassifier_feature = Featuring Classifier
-_UI_Substitution_contract_feature = Contract
-_UI_Substitution_substitutingClassifier_feature = Substituting Classifier
-_UI_Abstraction_mapping_feature = Mapping
-_UI_OpaqueExpression_body_feature = Body
-_UI_OpaqueExpression_language_feature = Language
-_UI_OpaqueExpression_result_feature = Result
-_UI_OpaqueExpression_behavior_feature = Behavior
-_UI_Parameter_parameterSet_feature = Parameter Set
-_UI_Parameter_operation_feature = Operation
-_UI_Parameter_direction_feature = Direction
-_UI_Parameter_default_feature = Default
-_UI_Parameter_defaultValue_feature = Default Value
-_UI_Parameter_isException_feature = Is Exception
-_UI_Parameter_isStream_feature = Is Stream
-_UI_Parameter_effect_feature = Effect
-_UI_MultiplicityElement_isOrdered_feature = Is Ordered
-_UI_MultiplicityElement_isUnique_feature = Is Unique
-_UI_MultiplicityElement_upper_feature = Upper
-_UI_MultiplicityElement_lower_feature = Lower
-_UI_MultiplicityElement_upperValue_feature = Upper Value
-_UI_MultiplicityElement_lowerValue_feature = Lower Value
-_UI_ConnectableElement_end_feature = End
-_UI_ConnectorEnd_definingEnd_feature = Defining End
-_UI_ConnectorEnd_role_feature = Role
-_UI_ConnectorEnd_partWithPort_feature = Part With Port
-_UI_Property_class_feature = Class
-_UI_Property_datatype_feature = Datatype
-_UI_Property_isDerived_feature = Is Derived
-_UI_Property_isDerivedUnion_feature = Is Derived Union
-_UI_Property_default_feature = Default
-_UI_Property_aggregation_feature = Aggregation
-_UI_Property_isComposite_feature = Is Composite
-_UI_Property_redefinedProperty_feature = Redefined Property
-_UI_Property_owningAssociation_feature = Owning Association
-_UI_Property_defaultValue_feature = Default Value
-_UI_Property_opposite_feature = Opposite
-_UI_Property_subsettedProperty_feature = Subsetted Property
-_UI_Property_association_feature = Association
-_UI_Property_qualifier_feature = Qualifier
-_UI_Property_associationEnd_feature = Association End
-_UI_DeploymentTarget_deployment_feature = Deployment
-_UI_DeploymentTarget_deployedElement_feature = Deployed Element
-_UI_Deployment_deployedArtifact_feature = Deployed Artifact
-_UI_Deployment_configuration_feature = Configuration
-_UI_Deployment_location_feature = Location
-_UI_DeploymentSpecification_deploymentLocation_feature = Deployment Location
-_UI_DeploymentSpecification_executionLocation_feature = Execution Location
-_UI_DeploymentSpecification_deployment_feature = Deployment
-_UI_Artifact_fileName_feature = File Name
-_UI_Artifact_nestedArtifact_feature = Nested Artifact
-_UI_Artifact_manifestation_feature = Manifestation
-_UI_Artifact_ownedOperation_feature = Owned Operation
-_UI_Artifact_ownedAttribute_feature = Owned Attribute
-_UI_Manifestation_utilizedElement_feature = Utilized Element
-_UI_Operation_interface_feature = Interface
-_UI_Operation_class_feature = Class
-_UI_Operation_isQuery_feature = Is Query
-_UI_Operation_isOrdered_feature = Is Ordered
-_UI_Operation_isUnique_feature = Is Unique
-_UI_Operation_lower_feature = Lower
-_UI_Operation_upper_feature = Upper
-_UI_Operation_precondition_feature = Precondition
-_UI_Operation_postcondition_feature = Postcondition
-_UI_Operation_redefinedOperation_feature = Redefined Operation
-_UI_Operation_datatype_feature = Datatype
-_UI_Operation_bodyCondition_feature = Body Condition
-_UI_Operation_type_feature = Type
-_UI_BehavioralFeature_ownedParameter_feature = Owned Parameter
-_UI_BehavioralFeature_isAbstract_feature = Is Abstract
-_UI_BehavioralFeature_method_feature = Method
-_UI_BehavioralFeature_concurrency_feature = Concurrency
-_UI_BehavioralFeature_raisedException_feature = Raised Exception
-_UI_BehavioralFeature_ownedParameterSet_feature = Owned Parameter Set
-_UI_Behavior_isReentrant_feature = Is Reentrant
-_UI_Behavior_redefinedBehavior_feature = Redefined Behavior
-_UI_Behavior_ownedParameter_feature = Owned Parameter
-_UI_Behavior_context_feature = Context
-_UI_Behavior_precondition_feature = Precondition
-_UI_Behavior_postcondition_feature = Postcondition
-_UI_Behavior_ownedParameterSet_feature = Owned Parameter Set
-_UI_Behavior_specification_feature = Specification
-_UI_Class_nestedClassifier_feature = Nested Classifier
-_UI_Class_ownedOperation_feature = Owned Operation
-_UI_Class_superClass_feature = Super Class
-_UI_Class_isActive_feature = Is Active
-_UI_Class_ownedReception_feature = Owned Reception
-_UI_Class_extension_feature = Extension
-_UI_BehavioredClassifier_ownedBehavior_feature = Owned Behavior
-_UI_BehavioredClassifier_classifierBehavior_feature = Classifier Behavior
-_UI_BehavioredClassifier_interfaceRealization_feature = Interface Realization
-_UI_BehavioredClassifier_ownedTrigger_feature = Owned Trigger
-_UI_InterfaceRealization_contract_feature = Contract
-_UI_InterfaceRealization_implementingClassifier_feature = Implementing Classifier
-_UI_Interface_ownedAttribute_feature = Owned Attribute
-_UI_Interface_ownedOperation_feature = Owned Operation
-_UI_Interface_nestedClassifier_feature = Nested Classifier
-_UI_Interface_redefinedInterface_feature = Redefined Interface
-_UI_Interface_ownedReception_feature = Owned Reception
-_UI_Interface_protocol_feature = Protocol
-_UI_Reception_signal_feature = Signal
-_UI_Signal_ownedAttribute_feature = Owned Attribute
-_UI_ProtocolStateMachine_conformance_feature = Conformance
-_UI_StateMachine_region_feature = Region
-_UI_StateMachine_submachineState_feature = Submachine State
-_UI_StateMachine_connectionPoint_feature = Connection Point
-_UI_StateMachine_extendedStateMachine_feature = Extended State Machine
-_UI_Region_subvertex_feature = Subvertex
-_UI_Region_transition_feature = Transition
-_UI_Region_state_feature = State
-_UI_Region_extendedRegion_feature = Extended Region
-_UI_Region_stateMachine_feature = State Machine
-_UI_Vertex_outgoing_feature = Outgoing
-_UI_Vertex_incoming_feature = Incoming
-_UI_Vertex_container_feature = Container
-_UI_Transition_kind_feature = Kind
-_UI_Transition_container_feature = Container
-_UI_Transition_source_feature = Source
-_UI_Transition_target_feature = Target
-_UI_Transition_redefinedTransition_feature = Redefined Transition
-_UI_Transition_guard_feature = Guard
-_UI_Transition_effect_feature = Effect
-_UI_Transition_trigger_feature = Trigger
-_UI_Trigger_event_feature = Event
-_UI_Trigger_port_feature = Port
-_UI_Port_isBehavior_feature = Is Behavior
-_UI_Port_isService_feature = Is Service
-_UI_Port_required_feature = Required
-_UI_Port_redefinedPort_feature = Redefined Port
-_UI_Port_provided_feature = Provided
-_UI_Port_protocol_feature = Protocol
-_UI_State_isComposite_feature = Is Composite
-_UI_State_isOrthogonal_feature = Is Orthogonal
-_UI_State_isSimple_feature = Is Simple
-_UI_State_isSubmachineState_feature = Is Submachine State
-_UI_State_submachine_feature = Submachine
-_UI_State_connection_feature = Connection
-_UI_State_connectionPoint_feature = Connection Point
-_UI_State_redefinedState_feature = Redefined State
-_UI_State_stateInvariant_feature = State Invariant
-_UI_State_entry_feature = Entry
-_UI_State_exit_feature = Exit
-_UI_State_doActivity_feature = Do Activity
-_UI_State_deferrableTrigger_feature = Deferrable Trigger
-_UI_State_region_feature = Region
-_UI_ConnectionPointReference_entry_feature = Entry
-_UI_ConnectionPointReference_exit_feature = Exit
-_UI_ConnectionPointReference_state_feature = State
-_UI_Pseudostate_kind_feature = Kind
-_UI_Pseudostate_stateMachine_feature = State Machine
-_UI_Pseudostate_state_feature = State
-_UI_ProtocolConformance_generalMachine_feature = General Machine
-_UI_ProtocolConformance_specificMachine_feature = Specific Machine
-_UI_EncapsulatedClassifier_ownedPort_feature = Owned Port
-_UI_StructuredClassifier_ownedAttribute_feature = Owned Attribute
-_UI_StructuredClassifier_part_feature = Part
-_UI_StructuredClassifier_role_feature = Role
-_UI_StructuredClassifier_ownedConnector_feature = Owned Connector
-_UI_Connector_type_feature = Type
-_UI_Connector_redefinedConnector_feature = Redefined Connector
-_UI_Connector_end_feature = End
-_UI_Connector_kind_feature = Kind
-_UI_Connector_contract_feature = Contract
-_UI_Extension_isRequired_feature = Is Required
-_UI_Extension_metaclass_feature = Metaclass
-_UI_Stereotype_icon_feature = Icon
-_UI_Image_content_feature = Content
-_UI_Image_location_feature = Location
-_UI_Image_format_feature = Format
-_UI_Profile_ownedStereotype_feature = Owned Stereotype
-_UI_Profile_metaclassReference_feature = Metaclass Reference
-_UI_Profile_metamodelReference_feature = Metamodel Reference
-_UI_Model_viewpoint_feature = Viewpoint
-_UI_ParameterSet_parameter_feature = Parameter
-_UI_ParameterSet_condition_feature = Condition
-_UI_DataType_ownedAttribute_feature = Owned Attribute
-_UI_DataType_ownedOperation_feature = Owned Operation
-_UI_StructuralFeature_isReadOnly_feature = Is Read Only
-_UI_CollaborationUse_type_feature = Type
-_UI_CollaborationUse_roleBinding_feature = Role Binding
-_UI_Collaboration_collaborationRole_feature = Collaboration Role
-_UI_UseCase_include_feature = Include
-_UI_UseCase_extend_feature = Extend
-_UI_UseCase_extensionPoint_feature = Extension Point
-_UI_UseCase_subject_feature = Subject
-_UI_Include_addition_feature = Addition
-_UI_Include_includingCase_feature = Including Case
-_UI_Extend_extendedCase_feature = Extended Case
-_UI_Extend_condition_feature = Condition
-_UI_Extend_extensionLocation_feature = Extension Location
-_UI_Extend_extension_feature = Extension
-_UI_ExtensionPoint_useCase_feature = Use Case
-_UI_RedefinableTemplateSignature_extendedSignature_feature = Extended Signature
-_UI_RedefinableTemplateSignature_inheritedParameter_feature = Inherited Parameter
-_UI_RedefinableTemplateSignature_classifier_feature = Classifier
-_UI_ClassifierTemplateParameter_allowSubstitutable_feature = Allow Substitutable
-_UI_ClassifierTemplateParameter_constrainingClassifier_feature = Constraining Classifier
-_UI_StringExpression_subExpression_feature = Sub Expression
-_UI_StringExpression_owningExpression_feature = Owning Expression
-_UI_Expression_symbol_feature = Symbol
-_UI_Expression_operand_feature = Operand
-_UI_PackageMerge_mergedPackage_feature = Merged Package
-_UI_PackageMerge_receivingPackage_feature = Receiving Package
-_UI_ProfileApplication_appliedProfile_feature = Applied Profile
-_UI_ProfileApplication_isStrict_feature = Is Strict
-_UI_ProfileApplication_applyingPackage_feature = Applying Package
-_UI_Enumeration_ownedLiteral_feature = Owned Literal
-_UI_EnumerationLiteral_enumeration_feature = Enumeration
-_UI_InstanceSpecification_classifier_feature = Classifier
-_UI_InstanceSpecification_slot_feature = Slot
-_UI_InstanceSpecification_specification_feature = Specification
-_UI_Slot_definingFeature_feature = Defining Feature
-_UI_Slot_value_feature = Value
-_UI_Slot_owningInstance_feature = Owning Instance
-_UI_LiteralInteger_value_feature = Value
-_UI_LiteralString_value_feature = Value
-_UI_LiteralBoolean_value_feature = Value
-_UI_InstanceValue_instance_feature = Instance
-_UI_LiteralUnlimitedNatural_value_feature = Value
-_UI_OpaqueBehavior_body_feature = Body
-_UI_OpaqueBehavior_language_feature = Language
-_UI_OpaqueAction_body_feature = Body
-_UI_OpaqueAction_language_feature = Language
-_UI_OpaqueAction_inputValue_feature = Input Value
-_UI_OpaqueAction_outputValue_feature = Output Value
-_UI_Action_output_feature = Output
-_UI_Action_input_feature = Input
-_UI_Action_context_feature = Context
-_UI_Action_localPrecondition_feature = Local Precondition
-_UI_Action_localPostcondition_feature = Local Postcondition
-_UI_ExecutableNode_handler_feature = Handler
-_UI_ActivityNode_inStructuredNode_feature = In Structured Node
-_UI_ActivityNode_activity_feature = Activity
-_UI_ActivityNode_outgoing_feature = Outgoing
-_UI_ActivityNode_incoming_feature = Incoming
-_UI_ActivityNode_inPartition_feature = In Partition
-_UI_ActivityNode_inInterruptibleRegion_feature = In Interruptible Region
-_UI_ActivityNode_inGroup_feature = In Group
-_UI_ActivityNode_redefinedNode_feature = Redefined Node
-_UI_StructuredActivityNode_variable_feature = Variable
-_UI_StructuredActivityNode_edge_feature = Edge
-_UI_StructuredActivityNode_mustIsolate_feature = Must Isolate
-_UI_StructuredActivityNode_node_feature = Node
-_UI_ActivityGroup_subgroup_feature = Subgroup
-_UI_ActivityGroup_superGroup_feature = Super Group
-_UI_ActivityGroup_inActivity_feature = In Activity
-_UI_ActivityGroup_containedEdge_feature = Contained Edge
-_UI_ActivityGroup_containedNode_feature = Contained Node
-_UI_Activity_structuredNode_feature = Structured Node
-_UI_Activity_variable_feature = Variable
-_UI_Activity_node_feature = Node
-_UI_Activity_isReadOnly_feature = Is Read Only
-_UI_Activity_edge_feature = Edge
-_UI_Activity_partition_feature = Partition
-_UI_Activity_isSingleExecution_feature = Is Single Execution
-_UI_Activity_group_feature = Group
-_UI_Variable_scope_feature = Scope
-_UI_Variable_activityScope_feature = Activity Scope
-_UI_ActivityEdge_source_feature = Source
-_UI_ActivityEdge_target_feature = Target
-_UI_ActivityEdge_redefinedEdge_feature = Redefined Edge
-_UI_ActivityEdge_inPartition_feature = In Partition
-_UI_ActivityEdge_guard_feature = Guard
-_UI_ActivityEdge_weight_feature = Weight
-_UI_ActivityEdge_interrupts_feature = Interrupts
-_UI_ActivityEdge_inStructuredNode_feature = In Structured Node
-_UI_ActivityEdge_inGroup_feature = In Group
-_UI_ActivityEdge_activity_feature = Activity
-_UI_ActivityPartition_isDimension_feature = Is Dimension
-_UI_ActivityPartition_isExternal_feature = Is External
-_UI_ActivityPartition_node_feature = Node
-_UI_ActivityPartition_subpartition_feature = Subpartition
-_UI_ActivityPartition_superPartition_feature = Super Partition
-_UI_ActivityPartition_represents_feature = Represents
-_UI_ActivityPartition_edge_feature = Edge
-_UI_InterruptibleActivityRegion_node_feature = Node
-_UI_InterruptibleActivityRegion_interruptingEdge_feature = Interrupting Edge
-_UI_ExceptionHandler_handlerBody_feature = Handler Body
-_UI_ExceptionHandler_exceptionInput_feature = Exception Input
-_UI_ExceptionHandler_exceptionType_feature = Exception Type
-_UI_ExceptionHandler_protectedNode_feature = Protected Node
-_UI_ObjectNode_ordering_feature = Ordering
-_UI_ObjectNode_isControlType_feature = Is Control Type
-_UI_ObjectNode_upperBound_feature = Upper Bound
-_UI_ObjectNode_inState_feature = In State
-_UI_ObjectNode_selection_feature = Selection
-_UI_Pin_isControl_feature = Is Control
-_UI_CallAction_isSynchronous_feature = Is Synchronous
-_UI_CallAction_result_feature = Result
-_UI_InvocationAction_argument_feature = Argument
-_UI_InvocationAction_onPort_feature = On Port
-_UI_SendSignalAction_target_feature = Target
-_UI_SendSignalAction_signal_feature = Signal
-_UI_CallOperationAction_operation_feature = Operation
-_UI_CallOperationAction_target_feature = Target
-_UI_CallBehaviorAction_behavior_feature = Behavior
-_UI_SequenceNode_executableNode_feature = Executable Node
-_UI_ActivityParameterNode_parameter_feature = Parameter
-_UI_ValuePin_value_feature = Value
-_UI_Message_messageKind_feature = Message Kind
-_UI_Message_messageSort_feature = Message Sort
-_UI_Message_receiveEvent_feature = Receive Event
-_UI_Message_sendEvent_feature = Send Event
-_UI_Message_connector_feature = Connector
-_UI_Message_interaction_feature = Interaction
-_UI_Message_argument_feature = Argument
-_UI_Message_signature_feature = Signature
-_UI_MessageEnd_message_feature = Message
-_UI_Interaction_lifeline_feature = Lifeline
-_UI_Interaction_fragment_feature = Fragment
-_UI_Interaction_action_feature = Action
-_UI_Interaction_formalGate_feature = Formal Gate
-_UI_Interaction_message_feature = Message
-_UI_InteractionFragment_covered_feature = Covered
-_UI_InteractionFragment_generalOrdering_feature = General Ordering
-_UI_InteractionFragment_enclosingInteraction_feature = Enclosing Interaction
-_UI_InteractionFragment_enclosingOperand_feature = Enclosing Operand
-_UI_Lifeline_represents_feature = Represents
-_UI_Lifeline_interaction_feature = Interaction
-_UI_Lifeline_selector_feature = Selector
-_UI_Lifeline_decomposedAs_feature = Decomposed As
-_UI_Lifeline_coveredBy_feature = Covered By
-_UI_InteractionUse_refersTo_feature = Refers To
-_UI_InteractionUse_actualGate_feature = Actual Gate
-_UI_InteractionUse_argument_feature = Argument
-_UI_GeneralOrdering_before_feature = Before
-_UI_GeneralOrdering_after_feature = After
-_UI_OccurrenceSpecification_toBefore_feature = To Before
-_UI_OccurrenceSpecification_event_feature = Event
-_UI_OccurrenceSpecification_toAfter_feature = To After
-_UI_InteractionOperand_guard_feature = Guard
-_UI_InteractionOperand_fragment_feature = Fragment
-_UI_InteractionConstraint_minint_feature = Minint
-_UI_InteractionConstraint_maxint_feature = Maxint
-_UI_ExecutionSpecification_start_feature = Start
-_UI_ExecutionSpecification_finish_feature = Finish
-_UI_StateInvariant_invariant_feature = Invariant
-_UI_ActionExecutionSpecification_action_feature = Action
-_UI_BehaviorExecutionSpecification_behavior_feature = Behavior
-_UI_SendOperationEvent_operation_feature = Operation
-_UI_SendSignalEvent_signal_feature = Signal
-_UI_ExecutionOccurrenceSpecification_execution_feature = Execution
-_UI_ReceiveOperationEvent_operation_feature = Operation
-_UI_ReceiveSignalEvent_signal_feature = Signal
-_UI_CallEvent_operation_feature = Operation
-_UI_ChangeEvent_changeExpression_feature = Change Expression
-_UI_SignalEvent_signal_feature = Signal
-_UI_DecisionNode_decisionInput_feature = Decision Input
-_UI_DecisionNode_decisionInputFlow_feature = Decision Input Flow
-_UI_ObjectFlow_isMulticast_feature = Is Multicast
-_UI_ObjectFlow_isMultireceive_feature = Is Multireceive
-_UI_ObjectFlow_transformation_feature = Transformation
-_UI_ObjectFlow_selection_feature = Selection
-_UI_ComponentRealization_abstraction_feature = Abstraction
-_UI_ComponentRealization_realizingClassifier_feature = Realizing Classifier
-_UI_Component_isIndirectlyInstantiated_feature = Is Indirectly Instantiated
-_UI_Component_required_feature = Required
-_UI_Component_provided_feature = Provided
-_UI_Component_packagedElement_feature = Packaged Element
-_UI_Component_realization_feature = Realization
-_UI_Node_nestedNode_feature = Nested Node
-_UI_CombinedFragment_interactionOperator_feature = Interaction Operator
-_UI_CombinedFragment_operand_feature = Operand
-_UI_CombinedFragment_cfragmentGate_feature = Cfragment Gate
-_UI_Continuation_setting_feature = Setting
-_UI_ConsiderIgnoreFragment_message_feature = Message
-_UI_CreateObjectAction_classifier_feature = Classifier
-_UI_CreateObjectAction_result_feature = Result
-_UI_DestroyObjectAction_isDestroyLinks_feature = Is Destroy Links
-_UI_DestroyObjectAction_isDestroyOwnedObjects_feature = Is Destroy Owned Objects
-_UI_DestroyObjectAction_target_feature = Target
-_UI_TestIdentityAction_first_feature = First
-_UI_TestIdentityAction_second_feature = Second
-_UI_TestIdentityAction_result_feature = Result
-_UI_ReadSelfAction_result_feature = Result
-_UI_StructuralFeatureAction_structuralFeature_feature = Structural Feature
-_UI_StructuralFeatureAction_object_feature = Object
-_UI_ReadStructuralFeatureAction_result_feature = Result
-_UI_WriteStructuralFeatureAction_value_feature = Value
-_UI_WriteStructuralFeatureAction_result_feature = Result
-_UI_ClearStructuralFeatureAction_result_feature = Result
-_UI_RemoveStructuralFeatureValueAction_isRemoveDuplicates_feature = Is Remove Duplicates
-_UI_RemoveStructuralFeatureValueAction_removeAt_feature = Remove At
-_UI_AddStructuralFeatureValueAction_isReplaceAll_feature = Is Replace All
-_UI_AddStructuralFeatureValueAction_insertAt_feature = Insert At
-_UI_LinkAction_endData_feature = End Data
-_UI_LinkAction_inputValue_feature = Input Value
-_UI_LinkEndData_value_feature = Value
-_UI_LinkEndData_end_feature = End
-_UI_LinkEndData_qualifier_feature = Qualifier
-_UI_QualifierValue_qualifier_feature = Qualifier
-_UI_QualifierValue_value_feature = Value
-_UI_ReadLinkAction_result_feature = Result
-_UI_LinkEndCreationData_isReplaceAll_feature = Is Replace All
-_UI_LinkEndCreationData_insertAt_feature = Insert At
-_UI_LinkEndDestructionData_isDestroyDuplicates_feature = Is Destroy Duplicates
-_UI_LinkEndDestructionData_destroyAt_feature = Destroy At
-_UI_ClearAssociationAction_object_feature = Object
-_UI_ClearAssociationAction_association_feature = Association
-_UI_BroadcastSignalAction_signal_feature = Signal
-_UI_SendObjectAction_target_feature = Target
-_UI_SendObjectAction_request_feature = Request
-_UI_ValueSpecificationAction_value_feature = Value
-_UI_ValueSpecificationAction_result_feature = Result
-_UI_TimeExpression_expr_feature = Expr
-_UI_TimeExpression_observation_feature = Observation
-_UI_Duration_expr_feature = Expr
-_UI_Duration_observation_feature = Observation
-_UI_Interval_min_feature = Min
-_UI_Interval_max_feature = Max
-_UI_TimeConstraint_firstEvent_feature = First Event
-_UI_DurationConstraint_firstEvent_feature = First Event
-_UI_TimeObservation_event_feature = Event
-_UI_TimeObservation_firstEvent_feature = First Event
-_UI_DurationObservation_event_feature = Event
-_UI_DurationObservation_firstEvent_feature = First Event
-_UI_TimeEvent_isRelative_feature = Is Relative
-_UI_TimeEvent_when_feature = When
-_UI_VariableAction_variable_feature = Variable
-_UI_ReadVariableAction_result_feature = Result
-_UI_WriteVariableAction_value_feature = Value
-_UI_AddVariableValueAction_isReplaceAll_feature = Is Replace All
-_UI_AddVariableValueAction_insertAt_feature = Insert At
-_UI_RemoveVariableValueAction_isRemoveDuplicates_feature = Is Remove Duplicates
-_UI_RemoveVariableValueAction_removeAt_feature = Remove At
-_UI_RaiseExceptionAction_exception_feature = Exception
-_UI_ActionInputPin_fromAction_feature = From Action
-_UI_InformationItem_represented_feature = Represented
-_UI_InformationFlow_realization_feature = Realization
-_UI_InformationFlow_conveyed_feature = Conveyed
-_UI_InformationFlow_informationSource_feature = Information Source
-_UI_InformationFlow_informationTarget_feature = Information Target
-_UI_InformationFlow_realizingActivityEdge_feature = Realizing Activity Edge
-_UI_InformationFlow_realizingConnector_feature = Realizing Connector
-_UI_InformationFlow_realizingMessage_feature = Realizing Message
-_UI_ReadExtentAction_result_feature = Result
-_UI_ReadExtentAction_classifier_feature = Classifier
-_UI_ReclassifyObjectAction_isReplaceAll_feature = Is Replace All
-_UI_ReclassifyObjectAction_oldClassifier_feature = Old Classifier
-_UI_ReclassifyObjectAction_newClassifier_feature = New Classifier
-_UI_ReclassifyObjectAction_object_feature = Object
-_UI_ReadIsClassifiedObjectAction_isDirect_feature = Is Direct
-_UI_ReadIsClassifiedObjectAction_classifier_feature = Classifier
-_UI_ReadIsClassifiedObjectAction_result_feature = Result
-_UI_ReadIsClassifiedObjectAction_object_feature = Object
-_UI_StartClassifierBehaviorAction_object_feature = Object
-_UI_ReadLinkObjectEndAction_object_feature = Object
-_UI_ReadLinkObjectEndAction_end_feature = End
-_UI_ReadLinkObjectEndAction_result_feature = Result
-_UI_ReadLinkObjectEndQualifierAction_object_feature = Object
-_UI_ReadLinkObjectEndQualifierAction_result_feature = Result
-_UI_ReadLinkObjectEndQualifierAction_qualifier_feature = Qualifier
-_UI_CreateLinkObjectAction_result_feature = Result
-_UI_AcceptEventAction_isUnmarshall_feature = Is Unmarshall
-_UI_AcceptEventAction_result_feature = Result
-_UI_AcceptEventAction_trigger_feature = Trigger
-_UI_AcceptCallAction_returnInformation_feature = Return Information
-_UI_ReplyAction_replyToCall_feature = Reply To Call
-_UI_ReplyAction_returnInformation_feature = Return Information
-_UI_ReplyAction_replyValue_feature = Reply Value
-_UI_UnmarshallAction_result_feature = Result
-_UI_UnmarshallAction_unmarshallType_feature = Unmarshall Type
-_UI_UnmarshallAction_object_feature = Object
-_UI_ReduceAction_reducer_feature = Reducer
-_UI_ReduceAction_result_feature = Result
-_UI_ReduceAction_collection_feature = Collection
-_UI_ReduceAction_isOrdered_feature = Is Ordered
-_UI_StartObjectBehaviorAction_object_feature = Object
-_UI_JoinNode_isCombineDuplicate_feature = Is Combine Duplicate
-_UI_JoinNode_joinSpec_feature = Join Spec
-_UI_ConditionalNode_isDeterminate_feature = Is Determinate
-_UI_ConditionalNode_isAssured_feature = Is Assured
-_UI_ConditionalNode_clause_feature = Clause
-_UI_ConditionalNode_result_feature = Result
-_UI_Clause_test_feature = Test
-_UI_Clause_body_feature = Body
-_UI_Clause_predecessorClause_feature = Predecessor Clause
-_UI_Clause_successorClause_feature = Successor Clause
-_UI_Clause_decider_feature = Decider
-_UI_Clause_bodyOutput_feature = Body Output
-_UI_LoopNode_isTestedFirst_feature = Is Tested First
-_UI_LoopNode_bodyPart_feature = Body Part
-_UI_LoopNode_setupPart_feature = Setup Part
-_UI_LoopNode_decider_feature = Decider
-_UI_LoopNode_test_feature = Test
-_UI_LoopNode_result_feature = Result
-_UI_LoopNode_loopVariable_feature = Loop Variable
-_UI_LoopNode_bodyOutput_feature = Body Output
-_UI_LoopNode_loopVariableInput_feature = Loop Variable Input
-_UI_ExpansionNode_regionAsOutput_feature = Region As Output
-_UI_ExpansionNode_regionAsInput_feature = Region As Input
-_UI_ExpansionRegion_mode_feature = Mode
-_UI_ExpansionRegion_inputElement_feature = Input Element
-_UI_ExpansionRegion_outputElement_feature = Output Element
-_UI_ProtocolTransition_postCondition_feature = Post Condition
-_UI_ProtocolTransition_referred_feature = Referred
-_UI_ProtocolTransition_preCondition_feature = Pre Condition
-_UI_VisibilityKind_public_literal = public
-_UI_VisibilityKind_private_literal = private
-_UI_VisibilityKind_protected_literal = protected
-_UI_VisibilityKind_package_literal = package
-_UI_TransitionKind_internal_literal = internal
-_UI_TransitionKind_local_literal = local
-_UI_TransitionKind_external_literal = external
-_UI_PseudostateKind_initial_literal = initial
-_UI_PseudostateKind_deepHistory_literal = deepHistory
-_UI_PseudostateKind_shallowHistory_literal = shallowHistory
-_UI_PseudostateKind_join_literal = join
-_UI_PseudostateKind_fork_literal = fork
-_UI_PseudostateKind_junction_literal = junction
-_UI_PseudostateKind_choice_literal = choice
-_UI_PseudostateKind_entryPoint_literal = entryPoint
-_UI_PseudostateKind_exitPoint_literal = exitPoint
-_UI_PseudostateKind_terminate_literal = terminate
-_UI_ConnectorKind_assembly_literal = assembly
-_UI_ConnectorKind_delegation_literal = delegation
-_UI_CallConcurrencyKind_sequential_literal = sequential
-_UI_CallConcurrencyKind_guarded_literal = guarded
-_UI_CallConcurrencyKind_concurrent_literal = concurrent
-_UI_AggregationKind_none_literal = none
-_UI_AggregationKind_shared_literal = shared
-_UI_AggregationKind_composite_literal = composite
-_UI_ParameterDirectionKind_in_literal = in
-_UI_ParameterDirectionKind_inout_literal = inout
-_UI_ParameterDirectionKind_out_literal = out
-_UI_ParameterDirectionKind_return_literal = return
-_UI_ParameterEffectKind_create_literal = create
-_UI_ParameterEffectKind_read_literal = read
-_UI_ParameterEffectKind_update_literal = update
-_UI_ParameterEffectKind_delete_literal = delete
-_UI_ObjectNodeOrderingKind_unordered_literal = unordered
-_UI_ObjectNodeOrderingKind_ordered_literal = ordered
-_UI_ObjectNodeOrderingKind_LIFO_literal = LIFO
-_UI_ObjectNodeOrderingKind_FIFO_literal = FIFO
-_UI_MessageKind_complete_literal = complete
-_UI_MessageKind_lost_literal = lost
-_UI_MessageKind_found_literal = found
-_UI_MessageKind_unknown_literal = unknown
-_UI_MessageSort_synchCall_literal = synchCall
-_UI_MessageSort_asynchCall_literal = asynchCall
-_UI_MessageSort_asynchSignal_literal = asynchSignal
-_UI_MessageSort_createMessage_literal = createMessage
-_UI_MessageSort_deleteMessage_literal = deleteMessage
-_UI_MessageSort_reply_literal = reply
-_UI_InteractionOperatorKind_seq_literal = seq
-_UI_InteractionOperatorKind_alt_literal = alt
-_UI_InteractionOperatorKind_opt_literal = opt
-_UI_InteractionOperatorKind_break_literal = break
-_UI_InteractionOperatorKind_par_literal = par
-_UI_InteractionOperatorKind_strict_literal = strict
-_UI_InteractionOperatorKind_loop_literal = loop
-_UI_InteractionOperatorKind_critical_literal = critical
-_UI_InteractionOperatorKind_neg_literal = neg
-_UI_InteractionOperatorKind_assert_literal = assert
-_UI_InteractionOperatorKind_ignore_literal = ignore
-_UI_InteractionOperatorKind_consider_literal = consider
-_UI_ExpansionKind_parallel_literal = parallel
-_UI_ExpansionKind_iterative_literal = iterative
-_UI_ExpansionKind_stream_literal = stream
-_UI_UMLEditor_menu = &UML Editor
- _UI_UMLModelWizard_label = UML Model
-_UI_UMLModelWizard_description = Create a new UML model
- _UI_UMLEditor_label = UML Model Editor
- _UI_UMLEditorFilenameDefaultBase = My
-_UI_UMLEditorFilenameExtensions = uml
-
-metatype.name.Model_1000=Undefined
-metatype.name.Component_2002=Component
-
-metatype.name.Interface_2003=Interface
-metatype.name.Component_3001=Component
-metatype.name.Property_3002=Property
-metatype.name.Operation_3003=Operation
-metatype.name.Property_3004=Property
-metatype.name.Operation_3005=Operation
-metatype.name.Realization_4002=Realization
-metatype.name.Component_3006=Component
-metatype.name.InterfaceRealization_4002=InterfaceRealization
-
-metatype.name.Realization_4003=Realization
-
-metatype.name.InterfaceRealization_4004=InterfaceRealization
-
-metatype.name.Class_3004=Class
-metatype.name.Dependency_2014=Dependency
-metatype.name.Interface_2004=Interface
-metatype.name.Comment_2012=Comment
-metatype.name.Property_3006=Property
-metatype.name.Operation_3007=Operation
-metatype.name.Class_3008=Class
-metatype.name.Link_4016=Undefined
-metatype.name.Realization_4005=Realization
-metatype.name.Usage_4007=Usage
-
-metatype.name.Interface_2002=Interface
-metatype.name.Interface_3004=Interface
-metatype.name.Class_3005=Class
-metatype.name.Operation_3008=Operation
-metatype.name.Constraint_2003=Constraint
-metatype.name.Comment_2004=Comment
-metatype.name.Package_2005=Package
-metatype.name.Comment_3005=Comment
-metatype.name.Package_3006=Package
-metatype.name.Generalization_4004=Generalization
-
-metatype.name.Association_2004=Association
-metatype.name.Association_4005=Association
-metatype.name.Package_2003=Package
-metatype.name.Component_3005=Component
-metatype.name.Interface_3006=Interface
-metatype.name.Property_3007=Property
-metatype.name.Class_3009=Class
-metatype.name.Usage_4005=Usage
-metatype.name.Realization_4006=Realization
-metatype.name.Property_3001=Property
-metatype.name.Operation_3002=Operation
-metatype.name.Class_3003=Class
-metatype.name.Component_3004=Component
-metatype.name.Interface_3005=Interface
-metatype.name.Generalization_4003=Generalization
-
-metatype.name.Package_2001=Package
-metatype.name.Interface_3002=Interface
-metatype.name.Property_3003=Property
-metatype.name.Operation_3004=Operation
-metatype.name.Model_2004=Model
-metatype.name.InterfaceRealization_4006=InterfaceRealization
-metatype.name.Port_3069=Port
-metatype.name.Package_0=Package
-metatype.name.Package_2007=Package
-metatype.name.Component_3021=Component
-metatype.name.Package_2004=Package
-metatype.name.Component_3002=Component
-metatype.name.Component_3003=Component
-metatype.name.Component_2102=Component
-metatype.name.Package_3200=Package
-metatype.name.Comment_3201=Comment
-metatype.name.Constraint_3199=Constraint
-metatype.name.Component_3070=Component
-metatype.name.Component_3071=Component
-metatype.name.Interface_3072=Interface
-metatype.name.Comment_3074=Comment
-metatype.name.Constraint_3075=Constraint
-metatype.name.Dependency_4010=Dependency
-metatype.name.ComponentRealization_4007=ComponentRealization
-metatype.name.CommentAnnotatedElement_4008=Undefined
-metatype.name.ConstraintConstrainedElement_4009=Undefined
-
-metatype.name.Substitution_4011=Substitution
-metatype.name.Manifestation_4012=Manifestation
-metatype.name.Abstraction_4013=Abstraction
-
-metatype.name.Abstraction_4011=Abstraction
-
-metatype.name.Association_4011=Association
-
-metatype.name.Abstraction_4012=Abstraction
-metatype.name.Manifestation_4013=Manifestation
-metatype.name.Manifestation_4014=Manifestation
-metatype.name.Manifestation_4011=Manifestation
-
-metatype.name.Substitution_4013=Substitution
-metatype.name.Abstraction_4014=Abstraction
-metatype.name.Substitution_4012=Substitution
-metatype.name.Association_4012=Association
-metatype.name.Association_4015=Association
-metatype.name.Realization_4007=Realization
-metatype.name.Association_3202=Association
-metatype.name.Association_3203=Association
-metatype.name.Association_4016=Association
-metatype.name.Artifact_3203=Artifact
-metatype.name.Comment_3204=Comment
-metatype.name.Constraint_3205=Constraint
-metatype.name.Artifact_3206=Artifact
-metatype.name.Generalization_4015=Generalization
-metatype.name.Manifestation_4016=Manifestation
-metatype.name.Abstraction_4017=Abstraction
-metatype.name.CommentAnnotatedElement_4018=Undefined
-metatype.name.ConstraintConstrainedElement_4019=Undefined
-metatype.name.Dependency_4020=Dependency
-
-metatype.name.Node_3207=Node
-metatype.name.Comment_2001=Comment
-metatype.name.Constraint_2005=Constraint
-metatype.name.ExecutionEnvironment_2002=ExecutionEnvironment
-metatype.name.Device_2003=Device
-metatype.name.DeploymentSpecification_2004=DeploymentSpecification
-metatype.name.Artifact_2006=Artifact
-metatype.name.InstanceSpecification_2007=InstanceSpecification
-metatype.name.Node_2008=Node
-metatype.name.Deployment_4001=Deployment
-metatype.name.Manifestation_4002=Manifestation
-metatype.name.Dependency_4004=Dependency
-metatype.name.Device_16=Device
-metatype.name.ExecutionEnvironment_21=ExecutionEnvironment
-metatype.name.Node_23=Node
-metatype.name.DeploymentSpecification_26=DeploymentSpecification
-metatype.name.Artifact_25=Artifact
-metatype.name.Artifact_28=Artifact
-metatype.name.Link_4005=Undefined
-metatype.name.CommentAnnotatedElement_4006=CommentAnnotatedElement
-metatype.name.ConstraintConstrainedElement_4007=ConstraintConstrainedElement
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/plugin.xml b/incoming/org.eclipse.papyrus.diagram.deployment/plugin.xml
deleted file mode 100644
index 54a4ea3f985..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/plugin.xml
+++ /dev/null
@@ -1,949 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-<extension
- point="org.eclipse.ui.commands">
- <command
- categoryId="org.eclipse.papyrus.editor.category"
- defaultHandler="org.eclipse.papyrus.diagram.deployment.custom.actions.ShowHideRelatedContentsHandler"
- description="Call the Show/Hide Related Contents Command"
- id="org.eclipse.papyrus.diagram.deployment.commands.ShowHideRelatedContentsCommand"
- name="Show/Hide Related Contents Command">
- </command>
-</extension>
-<extension
- point="org.eclipse.ui.services">
- <sourceProvider
- provider="org.eclipse.papyrus.diagram.deployment.custom.providers.ActionStateSourceProvider">
- <variable
- name="showHideRelatedContents"
- priorityLevel="workbench">
- </variable>
- </sourceProvider>
-</extension>
-<extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.papyrus.diagram.deployment.custom.actions.ShowHideRelatedContentsHandler"
- commandId="org.eclipse.papyrus.diagram.deployment.commands.ShowHideRelatedContentsCommand">
- <activeWhen>
- <and>
- <with
- variable="showHideRelatedContents">
- <equals
- value="enabled">
- </equals>
- </with>
- <with
- variable="selection">
- <iterate
- ifEmpty="false"
- operator="and">
- <instanceof
- value="org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPart">
- </instanceof>
- </iterate>
- </with>
- </and>
- </activeWhen>
- </handler>
-</extension>
-<!-- The Command to manages the Provided and Required Interfaces for a Port-->
-<!-- The Handler to manages the Provided and Required Interfaces for a Port-->
-<!-- Add the Menu to manages the Provided and Required Interfaces for a Port-->
-<extension
- point="org.eclipse.ui.commands">
- <command
- defaultHandler="org.eclipse.papyrus.diagram.deployment.CreateDeploymentDiagramCommand"
- description="Create a new Deployment Diagramt Diagram"
- id="org.eclipse.papyrus.diagram.deployment.CreateDeploymentDiagramCommand"
- name="Create a new Deployment Diagram">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.papyrus.diagram.deployment.CreateDeploymentDiagramCommand"
- commandId="org.eclipse.papyrus.diagram.deployment.CreateDeploymentDiagramCommand">
- <activeWhen>
- <or>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.core.papyrusEditor">
- </equals>
- </with>
- </or>
- </activeWhen>
- </handler>
- </extension>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- locationURI="menu:org.eclipse.papyrus.ui.menu">
- <menu
- id="org.eclipse.papyrus.diagram.ui.menu.diagrams"
- label="Diagrams">
- <command
- commandId="org.eclipse.papyrus.diagram.deployment.CreateDeploymentDiagramCommand"
- icon="icons/obj16/DeploymentDiagram.gif"
- label="Create a new Deployment Diagram"
- style="push"
- tooltip="Create a new Deployment Diagram">
- <visibleWhen>
- <reference
- definitionId="org.eclipse.papyrus.diagram.common.IsPapyrusActiveWithUMLModel">
- </reference>
- </visibleWhen>
- </command>
- </menu>
- </menuContribution>
- <menuContribution
- locationURI="toolbar:org.eclipse.ui.main.toolbar">
- <toolbar
- id="org.eclipse.papyrus.diagram.ui.toolbar">
- <command
- commandId="org.eclipse.papyrus.diagram.deployment.CreateDeploymentDiagramCommand"
- icon="icons/obj16/DeploymentDiagram.gif"
- label="Create a new Deployment Diagram"
- style="push"
- tooltip="Create a new Deployment Diagram">
- <visibleWhen>
- <reference
- definitionId="org.eclipse.papyrus.diagram.common.IsPapyrusActiveWithUMLModel">
- </reference>
- </visibleWhen>
- </command>
- </toolbar>
- </menuContribution>
- </extension>
- <extension
- point="org.eclipse.papyrus.core.papyrusDiagram">
- <editorDiagram
- actionBarContributorId="org.eclipse.papyrus.diagram.common.part.UMLDiagramActionBarContributor"
- factoryClass="org.eclipse.papyrus.diagram.deployment.DeploymentDiagramEditorFactory"
- icon="icons/obj16/DeploymentDiagram.gif">
- </editorDiagram>
- <creationCommand
- creationCommandClass="org.eclipse.papyrus.diagram.deployment.CreateDeploymentDiagramCommand"
- icon="icons/obj16/DeploymentDiagram.gif"
- id="org.eclipse.papyrus.diagram.deployment.CreateDeploymentDiagramCommand"
- label="UML Deployment Diagram"
- language="uml">
- </creationCommand>
- </extension>
-
- <extension point="org.eclipse.ui.contexts" id="ui-context">
- <context
- description="%context.description"
- id="org.eclipse.papyrus.diagram.deployment.ui.diagramContext"
- name="%context.name"
- parentId="org.eclipse.gmf.runtime.diagram.ui.diagramContext">
- </context>
- <?gmfgen generated="true"?>
- </extension>
-
- <extension point="org.eclipse.ui.commands" id="update-cmd">
- <?gmfgen generated="true"?>
- <command
- categoryId="org.eclipse.ui.category.edit"
- defaultHandler="org.eclipse.papyrus.diagram.deployment.part.UMLDiagramUpdateCommand"
- description="%update.diagram.description"
- id="org.eclipse.papyrus.diagram.deployment.updateDiagram"
- name="%update.diagram.name"/>
- </extension>
-
- <extension point="org.eclipse.ui.bindings" id="update-cmd-binding">
- <?gmfgen generated="true"?>
- <key
- commandId="org.eclipse.papyrus.diagram.deployment.updateDiagram"
- contextId="org.eclipse.papyrus.diagram.deployment.ui.diagramContext"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="F5"/>
- </extension>
-
- <extension point="org.eclipse.ui.menus" id="context-menus">
- <?gmfgen generated="true"?>
- <!-- menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=">
- </menuContribution>
- <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=">
- </menuContribution -->
- <menuContribution locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu">
- <command commandId="org.eclipse.papyrus.diagram.deployment.LoadResourceAction">
- <visibleWhen>
- <and>
- <with variable="activePartId"><equals value="org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorID"/></with>
- <with variable="selection"><iterate ifEmpty="false">
- <instanceof value="org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart"/>
- </iterate></with>
- </and>
- </visibleWhen>
- </command>
- </menuContribution>
- </extension>
-
- <extension point="org.eclipse.ui.commands" id="menu-commands">
- <?gmfgen generated="true"?>
- <category id="org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorID" name="%cmdcategory.name" description="%cmdcategory.desc"/>
- <command id="org.eclipse.papyrus.diagram.deployment.LoadResourceAction"
- name="Load Resource"
- categoryId="org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorID"
- defaultHandler="org.eclipse.papyrus.diagram.deployment.part.LoadResourceAction"/>
- </extension>
-
-<extension
- id="Papyrus Deployment Diagram (Incubation).palettedefinition"
- name="Papyrus Deployment Diagram (Incubation) Predefined Entries"
- point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
-
- <?gmfgen generated="true"?>
- <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
- <Priority name="Lowest"/>
- <contribution
- factoryClass="org.eclipse.papyrus.diagram.deployment.part.UMLPaletteFactory">
- <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
- <entry
- defineOnly="true"
- description="Create new Node"
- id="deployment.tool.node"
- kind="tool"
- label="Node"
- large_icon="icons/obj16/Node.gif"
- path=""
- small_icon="icons/obj16/Node.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create new Device"
- id="deployment.tool.device"
- kind="tool"
- label="Device"
- large_icon="icons/obj16/Device.gif"
- path=""
- small_icon="icons/obj16/Device.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create new ExecutionEnvironment"
- id="deployment.tool.executionEnvironment"
- kind="tool"
- label="Execution Environment"
- large_icon="icons/obj16/ExecutionEnvironment.gif"
- path=""
- small_icon="icons/obj16/ExecutionEnvironment.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create new Artifact"
- id="deployment.tool.artifact"
- kind="tool"
- label="Artifact"
- large_icon="icons/obj16/Artifact.gif"
- path=""
- small_icon="icons/obj16/Artifact.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create new Comment"
- id="deployment.tool.comment"
- kind="tool"
- label="Comment"
- large_icon="icons/obj16/Comment.gif"
- path=""
- small_icon="icons/obj16/Comment.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create new Constraint"
- id="deployment.tool.constraint"
- kind="tool"
- label="Constraint"
- large_icon="icons/obj16/Constraint.gif"
- path=""
- small_icon="icons/obj16/Constraint.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create new Link (Comment / Constraint)"
- id="deployment.tool.link"
- kind="tool"
- label="Link"
- large_icon="icons/obj16/Link.gif"
- path=""
- small_icon="icons/obj16/Link.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create new Dependency"
- id="deployment.tool.dependency"
- kind="tool"
- label="Dependency"
- large_icon="icons/obj16/Dependency.gif"
- path=""
- small_icon="icons/obj16/Dependency.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create new Generalization"
- id="deployment.tool.generalization"
- kind="tool"
- label="Generalization"
- large_icon="icons/obj16/Generalization.gif"
- path=""
- small_icon="icons/obj16/Generalization.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create new Deployment"
- id="deployment.tool.deployment"
- kind="tool"
- label="Deployment"
- large_icon="icons/obj16/Deployment.gif"
- path=""
- small_icon="icons/obj16/Deployment.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create new Manifestation"
- id="deployment.tool.manifestation"
- kind="tool"
- label="Manifestation"
- large_icon="icons/obj16/Manifestation.gif"
- path=""
- small_icon="icons/obj16/Manifestation.gif">
- </entry>
-
- </contribution>
- </paletteProvider>
-
- </extension>
-
-<extension
- id="Papyrus Deployment Diagram (Incubation).standard"
- name="Papyrus Deployment Diagram (Incubation) Standard Palette"
- point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
-
- <?gmfgen generated="true"?>
- <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
- <Priority name="Low"/>
- <contribution
- factoryClass="org.eclipse.papyrus.diagram.deployment.part.UMLPaletteFactory">
- <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
- <entry
- description="Nodes"
- id="deployment.group.nodes"
- kind="drawer"
- label="Nodes"
- large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- path="/"
- small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
- <expand
- force="true">
- </expand>
- </entry>
-
- <predefinedEntry
- id="deployment.tool.node"
- path="/deployment.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="deployment.tool.device"
- path="/deployment.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="deployment.tool.executionEnvironment"
- path="/deployment.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="deployment.tool.artifact"
- path="/deployment.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="deployment.tool.comment"
- path="/deployment.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="deployment.tool.constraint"
- path="/deployment.group.nodes">
- </predefinedEntry>
-
- <entry
- description="Links"
- id="deployment.group.links"
- kind="drawer"
- label="Links"
- large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- path="/"
- small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
- <expand
- force="true">
- </expand>
- </entry>
-
- <predefinedEntry
- id="deployment.tool.link"
- path="/deployment.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="deployment.tool.dependency"
- path="/deployment.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="deployment.tool.generalization"
- path="/deployment.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="deployment.tool.deployment"
- path="/deployment.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="deployment.tool.manifestation"
- path="/deployment.group.links">
- </predefinedEntry>
-
-
- </contribution>
- <editor id="org.eclipse.papyrus.diagram.deployment"/>
- </paletteProvider>
-
- </extension>
-
-<extension point="org.eclipse.ui.preferencePages">
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLDeploymentDiagram"
- class="org.eclipse.papyrus.diagram.deployment.preferences.ExecutionEnvironmentPreferencePage"
- id="org.eclipse.papyrus.diagram.deployment.preferences.ExecutionEnvironmentPreferencePage"
- name="ExecutionEnvironment Node" />
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLDeploymentDiagram"
- class="org.eclipse.papyrus.diagram.deployment.preferences.ArtifactPreferencePage"
- id="org.eclipse.papyrus.diagram.deployment.preferences.ArtifactPreferencePage"
- name="Artifact Node" />
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLDeploymentDiagram"
- class="org.eclipse.papyrus.diagram.deployment.preferences.DevicePreferencePage"
- id="org.eclipse.papyrus.diagram.deployment.preferences.DevicePreferencePage"
- name="Device Node" />
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLDeploymentDiagram"
- class="org.eclipse.papyrus.diagram.deployment.preferences.NodePreferencePage"
- id="org.eclipse.papyrus.diagram.deployment.preferences.NodePreferencePage"
- name="Node Node" />
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLDeploymentDiagram"
- class="org.eclipse.papyrus.diagram.deployment.preferences.ConstraintPreferencePage"
- id="org.eclipse.papyrus.diagram.deployment.preferences.ConstraintPreferencePage"
- name="Constraint Node" />
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLDeploymentDiagram"
- class="org.eclipse.papyrus.diagram.deployment.preferences.CommentPreferencePage"
- id="org.eclipse.papyrus.diagram.deployment.preferences.CommentPreferencePage"
- name="Comment Node" />
-
-
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLDeploymentDiagram"
- class="org.eclipse.papyrus.diagram.deployment.preferences.ConstraintConstrainedElementPreferencePage"
- id="org.eclipse.papyrus.diagram.deployment.preferences.ConstraintConstrainedElementPreferencePage"
- name="ConstraintConstrainedElement Link" />
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLDeploymentDiagram"
- class="org.eclipse.papyrus.diagram.deployment.preferences.CommentAnnotatedElementPreferencePage"
- id="org.eclipse.papyrus.diagram.deployment.preferences.CommentAnnotatedElementPreferencePage"
- name="CommentAnnotatedElement Link" />
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLDeploymentDiagram"
- class="org.eclipse.papyrus.diagram.deployment.preferences.GeneralizationPreferencePage"
- id="org.eclipse.papyrus.diagram.deployment.preferences.GeneralizationPreferencePage"
- name="Generalization Link" />
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLDeploymentDiagram"
- class="org.eclipse.papyrus.diagram.deployment.preferences.ManifestationPreferencePage"
- id="org.eclipse.papyrus.diagram.deployment.preferences.ManifestationPreferencePage"
- name="Manifestation Link" />
-
-
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLDeploymentDiagram"
- class="org.eclipse.papyrus.diagram.deployment.preferences.DependencyPreferencePage"
- id="org.eclipse.papyrus.diagram.deployment.preferences.DependencyPreferencePage"
- name="Dependency Link" />
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLDeploymentDiagram"
- class="org.eclipse.papyrus.diagram.deployment.preferences.DeploymentPreferencePage"
- id="org.eclipse.papyrus.diagram.deployment.preferences.DeploymentPreferencePage"
- name="Deployment Link" />
-
-
-</extension>
-<extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider">
- <?gmfgen generated="true"?>
- <ParserProvider class="org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider">
- <Priority name="Lowest"/>
- </ParserProvider>
- </extension>
-<extension point="org.eclipse.gmf.runtime.common.ui.services.action.globalActionHandlerProviders" id="global-actions">
- <?gmfgen generated="true"?>
- <GlobalActionHandlerProvider
- class="org.eclipse.papyrus.diagram.common.providers.PapyrusGlobalActionHandlerProvider"
- id="PapyrusUMLDeploymentDiagramPresentation">
- <Priority name="Highest"/>
- <ViewId id="org.eclipse.papyrus.core.papyrusEditor">
- <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- <GlobalActionId actionId="delete"/>
- </ElementType>
- <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart">
- <GlobalActionId actionId="save"/>
- </ElementType>
- </ViewId>
- </GlobalActionHandlerProvider>
- <GlobalActionHandlerProvider
- class="org.eclipse.gmf.runtime.diagram.ui.providers.ide.providers.DiagramIDEGlobalActionHandlerProvider"
- id="PapyrusUMLDeploymentDiagramPresentationIDE">
- <Priority name="Low"/>
- <ViewId id="org.eclipse.papyrus.core.papyrusEditor">
- <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- <GlobalActionId actionId="bookmark"/>
- </ElementType>
- </ViewId>
- </GlobalActionHandlerProvider>
- <GlobalActionHandlerProvider
- class="org.eclipse.papyrus.diagram.common.providers.PapyrusGlobalActionHandlerProvider"
- id="PapyrusUMLDeploymentDiagramRender">
- <Priority name="Highest"/>
- <ViewId id="org.eclipse.papyrus.core.papyrusEditor">
- <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- <GlobalActionId actionId="cut"/>
- <GlobalActionId actionId="copy"/>
- <GlobalActionId actionId="paste"/>
- </ElementType>
- </ViewId>
- </GlobalActionHandlerProvider>
- </extension>
-
-<extension point="org.eclipse.ui.preferencePages" id="prefpages">
- <?gmfgen generated="true"?>
- <page
- id="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLDeploymentDiagram"
- name="PapyrusUMLDeploymentDiagram Diagram"
- category="org.eclipse.papyrus.preferences.diagrams"
- class="org.eclipse.papyrus.diagram.deployment.preferences.DiagramGeneralPreferencePage">
- </page>
-
-
-
- <page
- id="org.eclipse.papyrus.diagram.deployment.preferences.DiagramPrintingPreferencePage"
- name="%prefpage.org.eclipse.uml2.uml.diagram.printing"
- category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLDeploymentDiagram"
- class="org.eclipse.papyrus.diagram.deployment.preferences.DiagramPrintingPreferencePage">
- </page>
-
- <page
- id="org.eclipse.papyrus.diagram.deployment.preferences.DiagramRulersAndGridPreferencePage"
- name="%prefpage.org.eclipse.uml2.uml.diagram.rulersAndGrid"
- category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLDeploymentDiagram"
- class="org.eclipse.papyrus.diagram.deployment.preferences.DiagramRulersAndGridPreferencePage">
- </page>
-
- </extension>
-
-<extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor" id="prop-contrib">
- <?gmfgen generated="true"?>
- <propertyContributor
- contributorId="org.eclipse.papyrus.diagram.deployment"
- labelProvider="org.eclipse.papyrus.diagram.deployment.sheet.UMLSheetLabelProvider">
- <propertyCategory category="domain"/>
- <propertyCategory category="visual"/>
- <propertyCategory category="extra"/>
- </propertyContributor>
- </extension>
-
-<extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs" id="proptabs">
- <?gmfgen generated="true"?>
- <propertyTabs contributorId="org.eclipse.papyrus.diagram.deployment">
- <propertyTab
- category="visual"
- id="property.tab.AppearancePropertySection"
- label="%tab.appearance"/>
- <propertyTab
- category="visual"
- id="property.tab.DiagramPropertySection"
- label="%tab.diagram"/>
- <propertyTab
- category="domain"
- id="property.tab.domain"
- label="%tab.domain"/>
- </propertyTabs>
- </extension>
-
-<extension point="org.eclipse.ui.views.properties.tabbed.propertySections" id="propsections">
- <?gmfgen generated="true"?>
- <propertySections contributorId="org.eclipse.papyrus.diagram.deployment">
- <propertySection id="property.section.ConnectorAppearancePropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ConnectionEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ConnectionAppearancePropertySection"
- tab="property.tab.AppearancePropertySection">
- </propertySection>
- <propertySection id="property.section.ShapeColorAndFontPropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ShapeEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection"
- tab="property.tab.AppearancePropertySection">
- </propertySection>
- <propertySection id="property.section.DiagramColorsAndFontsPropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.DiagramColorsAndFontsPropertySection"
- tab="property.tab.AppearancePropertySection">
- </propertySection>
- <propertySection id="property.section.RulerGridPropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid.RulerGridPropertySection"
- tab="property.tab.DiagramPropertySection">
- </propertySection>
- <propertySection
- id="property.section.domain"
- tab="property.tab.domain"
- class="org.eclipse.papyrus.diagram.deployment.sheet.UMLPropertySection">
- <input type="org.eclipse.gmf.runtime.notation.View"/>
- <input type="org.eclipse.gef.EditPart"/>
- </propertySection>
- </propertySections>
- </extension>
-
-<extension point="org.eclipse.core.runtime.preferences">
- <?gmfgen generated="true"?>
- <initializer class="org.eclipse.papyrus.diagram.deployment.preferences.DiagramPreferenceInitializer"/>
- </extension>
-
-<extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
- <?gmfgen generated="true"?>
- <viewProvider class="org.eclipse.papyrus.diagram.deployment.providers.UMLViewProvider">
- <Priority name="Lowest"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="PapyrusUMLDeploymentDiagram"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="2001,2005,2002,2003,2006,2008,23,16,21,25,28"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4005,4008,4009,4001,4002,4003,4004"/>
- </viewProvider>
- </extension>
-
-<extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
- <?gmfgen generated="true"?>
- <editpartProvider class="org.eclipse.papyrus.diagram.deployment.providers.UMLEditPartProvider">
- <Priority name="Lowest"/>
- <object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram">
- <method name="getType()" value="PapyrusUMLDeploymentDiagram"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
- <method name="getType()" value="2001,2005,2002,2003,2006,2008,23,16,21,25,28"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
- <method name="getType()" value="4005,4008,4009,4001,4002,4003,4004"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
- <method name="getType()" value="1,2,3,5,6,8,9,24,20,22,27,29"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
- <method name="getType()" value="17,18,19,26,30,31,32,33,34"/>
- </object>
- <context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/>
- </editpartProvider>
- </extension>
-
-<extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders" id="modelassist-provider">
- <?gmfgen generated="true"?>
- <modelingAssistantProvider class="org.eclipse.papyrus.diagram.deployment.providers.UMLModelingAssistantProvider">
- <Priority name="Lowest"/>
- <object class="org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart" id="Model_1000"/>
- <object class="org.eclipse.papyrus.diagram.deployment.edit.parts.CommentEditPart" id="Comment_2001"/>
- <object class="org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintEditPart" id="Constraint_2005"/>
- <object class="org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPart" id="ExecutionEnvironment_2002"/>
- <object class="org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPart" id="Device_2003"/>
- <object class="org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPart" id="Artifact_2006"/>
- <object class="org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPart" id="Node_2008"/>
- <context elements="Model_1000,Comment_2001,Constraint_2005,ExecutionEnvironment_2002,Device_2003,Artifact_2006,Node_2008"/>
- </modelingAssistantProvider>
- </extension>
-
-<extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
- <?gmfgen generated="true"?>
- <IconProvider class="org.eclipse.papyrus.diagram.deployment.providers.UMLIconProvider">
- <Priority name="Low"/>
- </IconProvider>
- </extension>
-
-<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
- <?gmfgen generated="true"?>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.deployment.Model_1000"
- name="%metatype.name.Model_1000"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Model"
- edithelper="org.eclipse.papyrus.diagram.deployment.edit.helpers.ModelEditHelper">
- <param name="semanticHint" value="1000"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.deployment.Comment_2001"
- name="%metatype.name.Comment_2001"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Comment"
- edithelper="org.eclipse.papyrus.diagram.deployment.edit.helpers.CommentEditHelper">
- <param name="semanticHint" value="2001"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.deployment.Constraint_2005"
- name="%metatype.name.Constraint_2005"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Constraint"
- edithelper="org.eclipse.papyrus.diagram.deployment.edit.helpers.ConstraintEditHelper">
- <param name="semanticHint" value="2005"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.deployment.ExecutionEnvironment_2002"
- name="%metatype.name.ExecutionEnvironment_2002"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="ExecutionEnvironment"
- edithelper="org.eclipse.papyrus.diagram.deployment.edit.helpers.ExecutionEnvironmentEditHelper">
- <param name="semanticHint" value="2002"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.deployment.Device_2003"
- name="%metatype.name.Device_2003"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Device"
- edithelper="org.eclipse.papyrus.diagram.deployment.edit.helpers.DeviceEditHelper">
- <param name="semanticHint" value="2003"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.deployment.Artifact_2006"
- name="%metatype.name.Artifact_2006"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Artifact"
- edithelper="org.eclipse.papyrus.diagram.deployment.edit.helpers.ArtifactEditHelper">
- <param name="semanticHint" value="2006"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.deployment.Node_2008"
- name="%metatype.name.Node_2008"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Node"
- edithelper="org.eclipse.papyrus.diagram.deployment.edit.helpers.NodeEditHelper">
- <param name="semanticHint" value="2008"/>
- </metamodelType>
- </metamodel>
- <specializationType
- id="org.eclipse.papyrus.diagram.deployment.Node_23"
- name="%metatype.name.Node_23"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="23"/>
- </specializationType>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.diagram.deployment.Device_16"
- name="%metatype.name.Device_16"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.diagram.deployment.Device_2003"/>
- <param name="semanticHint" value="16"/>
- </specializationType>
- </metamodel>
- <specializationType
- id="org.eclipse.papyrus.diagram.deployment.ExecutionEnvironment_21"
- name="%metatype.name.ExecutionEnvironment_21"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.diagram.deployment.ExecutionEnvironment_2002"/>
- <param name="semanticHint" value="21"/>
- </specializationType>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.diagram.deployment.Artifact_25"
- name="%metatype.name.Artifact_25"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.diagram.deployment.Artifact_2006"/>
- <param name="semanticHint" value="25"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.diagram.deployment.Artifact_28"
- name="%metatype.name.Artifact_28"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.diagram.deployment.Artifact_2006"/>
- <param name="semanticHint" value="28"/>
- </specializationType>
- </metamodel>
- <specializationType
- id="org.eclipse.papyrus.diagram.deployment.Link_4005"
- name="%metatype.name.Link_4005"
- kind="org.eclipse.gmf.runtime.diagram.ui.util.INotationType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4005"/>
- </specializationType>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.diagram.deployment.CommentAnnotatedElement_4006"
- name="%metatype.name.CommentAnnotatedElement_4008"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4008"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.diagram.deployment.ConstraintConstrainedElement_4007"
- name="%metatype.name.ConstraintConstrainedElement_4009"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4009"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.deployment.Deployment_4001"
- name="%metatype.name.Deployment_4001"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Deployment"
- edithelper="org.eclipse.papyrus.diagram.deployment.edit.helpers.DeploymentEditHelper">
- <param name="semanticHint" value="4001"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.deployment.Manifestation_4002"
- name="%metatype.name.Manifestation_4002"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Manifestation"
- edithelper="org.eclipse.papyrus.diagram.deployment.edit.helpers.ManifestationEditHelper">
- <param name="semanticHint" value="4002"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.deployment.Generalization_4003"
- name="%metatype.name.Generalization_4003"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Generalization"
- edithelper="org.eclipse.papyrus.diagram.deployment.edit.helpers.GeneralizationEditHelper">
- <param name="semanticHint" value="4003"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.diagram.deployment.Dependency_4004"
- name="%metatype.name.Dependency_4004"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Dependency"
- edithelper="org.eclipse.papyrus.diagram.deployment.edit.helpers.DependencyEditHelper">
- <param name="semanticHint" value="4004"/>
- </metamodelType>
- </metamodel>
- </extension>
-
-<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
- <?gmfgen generated="true"?>
- <clientContext id="org.eclipse.papyrus.diagram.deployment.TypeContext">
- <enablement>
- <test
- property="org.eclipse.gmf.runtime.emf.core.editingDomain"
- value="org.eclipse.papyrus.diagram.deployment.EditingDomain"/>
- </enablement>
- </clientContext>
- <binding context="org.eclipse.papyrus.diagram.deployment.TypeContext">
- <elementType ref="org.eclipse.papyrus.diagram.deployment.Model_1000"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.Comment_2001"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.Constraint_2005"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.ExecutionEnvironment_2002"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.Device_2003"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.Artifact_2006"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.Node_2008"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.Node_23"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.Device_16"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.ExecutionEnvironment_21"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.Artifact_25"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.Artifact_28"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.Link_4005"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.CommentAnnotatedElement_4006"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.ConstraintConstrainedElement_4007"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.Deployment_4001"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.Manifestation_4002"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.Generalization_4003"/>
- <elementType ref="org.eclipse.papyrus.diagram.deployment.Dependency_4004"/>
- <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
- </binding>
- </extension>
-<extension
- point="org.eclipse.gmf.runtime.diagram.ui.editpolicyProviders">
- <editpolicyProvider
- class="org.eclipse.papyrus.diagram.deployment.custom.providers.CustomEditPolicyProvider">
- <Priority
- name="Lowest">
- </Priority>
- </editpolicyProvider>
-</extension>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <!-- optionally, specify keybindings -->
-</plugin>
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ArtifactCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ArtifactCreateCommand.java
deleted file mode 100644
index c530dccf379..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ArtifactCreateCommand.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Artifact;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ArtifactCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public ArtifactCreateCommand(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static ArtifactCreateCommand create(CreateElementRequest req, EObject eObject) {
- return new ArtifactCreateCommand(req, eObject);
- }
-
- /**
- * @generated
- */
- public ArtifactCreateCommand(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
- // Creation constraint for TopLevelNodes
- if(!(getElementToEdit() instanceof Package)) {
- return false;
- }
-
- return true;
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Artifact newElement = UMLFactory.eINSTANCE.createArtifact();
-
- Package owner = (Package)getElementToEdit();
- owner.getPackagedElements().add(newElement);
-
-
- ElementInitializers.getInstance().init_Artifact_2006(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Artifact newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ArtifactCreateCommandACN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ArtifactCreateCommandACN.java
deleted file mode 100644
index ac8cef3aa4f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ArtifactCreateCommandACN.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Artifact;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ArtifactCreateCommandACN extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public ArtifactCreateCommandACN(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static ArtifactCreateCommandACN create(CreateElementRequest req, EObject eObject) {
- return new ArtifactCreateCommandACN(req, eObject);
- }
-
- /**
- * @generated
- */
- public ArtifactCreateCommandACN(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
-
- return true;
-
-
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Artifact newElement = UMLFactory.eINSTANCE.createArtifact();
-
- Artifact owner = (Artifact)getElementToEdit();
- owner.getNestedArtifacts().add(newElement);
-
-
- ElementInitializers.getInstance().init_Artifact_28(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Artifact newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ArtifactCreateCommandCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ArtifactCreateCommandCN.java
deleted file mode 100644
index cf42a532214..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ArtifactCreateCommandCN.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Artifact;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ArtifactCreateCommandCN extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public ArtifactCreateCommandCN(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static ArtifactCreateCommandCN create(CreateElementRequest req, EObject eObject) {
- return new ArtifactCreateCommandCN(req, eObject);
- }
-
- /**
- * @generated
- */
- public ArtifactCreateCommandCN(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
-
- return true;
-
-
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Artifact newElement = UMLFactory.eINSTANCE.createArtifact();
-
- Class owner = (Class)getElementToEdit();
- owner.getNestedClassifiers().add(newElement);
-
-
- ElementInitializers.getInstance().init_Artifact_25(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Artifact newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/CommentAnnotatedElementCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/CommentAnnotatedElementCreateCommand.java
deleted file mode 100644
index 17c75e0a9fb..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/CommentAnnotatedElementCreateCommand.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * @generated
- */
-public class CommentAnnotatedElementCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
- /**
- * @generated
- */
- public CommentAnnotatedElementCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof Comment) {
- return false;
- }
- if(target != null && false == target instanceof Element) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateCommentAnnotatedElement_4008(getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- if(getSource() != null && getTarget() != null) {
- getSource().getAnnotatedElements().add(getTarget());
- }
- return CommandResult.newOKCommandResult();
-
- }
-
-
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected Comment getSource() {
- return (Comment)source;
- }
-
- /**
- * @generated
- */
- protected Element getTarget() {
- return (Element)target;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/CommentAnnotatedElementReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/CommentAnnotatedElementReorientCommand.java
deleted file mode 100644
index 0b56c9dee16..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/CommentAnnotatedElementReorientCommand.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * @generated
- */
-public class CommentAnnotatedElementReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject referenceOwner;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public CommentAnnotatedElementReorientCommand(ReorientReferenceRelationshipRequest request) {
- super(request.getLabel(), null, request);
- reorientDirection = request.getDirection();
- referenceOwner = request.getReferenceOwner();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == referenceOwner instanceof Comment) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof Element && newEnd instanceof Comment)) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistCommentAnnotatedElement_4008(getNewSource(), getOldTarget());
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistCommentAnnotatedElement_4008(getOldSource(), getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getOldSource().getAnnotatedElements().remove(getOldTarget());
- getNewSource().getAnnotatedElements().add(getOldTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getOldSource().getAnnotatedElements().remove(getOldTarget());
- getOldSource().getAnnotatedElements().add(getNewTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected Comment getOldSource() {
- return (Comment)referenceOwner;
- }
-
- /**
- * @generated
- */
- protected Comment getNewSource() {
- return (Comment)newEnd;
- }
-
- /**
- * @generated
- */
- protected Element getOldTarget() {
- return (Element)oldEnd;
- }
-
- /**
- * @generated
- */
- protected Element getNewTarget() {
- return (Element)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/CommentCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/CommentCreateCommand.java
deleted file mode 100644
index 212bbe012bb..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/CommentCreateCommand.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class CommentCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public CommentCreateCommand(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static CommentCreateCommand create(CreateElementRequest req, EObject eObject) {
- return new CommentCreateCommand(req, eObject);
- }
-
- /**
- * @generated
- */
- public CommentCreateCommand(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
- // Creation constraint for TopLevelNodes
- if(!(getElementToEdit() instanceof Package)) {
- return false;
- }
-
- return true;
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Comment newElement = UMLFactory.eINSTANCE.createComment();
-
- Element owner = (Element)getElementToEdit();
- owner.getOwnedComments().add(newElement);
-
-
- ElementInitializers.getInstance().init_Comment_2001(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Comment newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ConstraintConstrainedElementCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ConstraintConstrainedElementCreateCommand.java
deleted file mode 100644
index cf870b746de..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ConstraintConstrainedElementCreateCommand.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * @generated
- */
-public class ConstraintConstrainedElementCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
- /**
- * @generated
- */
- public ConstraintConstrainedElementCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof Constraint) {
- return false;
- }
- if(target != null && false == target instanceof Element) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateConstraintConstrainedElement_4009(getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- if(getSource() != null && getTarget() != null) {
- getSource().getConstrainedElements().add(getTarget());
- }
- return CommandResult.newOKCommandResult();
-
- }
-
-
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected Constraint getSource() {
- return (Constraint)source;
- }
-
- /**
- * @generated
- */
- protected Element getTarget() {
- return (Element)target;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ConstraintConstrainedElementReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ConstraintConstrainedElementReorientCommand.java
deleted file mode 100644
index c7ce6e9f1df..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ConstraintConstrainedElementReorientCommand.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * @generated
- */
-public class ConstraintConstrainedElementReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject referenceOwner;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public ConstraintConstrainedElementReorientCommand(ReorientReferenceRelationshipRequest request) {
- super(request.getLabel(), null, request);
- reorientDirection = request.getDirection();
- referenceOwner = request.getReferenceOwner();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == referenceOwner instanceof Constraint) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof Element && newEnd instanceof Constraint)) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistConstraintConstrainedElement_4009(getNewSource(), getOldTarget());
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistConstraintConstrainedElement_4009(getOldSource(), getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getOldSource().getConstrainedElements().remove(getOldTarget());
- getNewSource().getConstrainedElements().add(getOldTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getOldSource().getConstrainedElements().remove(getOldTarget());
- getOldSource().getConstrainedElements().add(getNewTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected Constraint getOldSource() {
- return (Constraint)referenceOwner;
- }
-
- /**
- * @generated
- */
- protected Constraint getNewSource() {
- return (Constraint)newEnd;
- }
-
- /**
- * @generated
- */
- protected Element getOldTarget() {
- return (Element)oldEnd;
- }
-
- /**
- * @generated
- */
- protected Element getNewTarget() {
- return (Element)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ConstraintCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ConstraintCreateCommand.java
deleted file mode 100644
index 2825d4d311c..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ConstraintCreateCommand.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Namespace;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ConstraintCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public ConstraintCreateCommand(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static ConstraintCreateCommand create(CreateElementRequest req, EObject eObject) {
- return new ConstraintCreateCommand(req, eObject);
- }
-
- /**
- * @generated
- */
- public ConstraintCreateCommand(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
- // Creation constraint for TopLevelNodes
- if(!(getElementToEdit() instanceof Package)) {
- return false;
- }
-
- return true;
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Constraint newElement = UMLFactory.eINSTANCE.createConstraint();
-
- Namespace owner = (Namespace)getElementToEdit();
- owner.getOwnedRules().add(newElement);
-
-
- ElementInitializers.getInstance().init_Constraint_2005(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Constraint newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DependencyCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DependencyCreateCommand.java
deleted file mode 100644
index e8ef60f075c..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DependencyCreateCommand.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class DependencyCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
-
- /**
- * @generated
- */
- protected Package container;
-
- /**
- * @generated
- */
- public DependencyCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- container = deduceContainer(source, target);
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof NamedElement) {
- return false;
- }
- if(target != null && false == target instanceof NamedElement) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- if(getContainer() == null) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateDependency_4004(getContainer(), getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- Dependency newElement = UMLFactory.eINSTANCE.createDependency();
- getContainer().getPackagedElements().add(newElement);
- newElement.getClients().add(getSource());
- newElement.getSuppliers().add(getTarget());
- ElementInitializers.getInstance().init_Dependency_4004(newElement);
- doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
-
- }
-
-
- /**
- * @generated
- */
- protected void doConfigure(Dependency newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
- configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected NamedElement getSource() {
- return (NamedElement)source;
- }
-
- /**
- * @generated
- */
- protected NamedElement getTarget() {
- return (NamedElement)target;
- }
-
- /**
- * @generated
- */
- public Package getContainer() {
- return container;
- }
-
- /**
- * Default approach is to traverse ancestors of the source to find instance of container.
- * Modify with appropriate logic.
- * @generated
- */
- protected Package deduceContainer(EObject source, EObject target) {
- // Find container element for the new link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Package) {
- return (Package)element;
- }
- }
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DependencyReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DependencyReorientCommand.java
deleted file mode 100644
index 5ad218c1486..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DependencyReorientCommand.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-
-/**
- * @generated
- */
-public class DependencyReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public DependencyReorientCommand(ReorientRelationshipRequest request) {
- super(request.getLabel(), request.getRelationship(), request);
- reorientDirection = request.getDirection();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == getElementToEdit() instanceof Dependency) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getSuppliers().size() != 1) {
- return false;
- }
- NamedElement target = (NamedElement)getLink().getSuppliers().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistDependency_4004(container, getLink(), getNewSource(), target);
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getClients().size() != 1) {
- return false;
- }
- NamedElement source = (NamedElement)getLink().getClients().get(0);
- if(!(getLink().eContainer() instanceof Package)) {
- return false;
- }
- Package container = (Package)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistDependency_4004(container, getLink(), source, getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getLink().getClients().remove(getOldSource());
- getLink().getClients().add(getNewSource());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getLink().getSuppliers().remove(getOldTarget());
- getLink().getSuppliers().add(getNewTarget());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected Dependency getLink() {
- return (Dependency)getElementToEdit();
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldSource() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewSource() {
- return (NamedElement)newEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldTarget() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewTarget() {
- return (NamedElement)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeploymentCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeploymentCreateCommand.java
deleted file mode 100644
index e985d6f4d95..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeploymentCreateCommand.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Deployment;
-import org.eclipse.uml2.uml.DeploymentTarget;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class DeploymentCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
-
- /**
- * @generated
- */
- protected DeploymentTarget container;
-
- /**
- * @generated
- */
- public DeploymentCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- container = deduceContainer(source, target);
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof NamedElement) {
- return false;
- }
- if(target != null && false == target instanceof NamedElement) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- if(getContainer() == null) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateDeployment_4001(getContainer(), getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- Deployment newElement = UMLFactory.eINSTANCE.createDeployment();
- getContainer().getDeployments().add(newElement);
- newElement.getClients().add(getSource());
- newElement.getSuppliers().add(getTarget());
- ElementInitializers.getInstance().init_Deployment_4001(newElement);
- doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
-
- }
-
-
- /**
- * @generated
- */
- protected void doConfigure(Deployment newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
- configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected NamedElement getSource() {
- return (NamedElement)source;
- }
-
- /**
- * @generated
- */
- protected NamedElement getTarget() {
- return (NamedElement)target;
- }
-
- /**
- * @generated
- */
- public DeploymentTarget getContainer() {
- return container;
- }
-
- /**
- * Default approach is to traverse ancestors of the source to find instance of container.
- * Modify with appropriate logic.
- * @generated
- */
- protected DeploymentTarget deduceContainer(EObject source, EObject target) {
- // Find container element for the new link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof DeploymentTarget) {
- return (DeploymentTarget)element;
- }
- }
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeploymentReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeploymentReorientCommand.java
deleted file mode 100644
index 20e69aafaa9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeploymentReorientCommand.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Deployment;
-import org.eclipse.uml2.uml.DeploymentTarget;
-import org.eclipse.uml2.uml.NamedElement;
-
-/**
- * @generated
- */
-public class DeploymentReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public DeploymentReorientCommand(ReorientRelationshipRequest request) {
- super(request.getLabel(), request.getRelationship(), request);
- reorientDirection = request.getDirection();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == getElementToEdit() instanceof Deployment) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getSuppliers().size() != 1) {
- return false;
- }
- NamedElement target = (NamedElement)getLink().getSuppliers().get(0);
- if(!(getLink().eContainer() instanceof DeploymentTarget)) {
- return false;
- }
- DeploymentTarget container = (DeploymentTarget)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistDeployment_4001(container, getLink(), getNewSource(), target);
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getClients().size() != 1) {
- return false;
- }
- NamedElement source = (NamedElement)getLink().getClients().get(0);
- if(!(getLink().eContainer() instanceof DeploymentTarget)) {
- return false;
- }
- DeploymentTarget container = (DeploymentTarget)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistDeployment_4001(container, getLink(), source, getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getLink().getClients().remove(getOldSource());
- getLink().getClients().add(getNewSource());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getLink().getSuppliers().remove(getOldTarget());
- getLink().getSuppliers().add(getNewTarget());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected Deployment getLink() {
- return (Deployment)getElementToEdit();
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldSource() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewSource() {
- return (NamedElement)newEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldTarget() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewTarget() {
- return (NamedElement)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeviceCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeviceCreateCommand.java
deleted file mode 100644
index 15f23dfdd60..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeviceCreateCommand.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Device;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class DeviceCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public DeviceCreateCommand(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static DeviceCreateCommand create(CreateElementRequest req, EObject eObject) {
- return new DeviceCreateCommand(req, eObject);
- }
-
- /**
- * @generated
- */
- public DeviceCreateCommand(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
- // Creation constraint for TopLevelNodes
- if(!(getElementToEdit() instanceof Package)) {
- return false;
- }
-
- return true;
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Device newElement = UMLFactory.eINSTANCE.createDevice();
-
- Package owner = (Package)getElementToEdit();
- owner.getPackagedElements().add(newElement);
-
-
- ElementInitializers.getInstance().init_Device_2003(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Device newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeviceCreateCommandCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeviceCreateCommandCN.java
deleted file mode 100644
index 1aa033762a4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/DeviceCreateCommandCN.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Device;
-import org.eclipse.uml2.uml.Node;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class DeviceCreateCommandCN extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public DeviceCreateCommandCN(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static DeviceCreateCommandCN create(CreateElementRequest req, EObject eObject) {
- return new DeviceCreateCommandCN(req, eObject);
- }
-
- /**
- * @generated
- */
- public DeviceCreateCommandCN(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
-
- return true;
-
-
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Device newElement = UMLFactory.eINSTANCE.createDevice();
-
- Node owner = (Node)getElementToEdit();
- owner.getNestedNodes().add(newElement);
-
-
- ElementInitializers.getInstance().init_Device_16(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Device newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ExecutionEnvironmentCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ExecutionEnvironmentCreateCommand.java
deleted file mode 100644
index 7042cae391a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ExecutionEnvironmentCreateCommand.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.providers.ElementInitializers;
-import org.eclipse.uml2.uml.ExecutionEnvironment;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public ExecutionEnvironmentCreateCommand(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static ExecutionEnvironmentCreateCommand create(CreateElementRequest req, EObject eObject) {
- return new ExecutionEnvironmentCreateCommand(req, eObject);
- }
-
- /**
- * @generated
- */
- public ExecutionEnvironmentCreateCommand(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
- // Creation constraint for TopLevelNodes
- if(!(getElementToEdit() instanceof Package)) {
- return false;
- }
-
- return true;
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- ExecutionEnvironment newElement = UMLFactory.eINSTANCE.createExecutionEnvironment();
-
- Package owner = (Package)getElementToEdit();
- owner.getPackagedElements().add(newElement);
-
-
- ElementInitializers.getInstance().init_ExecutionEnvironment_2002(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(ExecutionEnvironment newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ExecutionEnvironmentCreateCommandCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ExecutionEnvironmentCreateCommandCN.java
deleted file mode 100644
index d6a15cd8517..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ExecutionEnvironmentCreateCommandCN.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.providers.ElementInitializers;
-import org.eclipse.uml2.uml.ExecutionEnvironment;
-import org.eclipse.uml2.uml.Node;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentCreateCommandCN extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public ExecutionEnvironmentCreateCommandCN(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static ExecutionEnvironmentCreateCommandCN create(CreateElementRequest req, EObject eObject) {
- return new ExecutionEnvironmentCreateCommandCN(req, eObject);
- }
-
- /**
- * @generated
- */
- public ExecutionEnvironmentCreateCommandCN(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
-
- return true;
-
-
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- ExecutionEnvironment newElement = UMLFactory.eINSTANCE.createExecutionEnvironment();
-
- Node owner = (Node)getElementToEdit();
- owner.getNestedNodes().add(newElement);
-
-
- ElementInitializers.getInstance().init_ExecutionEnvironment_21(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(ExecutionEnvironment newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/GeneralizationCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/GeneralizationCreateCommand.java
deleted file mode 100644
index 7dfe815ae13..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/GeneralizationCreateCommand.java
+++ /dev/null
@@ -1,154 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Generalization;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class GeneralizationCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
-
- /**
- * @generated
- */
- protected Classifier container;
-
- /**
- * @generated
- */
- public GeneralizationCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- container = deduceContainer(source, target);
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof Classifier) {
- return false;
- }
- if(target != null && false == target instanceof Classifier) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- if(getContainer() == null) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateGeneralization_4003(getContainer(), getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- Generalization newElement = UMLFactory.eINSTANCE.createGeneralization();
- getContainer().getGeneralizations().add(newElement);
- newElement.setSpecific(getSource());
- newElement.setGeneral(getTarget());
- doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
-
- }
-
-
- /**
- * @generated
- */
- protected void doConfigure(Generalization newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
- configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected Classifier getSource() {
- return (Classifier)source;
- }
-
- /**
- * @generated
- */
- protected Classifier getTarget() {
- return (Classifier)target;
- }
-
- /**
- * @generated
- */
- public Classifier getContainer() {
- return container;
- }
-
- /**
- * Default approach is to traverse ancestors of the source to find instance of container.
- * Modify with appropriate logic.
- * @generated
- */
- protected Classifier deduceContainer(EObject source, EObject target) {
- // Find container element for the new link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Classifier) {
- return (Classifier)element;
- }
- }
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/GeneralizationReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/GeneralizationReorientCommand.java
deleted file mode 100644
index 947c0e7638a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/GeneralizationReorientCommand.java
+++ /dev/null
@@ -1,156 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Generalization;
-
-/**
- * @generated
- */
-public class GeneralizationReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public GeneralizationReorientCommand(ReorientRelationshipRequest request) {
- super(request.getLabel(), request.getRelationship(), request);
- reorientDirection = request.getDirection();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == getElementToEdit() instanceof Generalization) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof Classifier && newEnd instanceof Classifier)) {
- return false;
- }
- Classifier target = getLink().getGeneral();
- if(!(getLink().eContainer() instanceof Classifier)) {
- return false;
- }
- Classifier container = (Classifier)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistGeneralization_4003(container, getLink(), getNewSource(), target);
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Classifier && newEnd instanceof Classifier)) {
- return false;
- }
- Classifier source = getLink().getSpecific();
- if(!(getLink().eContainer() instanceof Classifier)) {
- return false;
- }
- Classifier container = (Classifier)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistGeneralization_4003(container, getLink(), source, getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getLink().setSpecific(getNewSource());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getLink().setGeneral(getNewTarget());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected Generalization getLink() {
- return (Generalization)getElementToEdit();
- }
-
- /**
- * @generated
- */
- protected Classifier getOldSource() {
- return (Classifier)oldEnd;
- }
-
- /**
- * @generated
- */
- protected Classifier getNewSource() {
- return (Classifier)newEnd;
- }
-
- /**
- * @generated
- */
- protected Classifier getOldTarget() {
- return (Classifier)oldEnd;
- }
-
- /**
- * @generated
- */
- protected Classifier getNewTarget() {
- return (Classifier)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ManifestationCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ManifestationCreateCommand.java
deleted file mode 100644
index 77024da4ff4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ManifestationCreateCommand.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Artifact;
-import org.eclipse.uml2.uml.Manifestation;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ManifestationCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
-
- /**
- * @generated
- */
- protected Artifact container;
-
- /**
- * @generated
- */
- public ManifestationCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- container = deduceContainer(source, target);
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(source == null && target == null) {
- return false;
- }
- if(source != null && false == source instanceof NamedElement) {
- return false;
- }
- if(target != null && false == target instanceof NamedElement) {
- return false;
- }
- if(getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- if(getContainer() == null) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateManifestation_4002(getContainer(), getSource(), getTarget());
- }
-
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- Manifestation newElement = UMLFactory.eINSTANCE.createManifestation();
- getContainer().getManifestations().add(newElement);
- newElement.getClients().add(getSource());
- newElement.getSuppliers().add(getTarget());
- ElementInitializers.getInstance().init_Manifestation_4002(newElement);
- doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
-
- }
-
-
- /**
- * @generated
- */
- protected void doConfigure(Manifestation newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
- configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected NamedElement getSource() {
- return (NamedElement)source;
- }
-
- /**
- * @generated
- */
- protected NamedElement getTarget() {
- return (NamedElement)target;
- }
-
- /**
- * @generated
- */
- public Artifact getContainer() {
- return container;
- }
-
- /**
- * Default approach is to traverse ancestors of the source to find instance of container.
- * Modify with appropriate logic.
- * @generated
- */
- protected Artifact deduceContainer(EObject source, EObject target) {
- // Find container element for the new link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Artifact) {
- return (Artifact)element;
- }
- }
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ManifestationReorientCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ManifestationReorientCommand.java
deleted file mode 100644
index 108511d85af..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/ManifestationReorientCommand.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Artifact;
-import org.eclipse.uml2.uml.Manifestation;
-import org.eclipse.uml2.uml.NamedElement;
-
-/**
- * @generated
- */
-public class ManifestationReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public ManifestationReorientCommand(ReorientRelationshipRequest request) {
- super(request.getLabel(), request.getRelationship(), request);
- reorientDirection = request.getDirection();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
- if(false == getElementToEdit() instanceof Manifestation) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getSuppliers().size() != 1) {
- return false;
- }
- NamedElement target = (NamedElement)getLink().getSuppliers().get(0);
- if(!(getLink().eContainer() instanceof Artifact)) {
- return false;
- }
- Artifact container = (Artifact)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistManifestation_4002(container, getLink(), getNewSource(), target);
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
- return false;
- }
- if(getLink().getClients().size() != 1) {
- return false;
- }
- NamedElement source = (NamedElement)getLink().getClients().get(0);
- if(!(getLink().eContainer() instanceof Artifact)) {
- return false;
- }
- Artifact container = (Artifact)getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistManifestation_4002(container, getLink(), source, getNewTarget());
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getLink().getClients().remove(getOldSource());
- getLink().getClients().add(getNewSource());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getLink().getSuppliers().remove(getOldTarget());
- getLink().getSuppliers().add(getNewTarget());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated
- */
- protected Manifestation getLink() {
- return (Manifestation)getElementToEdit();
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldSource() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewSource() {
- return (NamedElement)newEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getOldTarget() {
- return (NamedElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected NamedElement getNewTarget() {
- return (NamedElement)newEnd;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/NodeCreateCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/NodeCreateCommand.java
deleted file mode 100644
index 7cc694309c0..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/NodeCreateCommand.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Node;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class NodeCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public NodeCreateCommand(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static NodeCreateCommand create(CreateElementRequest req, EObject eObject) {
- return new NodeCreateCommand(req, eObject);
- }
-
- /**
- * @generated
- */
- public NodeCreateCommand(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
- // Creation constraint for TopLevelNodes
- if(!(getElementToEdit() instanceof Package)) {
- return false;
- }
-
- return true;
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Node newElement = UMLFactory.eINSTANCE.createNode();
-
- Package owner = (Package)getElementToEdit();
- owner.getPackagedElements().add(newElement);
-
-
- ElementInitializers.getInstance().init_Node_2008(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Node newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/NodeCreateCommandCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/NodeCreateCommandCN.java
deleted file mode 100644
index dcd93227633..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/commands/NodeCreateCommandCN.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Node;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class NodeCreateCommandCN extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public NodeCreateCommandCN(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static NodeCreateCommandCN create(CreateElementRequest req, EObject eObject) {
- return new NodeCreateCommandCN(req, eObject);
- }
-
- /**
- * @generated
- */
- public NodeCreateCommandCN(CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- * @generated
- */
- protected EObject getElementToEdit() {
-
-
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
- }
- if(container != null) {
- return container;
- }
- return eObject;
- }
-
- /**
- * @generated
- */
- public boolean canExecute() {
-
-
- return true;
-
-
-
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
-
-
- Node newElement = UMLFactory.eINSTANCE.createNode();
-
- Node owner = (Node)getElementToEdit();
- owner.getNestedNodes().add(newElement);
-
-
- ElementInitializers.getInstance().init_Node_23(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
-
-
-
- /**
- * @generated
- */
- protected void doConfigure(Node newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ArtifactEditHelper.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ArtifactEditHelper.java
deleted file mode 100644
index d01d1a1eb4a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ArtifactEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class ArtifactEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/CommentEditHelper.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/CommentEditHelper.java
deleted file mode 100644
index 1dc22cc5df6..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/CommentEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class CommentEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ConstraintEditHelper.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ConstraintEditHelper.java
deleted file mode 100644
index 5f76fc3af77..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ConstraintEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class ConstraintEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/DependencyEditHelper.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/DependencyEditHelper.java
deleted file mode 100644
index 09ab05eb8a8..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/DependencyEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class DependencyEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/DeploymentEditHelper.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/DeploymentEditHelper.java
deleted file mode 100644
index c4c51ddb57e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/DeploymentEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class DeploymentEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/DeviceEditHelper.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/DeviceEditHelper.java
deleted file mode 100644
index e853cac2365..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/DeviceEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class DeviceEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ExecutionEnvironmentEditHelper.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ExecutionEnvironmentEditHelper.java
deleted file mode 100644
index ffb054ba877..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ExecutionEnvironmentEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/GeneralizationEditHelper.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/GeneralizationEditHelper.java
deleted file mode 100644
index 62a2acf4b20..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/GeneralizationEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class GeneralizationEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ManifestationEditHelper.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ManifestationEditHelper.java
deleted file mode 100644
index c7afb62d550..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ManifestationEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class ManifestationEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ModelEditHelper.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ModelEditHelper.java
deleted file mode 100644
index aefde1f3013..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/ModelEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class ModelEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/NodeEditHelper.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/NodeEditHelper.java
deleted file mode 100644
index 3c13125d68f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/NodeEditHelper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.helpers;
-
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-
-/**
- * @generated
- */
-public class NodeEditHelper extends UMLBaseEditHelper {
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/UMLBaseEditHelper.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/UMLBaseEditHelper.java
deleted file mode 100644
index c5c722ecc57..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/helpers/UMLBaseEditHelper.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.helpers;
-
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-/**
- * @generated
- */
-public class UMLBaseEditHelper extends AbstractEditHelper {
-
- /**
- * @generated
- */
- public static final String EDIT_POLICY_COMMAND = "edit policy command"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final String CONTEXT_ELEMENT_TYPE = "context element type"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- protected IEditHelperAdvice[] getEditHelperAdvice(IEditCommandRequest req) {
- if(req.getParameter(CONTEXT_ELEMENT_TYPE) instanceof IElementType) {
- return ElementTypeRegistry.getInstance().getEditHelperAdvice((IElementType)req.getParameter(CONTEXT_ELEMENT_TYPE));
- }
- return super.getEditHelperAdvice(req);
- }
-
- /**
- * @generated
- */
- protected ICommand getInsteadCommand(IEditCommandRequest req) {
- ICommand epCommand = (ICommand)req.getParameter(EDIT_POLICY_COMMAND);
- req.setParameter(EDIT_POLICY_COMMAND, null);
- ICommand ehCommand = super.getInsteadCommand(req);
- if(epCommand == null) {
- return ehCommand;
- }
- if(ehCommand == null) {
- return epCommand;
- }
- CompositeCommand command = new CompositeCommand(null);
- command.add(epCommand);
- command.add(ehCommand);
- return command;
- }
-
- /**
- * @generated
- */
- protected ICommand getCreateCommand(CreateElementRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected ICommand getCreateRelationshipCommand(CreateRelationshipRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected ICommand getDestroyElementCommand(DestroyElementRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected ICommand getDestroyReferenceCommand(DestroyReferenceRequest req) {
- return null;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPart.java
deleted file mode 100644
index 5b40d571b79..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPart.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.ArtifactCompositeCompartmentItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.Messages;
-
-/**
- * @generated
- */
-public class ArtifactCompositeCompartmentEditPart
-
-
-
-extends ShapeCompartmentEditPart
-
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 26;
-
- /**
- * @generated
- */
- public ArtifactCompositeCompartmentEditPart(View view) {
- super(view);
- }
-
-
- /**
- * @generated
- */
- public String getCompartmentName() {
- return Messages.ArtifactCompositeCompartmentEditPart_title;
- }
-
- /**
- * @generated
- */
- public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setTitleVisibility(false);
- return result;
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ArtifactCompositeCompartmentItemSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.deployment.edit.policies.ArtifactCompositeCompartmentCanonicalEditPolicy());
-
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
- }
-
-
-
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- /**
- * @generated
- */
- protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartACN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartACN.java
deleted file mode 100644
index 037054d3ffe..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartACN.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.ArtifactCompositeCompartmentItemSemanticEditPolicyACN;
-import org.eclipse.papyrus.diagram.deployment.part.Messages;
-
-/**
- * @generated
- */
-public class ArtifactCompositeCompartmentEditPartACN
-
-
-
-extends ShapeCompartmentEditPart
-
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 34;
-
- /**
- * @generated
- */
- public ArtifactCompositeCompartmentEditPartACN(View view) {
- super(view);
- }
-
-
- /**
- * @generated
- */
- public String getCompartmentName() {
- return Messages.ArtifactCompositeCompartmentEditPartACN_title;
- }
-
- /**
- * @generated
- */
- public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setTitleVisibility(false);
- return result;
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ArtifactCompositeCompartmentItemSemanticEditPolicyACN());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.deployment.edit.policies.ArtifactCompositeCompartmentCanonicalEditPolicyACN());
-
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
- }
-
-
-
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- /**
- * @generated
- */
- protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartCN.java
deleted file mode 100644
index 70948b12648..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartCN.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.ArtifactCompositeCompartmentItemSemanticEditPolicyCN;
-import org.eclipse.papyrus.diagram.deployment.part.Messages;
-
-/**
- * @generated
- */
-public class ArtifactCompositeCompartmentEditPartCN
-
-
-
-extends ShapeCompartmentEditPart
-
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 33;
-
- /**
- * @generated
- */
- public ArtifactCompositeCompartmentEditPartCN(View view) {
- super(view);
- }
-
-
- /**
- * @generated
- */
- public String getCompartmentName() {
- return Messages.ArtifactCompositeCompartmentEditPartCN_title;
- }
-
- /**
- * @generated
- */
- public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setTitleVisibility(false);
- return result;
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ArtifactCompositeCompartmentItemSemanticEditPolicyCN());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.deployment.edit.policies.ArtifactCompositeCompartmentCanonicalEditPolicyCN());
-
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
- }
-
-
-
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- /**
- * @generated
- */
- protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactEditPart.java
deleted file mode 100644
index f6c6948c0d9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactEditPart.java
+++ /dev/null
@@ -1,592 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.ArtifactFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.ArtifactItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class ArtifactEditPart extends
-
-ShapeNodeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 2006;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public ArtifactEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ArtifactItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
- installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY, new ShowHideClassifierContentsEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new ArtifactFigure();
- }
-
- /**
- * @generated
- */
- public ArtifactFigure getPrimaryShape() {
- return (ArtifactFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPart) {
- ((ArtifactNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- if(childEditPart instanceof ArtifactCompositeCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((ArtifactCompositeCompartmentEditPart)childEditPart).getFigure());
- return true;
- }
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPart) {
- return true;
- }
- if(childEditPart instanceof ArtifactCompositeCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((ArtifactCompositeCompartmentEditPart)childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ArtifactCompositeCompartmentEditPart) {
- return getPrimaryShape().getCompositeCompartmentFigure();
- }
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Artifact";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(ArtifactNameEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(4);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(6);
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4008) {
- types.add(UMLElementTypes.Comment_2001);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_2005);
- } else if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Artifact", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Artifact", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Artifact", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Artifact", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactEditPartACN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactEditPartACN.java
deleted file mode 100644
index 2aa3b1b8fc0..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactEditPartACN.java
+++ /dev/null
@@ -1,592 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.ArtifactFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.ArtifactItemSemanticEditPolicyACN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class ArtifactEditPartACN extends
-
-ShapeNodeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 28;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public ArtifactEditPartACN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ArtifactItemSemanticEditPolicyACN());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
- installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY, new ShowHideClassifierContentsEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new ArtifactFigure();
- }
-
- /**
- * @generated
- */
- public ArtifactFigure getPrimaryShape() {
- return (ArtifactFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPartACN) {
- ((ArtifactNameEditPartACN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- if(childEditPart instanceof ArtifactCompositeCompartmentEditPartACN) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((ArtifactCompositeCompartmentEditPartACN)childEditPart).getFigure());
- return true;
- }
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPartACN) {
- return true;
- }
- if(childEditPart instanceof ArtifactCompositeCompartmentEditPartACN) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((ArtifactCompositeCompartmentEditPartACN)childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ArtifactCompositeCompartmentEditPartACN) {
- return getPrimaryShape().getCompositeCompartmentFigure();
- }
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Artifact";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(ArtifactNameEditPartACN.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(4);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(6);
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4008) {
- types.add(UMLElementTypes.Comment_2001);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_2005);
- } else if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Artifact", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Artifact", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Artifact", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Artifact", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactEditPartCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactEditPartCN.java
deleted file mode 100644
index c5d1328a742..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactEditPartCN.java
+++ /dev/null
@@ -1,592 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.ArtifactFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.ArtifactItemSemanticEditPolicyCN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class ArtifactEditPartCN extends
-
-ShapeNodeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 25;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public ArtifactEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ArtifactItemSemanticEditPolicyCN());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
- installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY, new ShowHideClassifierContentsEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new ArtifactFigure();
- }
-
- /**
- * @generated
- */
- public ArtifactFigure getPrimaryShape() {
- return (ArtifactFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPartCN) {
- ((ArtifactNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- if(childEditPart instanceof ArtifactCompositeCompartmentEditPartCN) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((ArtifactCompositeCompartmentEditPartCN)childEditPart).getFigure());
- return true;
- }
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPartCN) {
- return true;
- }
- if(childEditPart instanceof ArtifactCompositeCompartmentEditPartCN) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((ArtifactCompositeCompartmentEditPartCN)childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ArtifactCompositeCompartmentEditPartCN) {
- return getPrimaryShape().getCompositeCompartmentFigure();
- }
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Artifact";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(ArtifactNameEditPartCN.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(4);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(6);
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4008) {
- types.add(UMLElementTypes.Comment_2001);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_2005);
- } else if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Artifact", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Artifact", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Artifact", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Artifact", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactNameEditPart.java
deleted file mode 100644
index 72c2fddd9a4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactNameEditPart.java
+++ /dev/null
@@ -1,767 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ArtifactNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 8;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public ArtifactNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Artifact_2006, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactNameEditPartACN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactNameEditPartACN.java
deleted file mode 100644
index aa765e3302d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactNameEditPartACN.java
+++ /dev/null
@@ -1,767 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ArtifactNameEditPartACN extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 29;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public ArtifactNameEditPartACN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Artifact_28, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactNameEditPartACN.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactNameEditPartCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactNameEditPartCN.java
deleted file mode 100644
index d5bfa6368de..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ArtifactNameEditPartCN.java
+++ /dev/null
@@ -1,767 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ArtifactNameEditPartCN extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 27;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public ArtifactNameEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Artifact_25, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactNameEditPartCN.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/CommentAnnotatedElementEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/CommentAnnotatedElementEditPart.java
deleted file mode 100644
index a2206de6e4e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/CommentAnnotatedElementEditPart.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.CommentAnnotatedElementItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class CommentAnnotatedElementEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4008;
-
- /**
- * @generated
- */
- public CommentAnnotatedElementEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CommentAnnotatedElementItemSemanticEditPolicy());
- }
-
-
-
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
-
- protected Connection createConnectionFigure() {
- return new LinkDescriptor();
- }
-
- /**
- * @generated
- */
- public LinkDescriptor getPrimaryShape() {
- return (LinkDescriptor)getFigure();
- }
-
-
- /**
- * @generated
- */
- public class LinkDescriptor extends PolylineConnectionEx {
-
-
-
-
- /**
- * @generated
- */
- public LinkDescriptor() {
- this.setLineWidth(1);
- this.setLineStyle(Graphics.LINE_DASH);
-
- }
-
-
-
-
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/CommentBodyEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/CommentBodyEditPart.java
deleted file mode 100644
index 65530511da5..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/CommentBodyEditPart.java
+++ /dev/null
@@ -1,768 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class CommentBodyEditPart extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 1;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public CommentBodyEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(HTMLCornerBentFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Comment_2001, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.CommentBodyEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/CommentEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/CommentEditPart.java
deleted file mode 100644
index c5cabcf35aa..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/CommentEditPart.java
+++ /dev/null
@@ -1,413 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editparts.AbstractCommentEditPart;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.CommentItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class CommentEditPart extends
-
-
-AbstractCommentEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 2001;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public CommentEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CommentItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
- /**
- *Papyrus codeGen
- *@generated
- **/
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new HTMLCornerBentFigure();
- }
-
- /**
- * @generated
- */
- public HTMLCornerBentFigure getPrimaryShape() {
- return (HTMLCornerBentFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPart) {
- ((CommentBodyEditPart)childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
- return true;
- }
-
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPart) {
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Comment";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(CommentBodyEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.CommentEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4008) {
- types.add(UMLElementTypes.Comment_2001);
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(2);
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4008) {
- types.add(UMLElementTypes.Comment_2001);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_2005);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Comment", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Comment", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Comment", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Comment", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintConstrainedElementEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintConstrainedElementEditPart.java
deleted file mode 100644
index 8168e772f8f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintConstrainedElementEditPart.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.ConstraintConstrainedElementItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class ConstraintConstrainedElementEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4009;
-
- /**
- * @generated
- */
- public ConstraintConstrainedElementEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ConstraintConstrainedElementItemSemanticEditPolicy());
- }
-
-
-
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
-
- protected Connection createConnectionFigure() {
- return new LinkDescriptor();
- }
-
- /**
- * @generated
- */
- public LinkDescriptor getPrimaryShape() {
- return (LinkDescriptor)getFigure();
- }
-
-
- /**
- * @generated
- */
- public class LinkDescriptor extends PolylineConnectionEx {
-
-
-
-
- /**
- * @generated
- */
- public LinkDescriptor() {
- this.setLineWidth(1);
- this.setLineStyle(Graphics.LINE_DASH);
-
- }
-
-
-
-
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintEditPart.java
deleted file mode 100644
index 5f1cf68ab4b..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintEditPart.java
+++ /dev/null
@@ -1,582 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editparts.AbstractConstraintEditPart;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ConstraintFigure;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.ConstraintItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class ConstraintEditPart extends
-
-
-AbstractConstraintEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 2005;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public ConstraintEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ConstraintItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
- /**
- *Papyrus codeGen
- *@generated
- **/
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new ConstraintFigure();
- }
-
- /**
- * @generated
- */
- public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPart) {
- ((ConstraintNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
- if(childEditPart instanceof ConstraintSpecificationEditPart) {
- ((ConstraintSpecificationEditPart)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
- return true;
- }
-
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPart) {
- return true;
- }
- if(childEditPart instanceof ConstraintSpecificationEditPart) {
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Constraint";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(ConstraintNameEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(4);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof CommentEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Comment_2001);
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(5);
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4008) {
- types.add(UMLElementTypes.Comment_2001);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_2005);
- } else if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintNameEditPart.java
deleted file mode 100644
index e94388b2c25..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintNameEditPart.java
+++ /dev/null
@@ -1,767 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ConstraintNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 2;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public ConstraintNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_2005, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintSpecificationEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintSpecificationEditPart.java
deleted file mode 100644
index 775afd1a04b..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ConstraintSpecificationEditPart.java
+++ /dev/null
@@ -1,768 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ConstraintFigure;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ConstraintSpecificationEditPart extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public ConstraintSpecificationEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(ConstraintFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_2005, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintSpecificationEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DependencyAppliedStereotypeEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DependencyAppliedStereotypeEditPart.java
deleted file mode 100644
index 63427d41f1e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DependencyAppliedStereotypeEditPart.java
+++ /dev/null
@@ -1,723 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class DependencyAppliedStereotypeEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 15;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyAppliedStereotypeEditPart.VISUAL_ID), new Point(0, 60));
- }
-
- /**
- * @generated
- */
- public DependencyAppliedStereotypeEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Dependency_4004, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyAppliedStereotypeEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DependencyEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DependencyEditPart.java
deleted file mode 100644
index 1c91a281518..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DependencyEditPart.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.edge.DashedEdgeFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.DependencyItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class DependencyEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4004;
-
- /**
- * @generated
- */
- public DependencyEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DependencyItemSemanticEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DependencyNameEditPart) {
- ((DependencyNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
- if(childEditPart instanceof DependencyAppliedStereotypeEditPart) {
- ((DependencyAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DependencyNameEditPart) {
- return true;
- }
- if(childEditPart instanceof DependencyAppliedStereotypeEditPart) {
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new DashedEdgeFigure();
- }
-
- /**
- * @generated
- */
- public DashedEdgeFigure getPrimaryShape() {
- return (DashedEdgeFigure)getFigure();
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DependencyNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DependencyNameEditPart.java
deleted file mode 100644
index 6e1ac968e49..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DependencyNameEditPart.java
+++ /dev/null
@@ -1,723 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class DependencyNameEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 12;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyNameEditPart.VISUAL_ID), new Point(0, 60));
- }
-
- /**
- * @generated
- */
- public DependencyNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Dependency_4004, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentAppliedStereotypeEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentAppliedStereotypeEditPart.java
deleted file mode 100644
index 2d9e142e1a9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentAppliedStereotypeEditPart.java
+++ /dev/null
@@ -1,723 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class DeploymentAppliedStereotypeEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 14;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentAppliedStereotypeEditPart.VISUAL_ID), new Point(0, 60));
- }
-
- /**
- * @generated
- */
- public DeploymentAppliedStereotypeEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Deployment_4001, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentAppliedStereotypeEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentDiagramEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentDiagramEditPart.java
deleted file mode 100644
index f6f64b392af..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentDiagramEditPart.java
+++ /dev/null
@@ -1,199 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IClippingStrategy;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.BorderedNodeFigure;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.diagram.common.providers.ViewInfo;
-import org.eclipse.papyrus.diagram.common.util.MDTUtil;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.DeploymentDiagramItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-
-/**
- * @generated
- */
-public class DeploymentDiagramEditPart extends DiagramEditPart {
-
- /**
- * @generated
- */
- public final static String MODEL_ID = "PapyrusUMLDeploymentDiagram"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 1000;
-
-
-
- /**
- * @generated
- */
- public DeploymentDiagramEditPart(View view) {
- super(view);
-
-
- getFigure().setClippingStrategy(new IClippingStrategy() {
-
- public Rectangle[] getClip(IFigure childFigure) {
- // very inefficient, since it implies several tree traversals. Bit handles modifications of the tree structure
- // It's a workaround instead of the better solution to fix BorderedNodeFigure (overload and let it return
- // getExtendedBounds)
- // See bug 313985 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=313985) for more details
- applyClippingStrategy(childFigure);
- if(childFigure instanceof BorderedNodeFigure) {
- return new Rectangle[]{ ((BorderedNodeFigure)childFigure).getExtendedBounds() };
-
- } else {
- return new Rectangle[]{ childFigure.getBounds() };
- }
- }
- });
- }
-
- /**
- * @generated
- */
- public void applyClippingStrategy(IFigure fig) {
- boolean hasBorderedNodeChild = false;
- for(Object child : fig.getChildren()) {
- if(child instanceof IFigure) {
- applyClippingStrategy((IFigure)child);
- if(child instanceof BorderedNodeFigure) {
- hasBorderedNodeChild = true;
- }
- }
- }
- if(hasBorderedNodeChild && (fig.getClippingStrategy() == null)) {
- fig.setClippingStrategy(new IClippingStrategy() {
-
- public Rectangle[] getClip(IFigure childFigure) {
- if(childFigure instanceof BorderedNodeFigure) {
- return new Rectangle[]{ ((BorderedNodeFigure)childFigure).getExtendedBounds() };
- } else {
- return new Rectangle[]{ childFigure.getBounds() };
- }
- }
- });
- }
-
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DeploymentDiagramItemSemanticEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.deployment.edit.policies.ModelCanonicalEditPolicy());
-
-
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
- }
-
-
- /**
- * @generated
- */
- /*package-local*/static class NodeLabelDragPolicy extends NonResizableEditPolicy {
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List createSelectionHandles() {
- MoveHandle h = new MoveHandle((GraphicalEditPart)getHost());
- h.setBorder(null);
- return Collections.singletonList(h);
- }
-
- /**
- * @generated
- */
- public Command getCommand(Request request) {
- return null;
- }
-
- /**
- * @generated
- */
- public boolean understandsRequest(Request request) {
- return false;
- }
- }
-
-
- /**
- * @generated
- */
- /*package-local*/static class LinkLabelDragPolicy extends NonResizableLabelEditPolicy {
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
-
- super.handleNotificationEvent(event);
- if(event.getNotifier() instanceof EAnnotation) {
- EAnnotation eAnnotation = (EAnnotation)event.getNotifier();
- if(eAnnotation.getSource() != null && eAnnotation.getSource().equals(MDTUtil.FilterViewAndLabelsSource)) {
- //modification form MOSKitt approach, canonical policies are not called
- MDTUtil.filterDiagramViews(this.getDiagramView());
- }
- }
- }
-
-
- /**
- * @generated
- */
- public Object getAdapter(Class adapter) {
-
- if(adapter != null && adapter.equals(ViewInfo.class)) {
- return UMLVisualIDRegistry.getDiagramViewInfo();
- }
- return super.getAdapter(adapter);
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentEditPart.java
deleted file mode 100644
index 2b3cc98f735..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentEditPart.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeDeploymentLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.edge.DashedEdgeFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.DeploymentItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class DeploymentEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4001;
-
- /**
- * @generated
- */
- public DeploymentEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DeploymentItemSemanticEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeDeploymentLabelDisplayEditPolicy());
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DeploymentNameEditPart) {
- ((DeploymentNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
- if(childEditPart instanceof DeploymentAppliedStereotypeEditPart) {
- ((DeploymentAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DeploymentNameEditPart) {
- return true;
- }
- if(childEditPart instanceof DeploymentAppliedStereotypeEditPart) {
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new DashedEdgeFigure();
- }
-
- /**
- * @generated
- */
- public DashedEdgeFigure getPrimaryShape() {
- return (DashedEdgeFigure)getFigure();
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentNameEditPart.java
deleted file mode 100644
index b8e60ce3c0d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeploymentNameEditPart.java
+++ /dev/null
@@ -1,723 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class DeploymentNameEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 13;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentNameEditPart.VISUAL_ID), new Point(0, 60));
- }
-
- /**
- * @generated
- */
- public DeploymentNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Deployment_4001, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPart.java
deleted file mode 100644
index b61a180adc6..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPart.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.DeviceCompositeCompartmentItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.Messages;
-
-/**
- * @generated
- */
-public class DeviceCompositeCompartmentEditPart
-
-
-
-extends ShapeCompartmentEditPart
-
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 17;
-
- /**
- * @generated
- */
- public DeviceCompositeCompartmentEditPart(View view) {
- super(view);
- }
-
-
- /**
- * @generated
- */
- public String getCompartmentName() {
- return Messages.DeviceCompositeCompartmentEditPart_title;
- }
-
- /**
- * @generated
- */
- public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setTitleVisibility(false);
- return result;
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DeviceCompositeCompartmentItemSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.deployment.edit.policies.DeviceCompositeCompartmentCanonicalEditPolicy());
-
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
- }
-
-
-
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- /**
- * @generated
- */
- protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPartCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPartCN.java
deleted file mode 100644
index 50d5fd0ae18..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPartCN.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.DeviceCompositeCompartmentItemSemanticEditPolicyCN;
-import org.eclipse.papyrus.diagram.deployment.part.Messages;
-
-/**
- * @generated
- */
-public class DeviceCompositeCompartmentEditPartCN
-
-
-
-extends ShapeCompartmentEditPart
-
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 30;
-
- /**
- * @generated
- */
- public DeviceCompositeCompartmentEditPartCN(View view) {
- super(view);
- }
-
-
- /**
- * @generated
- */
- public String getCompartmentName() {
- return Messages.DeviceCompositeCompartmentEditPartCN_title;
- }
-
- /**
- * @generated
- */
- public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setTitleVisibility(false);
- return result;
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DeviceCompositeCompartmentItemSemanticEditPolicyCN());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.deployment.edit.policies.DeviceCompositeCompartmentCanonicalEditPolicyCN());
-
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
- }
-
-
-
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- /**
- * @generated
- */
- protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceEditPart.java
deleted file mode 100644
index b7dc1c30d45..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceEditPart.java
+++ /dev/null
@@ -1,585 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.DeviceFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.DeviceItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class DeviceEditPart extends
-
-ShapeNodeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 2003;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public DeviceEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DeviceItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new DeviceFigure();
- }
-
- /**
- * @generated
- */
- public DeviceFigure getPrimaryShape() {
- return (DeviceFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DeviceNameEditPart) {
- ((DeviceNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- if(childEditPart instanceof DeviceCompositeCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((DeviceCompositeCompartmentEditPart)childEditPart).getFigure());
- return true;
- }
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DeviceNameEditPart) {
- return true;
- }
- if(childEditPart instanceof DeviceCompositeCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((DeviceCompositeCompartmentEditPart)childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof DeviceCompositeCompartmentEditPart) {
- return getPrimaryShape().getCompositeCompartmentFigure();
- }
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Device";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(DeviceNameEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(4);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(6);
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4008) {
- types.add(UMLElementTypes.Comment_2001);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_2005);
- } else if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Device", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Device", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Device", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Device", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceEditPartCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceEditPartCN.java
deleted file mode 100644
index c2d621ff776..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceEditPartCN.java
+++ /dev/null
@@ -1,589 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.DeviceFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.DeviceItemSemanticEditPolicyCN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class DeviceEditPartCN extends
-
-ShapeNodeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 16;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public DeviceEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DeviceItemSemanticEditPolicyCN());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
- installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY, new ShowHideClassifierContentsEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new DeviceFigure();
- }
-
- /**
- * @generated
- */
- public DeviceFigure getPrimaryShape() {
- return (DeviceFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DeviceNameEditPartCN) {
- ((DeviceNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- if(childEditPart instanceof DeviceCompositeCompartmentEditPartCN) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((DeviceCompositeCompartmentEditPartCN)childEditPart).getFigure());
- return true;
- }
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DeviceNameEditPartCN) {
- return true;
- }
- if(childEditPart instanceof DeviceCompositeCompartmentEditPartCN) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((DeviceCompositeCompartmentEditPartCN)childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof DeviceCompositeCompartmentEditPartCN) {
- return getPrimaryShape().getCompositeCompartmentFigure();
- }
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Device";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(DeviceNameEditPartCN.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(4);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(6);
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4008) {
- types.add(UMLElementTypes.Comment_2001);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_2005);
- } else if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Device", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Device", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Device", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Device", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceNameEditPart.java
deleted file mode 100644
index 8ec72dfe043..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceNameEditPart.java
+++ /dev/null
@@ -1,767 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class DeviceNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 6;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public DeviceNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Device_2003, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceNameEditPartCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceNameEditPartCN.java
deleted file mode 100644
index a6c99b67947..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/DeviceNameEditPartCN.java
+++ /dev/null
@@ -1,767 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class DeviceNameEditPartCN extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 20;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public DeviceNameEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Device_16, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceNameEditPartCN.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPart.java
deleted file mode 100644
index 50199909560..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPart.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.Messages;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentCompositeCompartmentEditPart
-
-
-
-extends ShapeCompartmentEditPart
-
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 18;
-
- /**
- * @generated
- */
- public ExecutionEnvironmentCompositeCompartmentEditPart(View view) {
- super(view);
- }
-
-
- /**
- * @generated
- */
- public String getCompartmentName() {
- return Messages.ExecutionEnvironmentCompositeCompartmentEditPart_title;
- }
-
- /**
- * @generated
- */
- public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setTitleVisibility(false);
- return result;
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.deployment.edit.policies.ExecutionEnvironmentCompositeCompartmentCanonicalEditPolicy());
-
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
- }
-
-
-
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- /**
- * @generated
- */
- protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPartCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPartCN.java
deleted file mode 100644
index cf8211642f1..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPartCN.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicyCN;
-import org.eclipse.papyrus.diagram.deployment.part.Messages;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentCompositeCompartmentEditPartCN
-
-
-
-extends ShapeCompartmentEditPart
-
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 31;
-
- /**
- * @generated
- */
- public ExecutionEnvironmentCompositeCompartmentEditPartCN(View view) {
- super(view);
- }
-
-
- /**
- * @generated
- */
- public String getCompartmentName() {
- return Messages.ExecutionEnvironmentCompositeCompartmentEditPartCN_title;
- }
-
- /**
- * @generated
- */
- public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setTitleVisibility(false);
- return result;
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicyCN());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.deployment.edit.policies.ExecutionEnvironmentCompositeCompartmentCanonicalEditPolicyCN());
-
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
- }
-
-
-
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- /**
- * @generated
- */
- protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentEditPart.java
deleted file mode 100644
index 4016780d628..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentEditPart.java
+++ /dev/null
@@ -1,585 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.ExecutionEnvironmentFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.ExecutionEnvironmentItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentEditPart extends
-
-ShapeNodeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 2002;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public ExecutionEnvironmentEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ExecutionEnvironmentItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new ExecutionEnvironmentFigure();
- }
-
- /**
- * @generated
- */
- public ExecutionEnvironmentFigure getPrimaryShape() {
- return (ExecutionEnvironmentFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ExecutionEnvironmentNameEditPart) {
- ((ExecutionEnvironmentNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- if(childEditPart instanceof ExecutionEnvironmentCompositeCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((ExecutionEnvironmentCompositeCompartmentEditPart)childEditPart).getFigure());
- return true;
- }
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ExecutionEnvironmentNameEditPart) {
- return true;
- }
- if(childEditPart instanceof ExecutionEnvironmentCompositeCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((ExecutionEnvironmentCompositeCompartmentEditPart)childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ExecutionEnvironmentCompositeCompartmentEditPart) {
- return getPrimaryShape().getCompositeCompartmentFigure();
- }
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "ExecutionEnvironment";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(ExecutionEnvironmentNameEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(4);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(6);
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4008) {
- types.add(UMLElementTypes.Comment_2001);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_2005);
- } else if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("ExecutionEnvironment", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("ExecutionEnvironment", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("ExecutionEnvironment", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("ExecutionEnvironment", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentEditPartCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentEditPartCN.java
deleted file mode 100644
index ea569bd3bcb..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentEditPartCN.java
+++ /dev/null
@@ -1,589 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.ExecutionEnvironmentFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.ExecutionEnvironmentItemSemanticEditPolicyCN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentEditPartCN extends
-
-ShapeNodeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 21;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public ExecutionEnvironmentEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ExecutionEnvironmentItemSemanticEditPolicyCN());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
- installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY, new ShowHideClassifierContentsEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new ExecutionEnvironmentFigure();
- }
-
- /**
- * @generated
- */
- public ExecutionEnvironmentFigure getPrimaryShape() {
- return (ExecutionEnvironmentFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ExecutionEnvironmentNameEditPartCN) {
- ((ExecutionEnvironmentNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- if(childEditPart instanceof ExecutionEnvironmentCompositeCompartmentEditPartCN) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((ExecutionEnvironmentCompositeCompartmentEditPartCN)childEditPart).getFigure());
- return true;
- }
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ExecutionEnvironmentNameEditPartCN) {
- return true;
- }
- if(childEditPart instanceof ExecutionEnvironmentCompositeCompartmentEditPartCN) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((ExecutionEnvironmentCompositeCompartmentEditPartCN)childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ExecutionEnvironmentCompositeCompartmentEditPartCN) {
- return getPrimaryShape().getCompositeCompartmentFigure();
- }
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "ExecutionEnvironment";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(ExecutionEnvironmentNameEditPartCN.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(4);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(6);
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4008) {
- types.add(UMLElementTypes.Comment_2001);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_2005);
- } else if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("ExecutionEnvironment", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("ExecutionEnvironment", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("ExecutionEnvironment", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("ExecutionEnvironment", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentNameEditPart.java
deleted file mode 100644
index 3ba70e33c1b..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentNameEditPart.java
+++ /dev/null
@@ -1,767 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public ExecutionEnvironmentNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.ExecutionEnvironment_2002, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentNameEditPartCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentNameEditPartCN.java
deleted file mode 100644
index bbd23f333fc..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ExecutionEnvironmentNameEditPartCN.java
+++ /dev/null
@@ -1,767 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentNameEditPartCN extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 22;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public ExecutionEnvironmentNameEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.ExecutionEnvironment_21, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentNameEditPartCN.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/GeneralizationAppliedStereotypeEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/GeneralizationAppliedStereotypeEditPart.java
deleted file mode 100644
index 1c26eb4a73e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/GeneralizationAppliedStereotypeEditPart.java
+++ /dev/null
@@ -1,715 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class GeneralizationAppliedStereotypeEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationAppliedStereotypeEditPart.VISUAL_ID), new Point(0, 60));
- }
-
- /**
- * @generated
- */
- public GeneralizationAppliedStereotypeEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return false;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Generalization_4003, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationAppliedStereotypeEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- // The label is read-only (defined in GMFGen model)
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/GeneralizationEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/GeneralizationEditPart.java
deleted file mode 100644
index 8ef134e73ba..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/GeneralizationEditPart.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.edge.GeneralizationFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.GeneralizationItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class GeneralizationEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4003;
-
- /**
- * @generated
- */
- public GeneralizationEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new GeneralizationItemSemanticEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof GeneralizationAppliedStereotypeEditPart) {
- ((GeneralizationAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof GeneralizationAppliedStereotypeEditPart) {
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new GeneralizationFigure();
- }
-
- /**
- * @generated
- */
- public GeneralizationFigure getPrimaryShape() {
- return (GeneralizationFigure)getFigure();
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/LinkDescriptorEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/LinkDescriptorEditPart.java
deleted file mode 100644
index 3ad923477bc..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/LinkDescriptorEditPart.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ViewComponentEditPolicy;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * @generated
- */
-public class LinkDescriptorEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4005;
-
- /**
- * @generated
- */
- public LinkDescriptorEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.COMPONENT_ROLE, new ViewComponentEditPolicy());
- removeEditPolicy(EditPolicyRoles.SEMANTIC_ROLE);
- }
-
-
-
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
-
- protected Connection createConnectionFigure() {
- return new LinkDescriptor();
- }
-
- /**
- * @generated
- */
- public LinkDescriptor getPrimaryShape() {
- return (LinkDescriptor)getFigure();
- }
-
-
- /**
- * @generated
- */
- public class LinkDescriptor extends PolylineConnectionEx {
-
-
-
-
- /**
- * @generated
- */
- public LinkDescriptor() {
- this.setLineWidth(1);
- this.setLineStyle(Graphics.LINE_DASH);
-
- }
-
-
-
-
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ManifestationAppliedStereotypeEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ManifestationAppliedStereotypeEditPart.java
deleted file mode 100644
index 675bcde2d3e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ManifestationAppliedStereotypeEditPart.java
+++ /dev/null
@@ -1,723 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ManifestationAppliedStereotypeEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 11;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationAppliedStereotypeEditPart.VISUAL_ID), new Point(0, 30));
- }
-
- /**
- * @generated
- */
- public ManifestationAppliedStereotypeEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Manifestation_4002, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationAppliedStereotypeEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ManifestationEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ManifestationEditPart.java
deleted file mode 100644
index 46f383e3f1e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ManifestationEditPart.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeManifestationLabelDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.edge.DashedEdgeFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.ManifestationItemSemanticEditPolicy;
-
-/**
- * @generated
- */
-public class ManifestationEditPart extends ConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4002;
-
- /**
- * @generated
- */
- public ManifestationEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ManifestationItemSemanticEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeManifestationLabelDisplayEditPolicy());
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ManifestationNameEditPart) {
- ((ManifestationNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
- if(childEditPart instanceof ManifestationAppliedStereotypeEditPart) {
- ((ManifestationAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ManifestationNameEditPart) {
- return true;
- }
- if(childEditPart instanceof ManifestationAppliedStereotypeEditPart) {
- return true;
- }
- return false;
- }
-
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new DashedEdgeFigure();
- }
-
- /**
- * @generated
- */
- public DashedEdgeFigure getPrimaryShape() {
- return (DashedEdgeFigure)getFigure();
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ManifestationNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ManifestationNameEditPart.java
deleted file mode 100644
index e372b9658a4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/ManifestationNameEditPart.java
+++ /dev/null
@@ -1,723 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ManifestationNameEditPart extends LabelEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 10;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationNameEditPart.VISUAL_ID), new Point(0, 60));
- }
-
- /**
- * @generated
- */
- public ManifestationNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Manifestation_4002, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeCompositeCompartmentEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeCompositeCompartmentEditPart.java
deleted file mode 100644
index b7c8b81d30f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeCompositeCompartmentEditPart.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.NodeCompositeCompartmentItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.Messages;
-
-/**
- * @generated
- */
-public class NodeCompositeCompartmentEditPart
-
-
-
-extends ShapeCompartmentEditPart
-
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 19;
-
- /**
- * @generated
- */
- public NodeCompositeCompartmentEditPart(View view) {
- super(view);
- }
-
-
- /**
- * @generated
- */
- public String getCompartmentName() {
- return Messages.NodeCompositeCompartmentEditPart_title;
- }
-
- /**
- * @generated
- */
- public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setTitleVisibility(false);
- return result;
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new NodeCompositeCompartmentItemSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.deployment.edit.policies.NodeCompositeCompartmentCanonicalEditPolicy());
-
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
- }
-
-
-
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- /**
- * @generated
- */
- protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeCompositeCompartmentEditPartCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeCompositeCompartmentEditPartCN.java
deleted file mode 100644
index b9b3f93d386..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeCompositeCompartmentEditPartCN.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.editpolicies.CustomContainerEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.NodeCompositeCompartmentItemSemanticEditPolicyCN;
-import org.eclipse.papyrus.diagram.deployment.part.Messages;
-
-/**
- * @generated
- */
-public class NodeCompositeCompartmentEditPartCN
-
-
-
-extends ShapeCompartmentEditPart
-
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 32;
-
- /**
- * @generated
- */
- public NodeCompositeCompartmentEditPartCN(View view) {
- super(view);
- }
-
-
- /**
- * @generated
- */
- public String getCompartmentName() {
- return Messages.NodeCompositeCompartmentEditPartCN_title;
- }
-
- /**
- * @generated
- */
- public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setTitleVisibility(false);
- return result;
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new NodeCompositeCompartmentItemSemanticEditPolicyCN());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.deployment.edit.policies.NodeCompositeCompartmentCanonicalEditPolicyCN());
-
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
- }
-
-
-
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- /**
- * @generated
- */
- protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeEditPart.java
deleted file mode 100644
index 55e5509c84c..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeEditPart.java
+++ /dev/null
@@ -1,584 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.NodeFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.NodeItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class NodeEditPart extends
-
-ShapeNodeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 2008;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public NodeEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new NodeItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new NodeFigure();
- }
-
- /**
- * @generated
- */
- public NodeFigure getPrimaryShape() {
- return (NodeFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof NodeNameEditPart) {
- ((NodeNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- if(childEditPart instanceof NodeCompositeCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((NodeCompositeCompartmentEditPart)childEditPart).getFigure());
- return true;
- }
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof NodeNameEditPart) {
- return true;
- }
- if(childEditPart instanceof NodeCompositeCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((NodeCompositeCompartmentEditPart)childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof NodeCompositeCompartmentEditPart) {
- return getPrimaryShape().getCompositeCompartmentFigure();
- }
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure createNodePlate() {
- String prefElementId = "Node";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure createNodeFigure() {
- org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(NodeNameEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(4);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(6);
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4008) {
- types.add(UMLElementTypes.Comment_2001);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_2005);
- } else if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Node", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Node", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Node", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Node", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeEditPartCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeEditPartCN.java
deleted file mode 100644
index 75f89c833f4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeEditPartCN.java
+++ /dev/null
@@ -1,588 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy;
-import org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.diagram.deployment.custom.figure.nodes.NodeFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.NodeItemSemanticEditPolicyCN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class NodeEditPartCN extends
-
-ShapeNodeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 23;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public NodeEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new NodeItemSemanticEditPolicyCN());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
- installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY, new ShowHideClassifierContentsEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new NodeFigure();
- }
-
- /**
- * @generated
- */
- public NodeFigure getPrimaryShape() {
- return (NodeFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof NodeNameEditPartCN) {
- ((NodeNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- if(childEditPart instanceof NodeCompositeCompartmentEditPartCN) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((NodeCompositeCompartmentEditPartCN)childEditPart).getFigure());
- return true;
- }
-
- return false;
- }
-
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof NodeNameEditPartCN) {
- return true;
- }
- if(childEditPart instanceof NodeCompositeCompartmentEditPartCN) {
- IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((NodeCompositeCompartmentEditPartCN)childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof NodeCompositeCompartmentEditPartCN) {
- return getPrimaryShape().getCompositeCompartmentFigure();
- }
- return getContentPane();
- }
-
-
- /**
- * @generated
- */
- protected org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure createNodePlate() {
- String prefElementId = "Node";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure createNodeFigure() {
- org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(NodeNameEditPartCN.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(4);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Deployment_4001);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Manifestation_4002);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Generalization_4003);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof NodeEditPart) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- types.add(UMLElementTypes.Dependency_4004);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(6);
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
- types.add(UMLElementTypes.Deployment_4001);
- types.add(UMLElementTypes.Manifestation_4002);
- types.add(UMLElementTypes.Generalization_4003);
- types.add(UMLElementTypes.Dependency_4004);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4008) {
- types.add(UMLElementTypes.Comment_2001);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4009) {
- types.add(UMLElementTypes.Constraint_2005);
- } else if(relationshipType == UMLElementTypes.Deployment_4001) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Manifestation_4002) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Generalization_4003) {
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- } else if(relationshipType == UMLElementTypes.Dependency_4004) {
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
- }
- return types;
- }
-
-
-
-
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Node", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Node", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Node", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("Node", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeNameEditPart.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeNameEditPart.java
deleted file mode 100644
index be30f027a56..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeNameEditPart.java
+++ /dev/null
@@ -1,767 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class NodeNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 9;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public NodeNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Node_2008, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.NodeNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeNameEditPartCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeNameEditPartCN.java
deleted file mode 100644
index 82aa619b53d..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/NodeNameEditPartCN.java
+++ /dev/null
@@ -1,767 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLParserProvider;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class NodeNameEditPartCN extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 24;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
-
-
- /**
- * direct edition mode (default, undefined, registered editor, etc.)
- * @generated
- */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /**
- * configuration from a registered edit dialog
- * @generated
- */
- protected IDirectEditorConfiguration configuration;
-
-
-
- /**
- * @generated
- */
- public NodeNameEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DeploymentDiagramEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if(value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Node_23, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.deployment.edit.parts.NodeNameEditPartCN.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return (View)getModel();
- }
-
-
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if(resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/UMLEditPartFactory.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/UMLEditPartFactory.java
deleted file mode 100644
index a557c715739..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/parts/UMLEditPartFactory.java
+++ /dev/null
@@ -1,334 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.parts;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.papyrus.diagram.common.figure.node.IMultilineEditableFigure;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @generated
- */
-public class UMLEditPartFactory implements EditPartFactory {
-
- /**
- * @generated
- */
- public EditPart createEditPart(EditPart context, Object model) {
- if(model instanceof View) {
- View view = (View)model;
- switch(UMLVisualIDRegistry.getVisualID(view)) {
-
- case DeploymentDiagramEditPart.VISUAL_ID:
- return new DeploymentDiagramEditPart(view);
-
- case CommentEditPart.VISUAL_ID:
- return new CommentEditPart(view);
-
- case CommentBodyEditPart.VISUAL_ID:
- return new CommentBodyEditPart(view);
-
- case ConstraintEditPart.VISUAL_ID:
- return new ConstraintEditPart(view);
-
- case ConstraintNameEditPart.VISUAL_ID:
- return new ConstraintNameEditPart(view);
-
- case ConstraintSpecificationEditPart.VISUAL_ID:
- return new ConstraintSpecificationEditPart(view);
-
- case ExecutionEnvironmentEditPart.VISUAL_ID:
- return new ExecutionEnvironmentEditPart(view);
-
- case ExecutionEnvironmentNameEditPart.VISUAL_ID:
- return new ExecutionEnvironmentNameEditPart(view);
-
- case DeviceEditPart.VISUAL_ID:
- return new DeviceEditPart(view);
-
- case DeviceNameEditPart.VISUAL_ID:
- return new DeviceNameEditPart(view);
-
- case ArtifactEditPart.VISUAL_ID:
- return new ArtifactEditPart(view);
-
- case ArtifactNameEditPart.VISUAL_ID:
- return new ArtifactNameEditPart(view);
-
- case NodeEditPart.VISUAL_ID:
- return new NodeEditPart(view);
-
- case NodeNameEditPart.VISUAL_ID:
- return new NodeNameEditPart(view);
-
- case NodeEditPartCN.VISUAL_ID:
- return new NodeEditPartCN(view);
-
- case NodeNameEditPartCN.VISUAL_ID:
- return new NodeNameEditPartCN(view);
-
- case DeviceEditPartCN.VISUAL_ID:
- return new DeviceEditPartCN(view);
-
- case DeviceNameEditPartCN.VISUAL_ID:
- return new DeviceNameEditPartCN(view);
-
- case ExecutionEnvironmentEditPartCN.VISUAL_ID:
- return new ExecutionEnvironmentEditPartCN(view);
-
- case ExecutionEnvironmentNameEditPartCN.VISUAL_ID:
- return new ExecutionEnvironmentNameEditPartCN(view);
-
- case ArtifactEditPartCN.VISUAL_ID:
- return new ArtifactEditPartCN(view);
-
- case ArtifactNameEditPartCN.VISUAL_ID:
- return new ArtifactNameEditPartCN(view);
-
- case ArtifactEditPartACN.VISUAL_ID:
- return new ArtifactEditPartACN(view);
-
- case ArtifactNameEditPartACN.VISUAL_ID:
- return new ArtifactNameEditPartACN(view);
-
- case DeviceCompositeCompartmentEditPart.VISUAL_ID:
- return new DeviceCompositeCompartmentEditPart(view);
-
- case ExecutionEnvironmentCompositeCompartmentEditPart.VISUAL_ID:
- return new ExecutionEnvironmentCompositeCompartmentEditPart(view);
-
- case NodeCompositeCompartmentEditPart.VISUAL_ID:
- return new NodeCompositeCompartmentEditPart(view);
-
- case ArtifactCompositeCompartmentEditPart.VISUAL_ID:
- return new ArtifactCompositeCompartmentEditPart(view);
-
- case DeviceCompositeCompartmentEditPartCN.VISUAL_ID:
- return new DeviceCompositeCompartmentEditPartCN(view);
-
- case ExecutionEnvironmentCompositeCompartmentEditPartCN.VISUAL_ID:
- return new ExecutionEnvironmentCompositeCompartmentEditPartCN(view);
-
- case NodeCompositeCompartmentEditPartCN.VISUAL_ID:
- return new NodeCompositeCompartmentEditPartCN(view);
-
- case ArtifactCompositeCompartmentEditPartCN.VISUAL_ID:
- return new ArtifactCompositeCompartmentEditPartCN(view);
-
- case ArtifactCompositeCompartmentEditPartACN.VISUAL_ID:
- return new ArtifactCompositeCompartmentEditPartACN(view);
-
- case LinkDescriptorEditPart.VISUAL_ID:
- return new LinkDescriptorEditPart(view);
-
-
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return new CommentAnnotatedElementEditPart(view);
-
-
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return new ConstraintConstrainedElementEditPart(view);
-
-
- case DeploymentEditPart.VISUAL_ID:
- return new DeploymentEditPart(view);
-
- case DeploymentNameEditPart.VISUAL_ID:
- return new DeploymentNameEditPart(view);
-
- case DeploymentAppliedStereotypeEditPart.VISUAL_ID:
- return new DeploymentAppliedStereotypeEditPart(view);
-
-
- case ManifestationEditPart.VISUAL_ID:
- return new ManifestationEditPart(view);
-
- case ManifestationNameEditPart.VISUAL_ID:
- return new ManifestationNameEditPart(view);
-
- case ManifestationAppliedStereotypeEditPart.VISUAL_ID:
- return new ManifestationAppliedStereotypeEditPart(view);
-
-
- case GeneralizationEditPart.VISUAL_ID:
- return new GeneralizationEditPart(view);
-
- case GeneralizationAppliedStereotypeEditPart.VISUAL_ID:
- return new GeneralizationAppliedStereotypeEditPart(view);
-
-
- case DependencyEditPart.VISUAL_ID:
- return new DependencyEditPart(view);
-
- case DependencyNameEditPart.VISUAL_ID:
- return new DependencyNameEditPart(view);
-
- case DependencyAppliedStereotypeEditPart.VISUAL_ID:
- return new DependencyAppliedStereotypeEditPart(view);
-
- }
- }
- return createUnrecognizedEditPart(context, model);
- }
-
- /**
- * @generated
- */
- private EditPart createUnrecognizedEditPart(EditPart context, Object model) {
- // Handle creation of unrecognized child node EditParts here
- return null;
- }
-
- /**
- * @generated
- */
- public static CellEditorLocator getTextCellEditorLocator(ITextAwareEditPart source) {
- if(source.getFigure() instanceof IMultilineEditableFigure)
- return new MultilineCellEditorLocator((IMultilineEditableFigure)source.getFigure());
- else if(source.getFigure() instanceof WrappingLabel)
- return new TextCellEditorLocator((WrappingLabel)source.getFigure());
- else {
- return new LabelCellEditorLocator((Label)source.getFigure());
- }
- }
-
-
- /**
- * @generated
- */
- static private class MultilineCellEditorLocator implements CellEditorLocator {
-
- /**
- * @generated
- */
- private IMultilineEditableFigure multilineEditableFigure;
-
- /**
- * @generated
- */
- public MultilineCellEditorLocator(IMultilineEditableFigure figure) {
- this.multilineEditableFigure = figure;
- }
-
- /**
- * @generated
- */
- public IMultilineEditableFigure getMultilineEditableFigure() {
- return multilineEditableFigure;
- }
-
- /**
- * @generated
- */
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- Rectangle rect = getMultilineEditableFigure().getBounds().getCopy();
- rect.x = getMultilineEditableFigure().getEditionLocation().x;
- rect.y = getMultilineEditableFigure().getEditionLocation().y;
- getMultilineEditableFigure().translateToAbsolute(rect);
- if(getMultilineEditableFigure().getText().length() > 0) {
- rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
- }
- if(!rect.equals(new Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
- }
-
-
- /**
- * @generated
- */
- static private class TextCellEditorLocator implements CellEditorLocator {
-
- /**
- * @generated
- */
- private WrappingLabel wrapLabel;
-
- /**
- * @generated
- */
- public TextCellEditorLocator(WrappingLabel wrapLabel) {
- this.wrapLabel = wrapLabel;
- }
-
- /**
- * @generated
- */
- public WrappingLabel getWrapLabel() {
- return wrapLabel;
- }
-
- /**
- * @generated
- */
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- Rectangle rect = getWrapLabel().getTextBounds().getCopy();
- getWrapLabel().translateToAbsolute(rect);
- if(!text.getFont().isDisposed()) {
- if(getWrapLabel().isTextWrapOn() && getWrapLabel().getText().length() > 0) {
- rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
- } else {
- int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
- rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
- }
- }
- if(!rect.equals(new Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
- }
-
- /**
- * @generated
- */
- private static class LabelCellEditorLocator implements CellEditorLocator {
-
- /**
- * @generated
- */
- private Label label;
-
- /**
- * @generated
- */
- public LabelCellEditorLocator(Label label) {
- this.label = label;
- }
-
- /**
- * @generated
- */
- public Label getLabel() {
- return label;
- }
-
- /**
- * @generated
- */
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- Rectangle rect = getLabel().getTextBounds().getCopy();
- getLabel().translateToAbsolute(rect);
- if(!text.getFont().isDisposed()) {
- int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
- rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
- }
- if(!rect.equals(new Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentCanonicalEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentCanonicalEditPolicy.java
deleted file mode 100644
index 5de66773985..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentCanonicalEditPolicy.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.deployment.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ArtifactCompositeCompartmentCanonicalEditPolicy extends CanonicalEditPolicy {
-
-
- /**
- * @generated
- */
- protected EStructuralFeature getFeatureToSynchronize() {
- return UMLPackage.eINSTANCE.getArtifact_NestedArtifact();
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getArtifactArtifactCompositeCompartment_26SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- return ArtifactEditPartACN.VISUAL_ID == UMLVisualIDRegistry.getVisualID(view);
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getArtifactArtifactCompositeCompartment_26SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentCanonicalEditPolicyACN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentCanonicalEditPolicyACN.java
deleted file mode 100644
index 9f3349cddf7..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentCanonicalEditPolicyACN.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.deployment.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ArtifactCompositeCompartmentCanonicalEditPolicyACN extends CanonicalEditPolicy {
-
-
- /**
- * @generated
- */
- protected EStructuralFeature getFeatureToSynchronize() {
- return UMLPackage.eINSTANCE.getArtifact_NestedArtifact();
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getArtifactArtifactCompositeCompartment_34SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- return ArtifactEditPartACN.VISUAL_ID == UMLVisualIDRegistry.getVisualID(view);
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getArtifactArtifactCompositeCompartment_34SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentCanonicalEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentCanonicalEditPolicyCN.java
deleted file mode 100644
index 1bdc9fcaffa..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentCanonicalEditPolicyCN.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.deployment.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ArtifactCompositeCompartmentCanonicalEditPolicyCN extends CanonicalEditPolicy {
-
-
- /**
- * @generated
- */
- protected EStructuralFeature getFeatureToSynchronize() {
- return UMLPackage.eINSTANCE.getArtifact_NestedArtifact();
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getArtifactArtifactCompositeCompartment_33SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- return ArtifactEditPartACN.VISUAL_ID == UMLVisualIDRegistry.getVisualID(view);
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getArtifactArtifactCompositeCompartment_33SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentItemSemanticEditPolicy.java
deleted file mode 100644
index 2d149eed6ee..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ArtifactCreateCommandACN;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class ArtifactCompositeCompartmentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ArtifactCompositeCompartmentItemSemanticEditPolicy() {
- super(UMLElementTypes.Artifact_2006);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Artifact_28 == req.getElementType()) {
- return getGEFWrapper(new ArtifactCreateCommandACN(req));
- }
- return super.getCreateCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentItemSemanticEditPolicyACN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentItemSemanticEditPolicyACN.java
deleted file mode 100644
index ef9121708cd..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentItemSemanticEditPolicyACN.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ArtifactCreateCommandACN;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class ArtifactCompositeCompartmentItemSemanticEditPolicyACN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ArtifactCompositeCompartmentItemSemanticEditPolicyACN() {
- super(UMLElementTypes.Artifact_28);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Artifact_28 == req.getElementType()) {
- return getGEFWrapper(new ArtifactCreateCommandACN(req));
- }
- return super.getCreateCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentItemSemanticEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentItemSemanticEditPolicyCN.java
deleted file mode 100644
index 083f4894ef9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactCompositeCompartmentItemSemanticEditPolicyCN.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ArtifactCreateCommandACN;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class ArtifactCompositeCompartmentItemSemanticEditPolicyCN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ArtifactCompositeCompartmentItemSemanticEditPolicyCN() {
- super(UMLElementTypes.Artifact_25);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Artifact_28 == req.getElementType()) {
- return getGEFWrapper(new ArtifactCreateCommandACN(req));
- }
- return super.getCreateCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactItemSemanticEditPolicy.java
deleted file mode 100644
index f5221ddbeb2..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,163 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeploymentCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.GeneralizationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class ArtifactItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ArtifactItemSemanticEditPolicy() {
- super(UMLElementTypes.Artifact_2006);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactItemSemanticEditPolicyACN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactItemSemanticEditPolicyACN.java
deleted file mode 100644
index 4183df1b327..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactItemSemanticEditPolicyACN.java
+++ /dev/null
@@ -1,246 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.DeleteCommand;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.command.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeploymentCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.GeneralizationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class ArtifactItemSemanticEditPolicyACN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ArtifactItemSemanticEditPolicyACN() {
- super(UMLElementTypes.Artifact_28);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
-
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if(annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyChildNodesCommand(cmd);
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new DeleteCommand(getEditingDomain(), todestroy)));
- } else {
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * @generated
- */
- protected void addDestroyChildNodesCommand(ICompositeCommand cmd) {
- View view = (View)getHost().getModel();
- for(Iterator<?> nit = view.getChildren().iterator(); nit.hasNext();) {
- Node node = (Node)nit.next();
- switch(UMLVisualIDRegistry.getVisualID(node)) {
- case ArtifactCompositeCompartmentEditPartACN.VISUAL_ID:
- for(Iterator<?> cit = node.getChildren().iterator(); cit.hasNext();) {
- Node cnode = (Node)cit.next();
- switch(UMLVisualIDRegistry.getVisualID(cnode)) {
- case ArtifactEditPartACN.VISUAL_ID:
-
-
- for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
- Edge incomingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
- cmd.add(new DestroyReferenceCommand(destroyRefReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(incomingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- }
- }
-
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
- cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
- // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
- // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
- break;
- }
- }
- break;
- }
- }
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactItemSemanticEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactItemSemanticEditPolicyCN.java
deleted file mode 100644
index e3c93014e87..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ArtifactItemSemanticEditPolicyCN.java
+++ /dev/null
@@ -1,246 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.DeleteCommand;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.command.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeploymentCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.GeneralizationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class ArtifactItemSemanticEditPolicyCN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ArtifactItemSemanticEditPolicyCN() {
- super(UMLElementTypes.Artifact_25);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
-
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if(annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyChildNodesCommand(cmd);
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new DeleteCommand(getEditingDomain(), todestroy)));
- } else {
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * @generated
- */
- protected void addDestroyChildNodesCommand(ICompositeCommand cmd) {
- View view = (View)getHost().getModel();
- for(Iterator<?> nit = view.getChildren().iterator(); nit.hasNext();) {
- Node node = (Node)nit.next();
- switch(UMLVisualIDRegistry.getVisualID(node)) {
- case ArtifactCompositeCompartmentEditPartCN.VISUAL_ID:
- for(Iterator<?> cit = node.getChildren().iterator(); cit.hasNext();) {
- Node cnode = (Node)cit.next();
- switch(UMLVisualIDRegistry.getVisualID(cnode)) {
- case ArtifactEditPartACN.VISUAL_ID:
-
-
- for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
- Edge incomingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
- cmd.add(new DestroyReferenceCommand(destroyRefReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(incomingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- }
- }
-
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
- cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
- // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
- // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
- break;
- }
- }
- break;
- }
- }
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java
deleted file mode 100644
index a5fd5417ee0..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class CommentAnnotatedElementItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public CommentAnnotatedElementItemSemanticEditPolicy() {
- super(UMLElementTypes.CommentAnnotatedElement_4008);
- }
-
- /**
- * @generated
- */
- protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
- return getGEFWrapper(new DestroyReferenceCommand(req));
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/CommentItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/CommentItemSemanticEditPolicy.java
deleted file mode 100644
index 23617147ad9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/CommentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class CommentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public CommentItemSemanticEditPolicy() {
- super(UMLElementTypes.Comment_2001);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ConstraintConstrainedElementItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ConstraintConstrainedElementItemSemanticEditPolicy.java
deleted file mode 100644
index 47c3cb9ad31..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ConstraintConstrainedElementItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class ConstraintConstrainedElementItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ConstraintConstrainedElementItemSemanticEditPolicy() {
- super(UMLElementTypes.ConstraintConstrainedElement_4009);
- }
-
- /**
- * @generated
- */
- protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
- return getGEFWrapper(new DestroyReferenceCommand(req));
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ConstraintItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ConstraintItemSemanticEditPolicy.java
deleted file mode 100644
index 5bef8911826..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ConstraintItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,154 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeploymentCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class ConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ConstraintItemSemanticEditPolicy() {
- super(UMLElementTypes.Constraint_2005);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DependencyItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DependencyItemSemanticEditPolicy.java
deleted file mode 100644
index 3643fccb5d0..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DependencyItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,156 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.DeleteCommand;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.common.command.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeploymentCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class DependencyItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public DependencyItemSemanticEditPolicy() {
- super(UMLElementTypes.Dependency_4004);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new DeleteCommand(getEditingDomain(), todestroy)));
- return getGEFWrapper(cmd.reduce());
- //return getGEFWrapper(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeploymentDiagramItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeploymentDiagramItemSemanticEditPolicy.java
deleted file mode 100644
index 357c7dc0507..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeploymentDiagramItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.papyrus.diagram.common.commands.DuplicateNamedElementCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ArtifactCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeviceCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ExecutionEnvironmentCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.NodeCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class DeploymentDiagramItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public DeploymentDiagramItemSemanticEditPolicy() {
- super(UMLElementTypes.Model_1000);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Comment_2001 == req.getElementType()) {
- return getGEFWrapper(new CommentCreateCommand(req));
- }
- if(UMLElementTypes.Constraint_2005 == req.getElementType()) {
- return getGEFWrapper(new ConstraintCreateCommand(req));
- }
- if(UMLElementTypes.ExecutionEnvironment_2002 == req.getElementType()) {
- return getGEFWrapper(new ExecutionEnvironmentCreateCommand(req));
- }
- if(UMLElementTypes.Device_2003 == req.getElementType()) {
- return getGEFWrapper(new DeviceCreateCommand(req));
- }
- if(UMLElementTypes.Artifact_2006 == req.getElementType()) {
- return getGEFWrapper(new ArtifactCreateCommand(req));
- }
- if(UMLElementTypes.Node_2008 == req.getElementType()) {
- return getGEFWrapper(new NodeCreateCommand(req));
- }
- return super.getCreateCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getDuplicateCommand(DuplicateElementsRequest req) {
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- Diagram currentDiagram = null;
- if(getHost() instanceof IGraphicalEditPart) {
- currentDiagram = ((IGraphicalEditPart)getHost()).getNotationView().getDiagram();
- }
- return getGEFWrapper(new DuplicateAnythingCommand(editingDomain, req, currentDiagram));
- }
-
- /**
- * @generated
- */
- private static class DuplicateAnythingCommand extends DuplicateNamedElementCommand {
-
- /**
- * @generated
- */
- private Diagram diagram;
-
- /**
- * @generated
- */
- public DuplicateAnythingCommand(TransactionalEditingDomain editingDomain, DuplicateElementsRequest req, Diagram currentDiagram) {
- super(editingDomain, req.getLabel(), req.getElementsToBeDuplicated(), req.getAllDuplicatedElementsMap(), currentDiagram);
- this.diagram = currentDiagram;
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeploymentItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeploymentItemSemanticEditPolicy.java
deleted file mode 100644
index 86e2084a8d9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeploymentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,156 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.DeleteCommand;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.common.command.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeploymentCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class DeploymentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public DeploymentItemSemanticEditPolicy() {
- super(UMLElementTypes.Deployment_4001);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new DeleteCommand(getEditingDomain(), todestroy)));
- return getGEFWrapper(cmd.reduce());
- //return getGEFWrapper(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentCanonicalEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentCanonicalEditPolicy.java
deleted file mode 100644
index 039f4f93703..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentCanonicalEditPolicy.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.deployment.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class DeviceCompositeCompartmentCanonicalEditPolicy extends CanonicalEditPolicy {
-
-
- /**
- * @generated
- */
- protected EStructuralFeature getFeatureToSynchronize() {
- return UMLPackage.eINSTANCE.getNode_NestedNode();
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getDeviceDeviceCompositeCompartment_17SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- return ExecutionEnvironmentEditPartCN.VISUAL_ID == UMLVisualIDRegistry.getVisualID(view);
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getDeviceDeviceCompositeCompartment_17SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentCanonicalEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentCanonicalEditPolicyCN.java
deleted file mode 100644
index b3c315a62da..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentCanonicalEditPolicyCN.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.deployment.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class DeviceCompositeCompartmentCanonicalEditPolicyCN extends CanonicalEditPolicy {
-
-
- /**
- * @generated
- */
- protected EStructuralFeature getFeatureToSynchronize() {
- return UMLPackage.eINSTANCE.getNode_NestedNode();
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getDeviceDeviceCompositeCompartment_30SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- return ExecutionEnvironmentEditPartCN.VISUAL_ID == UMLVisualIDRegistry.getVisualID(view);
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getDeviceDeviceCompositeCompartment_30SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentItemSemanticEditPolicy.java
deleted file mode 100644
index c1feea7f8a9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ExecutionEnvironmentCreateCommandCN;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class DeviceCompositeCompartmentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public DeviceCompositeCompartmentItemSemanticEditPolicy() {
- super(UMLElementTypes.Device_2003);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.ExecutionEnvironment_21 == req.getElementType()) {
- return getGEFWrapper(new ExecutionEnvironmentCreateCommandCN(req));
- }
- return super.getCreateCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentItemSemanticEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentItemSemanticEditPolicyCN.java
deleted file mode 100644
index b5d024c14cd..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceCompositeCompartmentItemSemanticEditPolicyCN.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ExecutionEnvironmentCreateCommandCN;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class DeviceCompositeCompartmentItemSemanticEditPolicyCN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public DeviceCompositeCompartmentItemSemanticEditPolicyCN() {
- super(UMLElementTypes.Device_16);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.ExecutionEnvironment_21 == req.getElementType()) {
- return getGEFWrapper(new ExecutionEnvironmentCreateCommandCN(req));
- }
- return super.getCreateCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceItemSemanticEditPolicy.java
deleted file mode 100644
index a1fbec2bf48..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,163 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeploymentCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.GeneralizationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class DeviceItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public DeviceItemSemanticEditPolicy() {
- super(UMLElementTypes.Device_2003);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceItemSemanticEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceItemSemanticEditPolicyCN.java
deleted file mode 100644
index 12ab908de11..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/DeviceItemSemanticEditPolicyCN.java
+++ /dev/null
@@ -1,246 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.DeleteCommand;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.command.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeploymentCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.GeneralizationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class DeviceItemSemanticEditPolicyCN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public DeviceItemSemanticEditPolicyCN() {
- super(UMLElementTypes.Device_16);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
-
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if(annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyChildNodesCommand(cmd);
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new DeleteCommand(getEditingDomain(), todestroy)));
- } else {
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * @generated
- */
- protected void addDestroyChildNodesCommand(ICompositeCommand cmd) {
- View view = (View)getHost().getModel();
- for(Iterator<?> nit = view.getChildren().iterator(); nit.hasNext();) {
- Node node = (Node)nit.next();
- switch(UMLVisualIDRegistry.getVisualID(node)) {
- case DeviceCompositeCompartmentEditPartCN.VISUAL_ID:
- for(Iterator<?> cit = node.getChildren().iterator(); cit.hasNext();) {
- Node cnode = (Node)cit.next();
- switch(UMLVisualIDRegistry.getVisualID(cnode)) {
- case ExecutionEnvironmentEditPartCN.VISUAL_ID:
-
-
- for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
- Edge incomingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
- cmd.add(new DestroyReferenceCommand(destroyRefReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(incomingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- }
- }
-
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
- cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
- // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
- // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
- break;
- }
- }
- break;
- }
- }
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentCanonicalEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentCanonicalEditPolicy.java
deleted file mode 100644
index ec0515e9671..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentCanonicalEditPolicy.java
+++ /dev/null
@@ -1,160 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.deployment.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentCompositeCompartmentCanonicalEditPolicy extends CanonicalEditPolicy {
-
- /**
- * @generated
- */
- private Set<EStructuralFeature> myFeaturesToSynchronize;
-
-
- /**
- * @generated
- */
- protected Set getFeaturesToSynchronize() {
- if(myFeaturesToSynchronize == null) {
- myFeaturesToSynchronize = new HashSet<EStructuralFeature>();
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getNode_NestedNode());
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getClass_NestedClassifier());
- }
- return myFeaturesToSynchronize;
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getExecutionEnvironmentExecutionEnvironmentCompositeCompartment_18SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- int visualID = UMLVisualIDRegistry.getVisualID(view);
- return visualID == ExecutionEnvironmentEditPartCN.VISUAL_ID || visualID == ArtifactEditPartCN.VISUAL_ID;
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getExecutionEnvironmentExecutionEnvironmentCompositeCompartment_18SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentCanonicalEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentCanonicalEditPolicyCN.java
deleted file mode 100644
index 14ff9503cf4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentCanonicalEditPolicyCN.java
+++ /dev/null
@@ -1,160 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.deployment.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentCompositeCompartmentCanonicalEditPolicyCN extends CanonicalEditPolicy {
-
- /**
- * @generated
- */
- private Set<EStructuralFeature> myFeaturesToSynchronize;
-
-
- /**
- * @generated
- */
- protected Set getFeaturesToSynchronize() {
- if(myFeaturesToSynchronize == null) {
- myFeaturesToSynchronize = new HashSet<EStructuralFeature>();
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getClass_NestedClassifier());
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getNode_NestedNode());
- }
- return myFeaturesToSynchronize;
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getExecutionEnvironmentExecutionEnvironmentCompositeCompartment_31SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- int visualID = UMLVisualIDRegistry.getVisualID(view);
- return visualID == ArtifactEditPartCN.VISUAL_ID || visualID == ExecutionEnvironmentEditPartCN.VISUAL_ID;
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getExecutionEnvironmentExecutionEnvironmentCompositeCompartment_31SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicy.java
deleted file mode 100644
index 073c1c14d16..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ArtifactCreateCommandCN;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ExecutionEnvironmentCreateCommandCN;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicy() {
- super(UMLElementTypes.ExecutionEnvironment_2002);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.ExecutionEnvironment_21 == req.getElementType()) {
- return getGEFWrapper(new ExecutionEnvironmentCreateCommandCN(req));
- }
- if(UMLElementTypes.Artifact_25 == req.getElementType()) {
- return getGEFWrapper(new ArtifactCreateCommandCN(req));
- }
- return super.getCreateCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicyCN.java
deleted file mode 100644
index d89b70bb797..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicyCN.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ArtifactCreateCommandCN;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ExecutionEnvironmentCreateCommandCN;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicyCN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ExecutionEnvironmentCompositeCompartmentItemSemanticEditPolicyCN() {
- super(UMLElementTypes.ExecutionEnvironment_21);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Artifact_25 == req.getElementType()) {
- return getGEFWrapper(new ArtifactCreateCommandCN(req));
- }
- if(UMLElementTypes.ExecutionEnvironment_21 == req.getElementType()) {
- return getGEFWrapper(new ExecutionEnvironmentCreateCommandCN(req));
- }
- return super.getCreateCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentItemSemanticEditPolicy.java
deleted file mode 100644
index 3565b8cea19..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,163 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeploymentCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.GeneralizationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ExecutionEnvironmentItemSemanticEditPolicy() {
- super(UMLElementTypes.ExecutionEnvironment_2002);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentItemSemanticEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentItemSemanticEditPolicyCN.java
deleted file mode 100644
index 4192e9bb33a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ExecutionEnvironmentItemSemanticEditPolicyCN.java
+++ /dev/null
@@ -1,287 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.DeleteCommand;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.command.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeploymentCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.GeneralizationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentItemSemanticEditPolicyCN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ExecutionEnvironmentItemSemanticEditPolicyCN() {
- super(UMLElementTypes.ExecutionEnvironment_21);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
-
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if(annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyChildNodesCommand(cmd);
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new DeleteCommand(getEditingDomain(), todestroy)));
- } else {
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * @generated
- */
- protected void addDestroyChildNodesCommand(ICompositeCommand cmd) {
- View view = (View)getHost().getModel();
- for(Iterator<?> nit = view.getChildren().iterator(); nit.hasNext();) {
- Node node = (Node)nit.next();
- switch(UMLVisualIDRegistry.getVisualID(node)) {
- case ExecutionEnvironmentCompositeCompartmentEditPartCN.VISUAL_ID:
- for(Iterator<?> cit = node.getChildren().iterator(); cit.hasNext();) {
- Node cnode = (Node)cit.next();
- switch(UMLVisualIDRegistry.getVisualID(cnode)) {
- case ArtifactEditPartCN.VISUAL_ID:
-
-
- for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
- Edge incomingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
- cmd.add(new DestroyReferenceCommand(destroyRefReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(incomingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- }
- }
-
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
- cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
- // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
- // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
- break;
- case ExecutionEnvironmentEditPartCN.VISUAL_ID:
-
-
- for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
- Edge incomingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
- cmd.add(new DestroyReferenceCommand(destroyRefReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(incomingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- }
- }
-
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
- cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
- // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
- // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
- break;
- }
- }
- break;
- }
- }
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/GeneralizationItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/GeneralizationItemSemanticEditPolicy.java
deleted file mode 100644
index 0e3d918719a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/GeneralizationItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.DeleteCommand;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.papyrus.diagram.common.command.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class GeneralizationItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public GeneralizationItemSemanticEditPolicy() {
- super(UMLElementTypes.Generalization_4003);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new DeleteCommand(getEditingDomain(), todestroy)));
- return getGEFWrapper(cmd.reduce());
- //return getGEFWrapper(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ManifestationItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ManifestationItemSemanticEditPolicy.java
deleted file mode 100644
index 9256015b312..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ManifestationItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,156 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.DeleteCommand;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.common.command.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeploymentCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class ManifestationItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ManifestationItemSemanticEditPolicy() {
- super(UMLElementTypes.Manifestation_4002);
- }
-
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new DeleteCommand(getEditingDomain(), todestroy)));
- return getGEFWrapper(cmd.reduce());
- //return getGEFWrapper(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ModelCanonicalEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ModelCanonicalEditPolicy.java
deleted file mode 100644
index c0178eabe07..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/ModelCanonicalEditPolicy.java
+++ /dev/null
@@ -1,461 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.LinkDescriptorEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.deployment.part.UMLLinkDescriptor;
-import org.eclipse.papyrus.diagram.deployment.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ModelCanonicalEditPolicy extends CanonicalEditPolicy {
-
-
-
- /**
- * @generated
- */
- private Set<EStructuralFeature> myFeaturesToSynchronize;
-
-
- /**
- * @generated
- */
- protected Set getFeaturesToSynchronize() {
- if(myFeaturesToSynchronize == null) {
- myFeaturesToSynchronize = new HashSet<EStructuralFeature>();
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getElement_OwnedComment());
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getNamespace_OwnedRule());
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getPackage_PackagedElement());
- }
- return myFeaturesToSynchronize;
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getModel_1000SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- int visualID = UMLVisualIDRegistry.getVisualID(view);
- switch(visualID) {
- case CommentEditPart.VISUAL_ID:
- case ConstraintEditPart.VISUAL_ID:
- case ExecutionEnvironmentEditPart.VISUAL_ID:
- case DeviceEditPart.VISUAL_ID:
- case ArtifactEditPart.VISUAL_ID:
- case NodeEditPart.VISUAL_ID:
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getModel_1000SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
-
- Collection<IAdaptable> createdConnectionViews = refreshConnections();
-
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- createdViews.addAll(createdConnectionViews);
-
- makeViewsImmutable(createdViews);
- }
-
- /**
- * @generated
- */
- private Collection<IAdaptable> refreshConnections() {
- Map<EObject, View> domain2NotationMap = new HashMap<EObject, View>();
- Collection<UMLLinkDescriptor> linkDescriptors = collectAllLinks(getDiagram(), domain2NotationMap);
- Collection existingLinks = new LinkedList(getDiagram().getEdges());
- for(Iterator linksIterator = existingLinks.iterator(); linksIterator.hasNext();) {
- Edge nextDiagramLink = (Edge)linksIterator.next();
- int diagramLinkVisualID = UMLVisualIDRegistry.getVisualID(nextDiagramLink);
- if(diagramLinkVisualID == -1 || diagramLinkVisualID == LinkDescriptorEditPart.VISUAL_ID) {
- if(nextDiagramLink.getSource() != null && nextDiagramLink.getTarget() != null) {
- linksIterator.remove();
- }
- continue;
- }
- EObject diagramLinkObject = nextDiagramLink.getElement();
- EObject diagramLinkSrc = nextDiagramLink.getSource().getElement();
- EObject diagramLinkDst = nextDiagramLink.getTarget().getElement();
- for(Iterator<UMLLinkDescriptor> linkDescriptorsIterator = linkDescriptors.iterator(); linkDescriptorsIterator.hasNext();) {
- UMLLinkDescriptor nextLinkDescriptor = linkDescriptorsIterator.next();
- if(diagramLinkObject == nextLinkDescriptor.getModelElement() && diagramLinkSrc == nextLinkDescriptor.getSource() && diagramLinkDst == nextLinkDescriptor.getDestination() && diagramLinkVisualID == nextLinkDescriptor.getVisualID()) {
- linksIterator.remove();
- linkDescriptorsIterator.remove();
- break;
- }
- }
- }
- deleteViews(existingLinks.iterator());
- return createConnections(linkDescriptors, domain2NotationMap);
- }
-
- /**
- * @generated
- */
- private Collection<UMLLinkDescriptor> collectAllLinks(View view, Map<EObject, View> domain2NotationMap) {
- if(!DeploymentDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view))) {
- return Collections.emptyList();
- }
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- switch(UMLVisualIDRegistry.getVisualID(view)) {
- case DeploymentDiagramEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getModel_1000ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case CommentEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getComment_2001ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ConstraintEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getConstraint_2005ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ExecutionEnvironmentEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getExecutionEnvironment_2002ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case DeviceEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getDevice_2003ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ArtifactEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getArtifact_2006ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case NodeEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getNode_2008ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case NodeEditPartCN.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getNode_23ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case DeviceEditPartCN.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getDevice_16ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ExecutionEnvironmentEditPartCN.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getExecutionEnvironment_21ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ArtifactEditPartCN.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getArtifact_25ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ArtifactEditPartACN.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getArtifact_28ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case DeploymentEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getDeployment_4001ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ManifestationEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getManifestation_4002ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case GeneralizationEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getGeneralization_4003ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case DependencyEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(UMLDiagramUpdater.getDependency_4004ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- }
- for(Iterator children = view.getChildren().iterator(); children.hasNext();) {
- result.addAll(collectAllLinks((View)children.next(), domain2NotationMap));
- }
- for(Iterator edges = view.getSourceEdges().iterator(); edges.hasNext();) {
- result.addAll(collectAllLinks((View)edges.next(), domain2NotationMap));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private Collection<IAdaptable> createConnections(Collection<UMLLinkDescriptor> linkDescriptors, Map<EObject, View> domain2NotationMap) {
- LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
- for(UMLLinkDescriptor nextLinkDescriptor : linkDescriptors) {
- EditPart sourceEditPart = getEditPart(nextLinkDescriptor.getSource(), domain2NotationMap);
- EditPart targetEditPart = getEditPart(nextLinkDescriptor.getDestination(), domain2NotationMap);
- if(sourceEditPart == null || targetEditPart == null) {
- continue;
- }
- CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(nextLinkDescriptor.getSemanticAdapter(), UMLVisualIDRegistry.getType(nextLinkDescriptor.getVisualID()), ViewUtil.APPEND, false, ((IGraphicalEditPart)getHost()).getDiagramPreferencesHint());
- CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(descriptor);
- ccr.setType(RequestConstants.REQ_CONNECTION_START);
- ccr.setSourceEditPart(sourceEditPart);
- sourceEditPart.getCommand(ccr);
- ccr.setTargetEditPart(targetEditPart);
- ccr.setType(RequestConstants.REQ_CONNECTION_END);
- Command cmd = targetEditPart.getCommand(ccr);
- if(cmd != null && cmd.canExecute()) {
- executeCommand(cmd);
- IAdaptable viewAdapter = (IAdaptable)ccr.getNewObject();
- if(viewAdapter != null) {
- adapters.add(viewAdapter);
- }
- }
- }
- return adapters;
- }
-
- /**
- * @generated
- */
- private EditPart getEditPart(EObject domainModelElement, Map<EObject, View> domain2NotationMap) {
- View view = (View)domain2NotationMap.get(domainModelElement);
- if(view != null) {
- return (EditPart)getHost().getViewer().getEditPartRegistry().get(view);
- }
- return null;
- }
-
- /**
- * @generated
- */
- private Diagram getDiagram() {
- return ((View)getHost().getModel()).getDiagram();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentCanonicalEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentCanonicalEditPolicy.java
deleted file mode 100644
index 60febf812b6..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentCanonicalEditPolicy.java
+++ /dev/null
@@ -1,169 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.deployment.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class NodeCompositeCompartmentCanonicalEditPolicy extends CanonicalEditPolicy {
-
- /**
- * @generated
- */
- private Set<EStructuralFeature> myFeaturesToSynchronize;
-
-
- /**
- * @generated
- */
- protected Set getFeaturesToSynchronize() {
- if(myFeaturesToSynchronize == null) {
- myFeaturesToSynchronize = new HashSet<EStructuralFeature>();
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getNode_NestedNode());
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getClass_NestedClassifier());
- }
- return myFeaturesToSynchronize;
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getNodeCompositeCompartment_19SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- int visualID = UMLVisualIDRegistry.getVisualID(view);
- switch(visualID) {
- case DeviceEditPartCN.VISUAL_ID:
- case ExecutionEnvironmentEditPartCN.VISUAL_ID:
- case ArtifactEditPartCN.VISUAL_ID:
- case NodeEditPartCN.VISUAL_ID:
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getNodeCompositeCompartment_19SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentCanonicalEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentCanonicalEditPolicyCN.java
deleted file mode 100644
index 79f8b08945a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentCanonicalEditPolicyCN.java
+++ /dev/null
@@ -1,169 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramUpdater;
-import org.eclipse.papyrus.diagram.deployment.part.UMLNodeDescriptor;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class NodeCompositeCompartmentCanonicalEditPolicyCN extends CanonicalEditPolicy {
-
- /**
- * @generated
- */
- private Set<EStructuralFeature> myFeaturesToSynchronize;
-
-
- /**
- * @generated
- */
- protected Set getFeaturesToSynchronize() {
- if(myFeaturesToSynchronize == null) {
- myFeaturesToSynchronize = new HashSet<EStructuralFeature>();
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getNode_NestedNode());
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getClass_NestedClassifier());
- }
- return myFeaturesToSynchronize;
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getNodeCompositeCompartment_32SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- int visualID = UMLVisualIDRegistry.getVisualID(view);
- switch(visualID) {
- case DeviceEditPartCN.VISUAL_ID:
- case ExecutionEnvironmentEditPartCN.VISUAL_ID:
- case NodeEditPartCN.VISUAL_ID:
- case ArtifactEditPartCN.VISUAL_ID:
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getNodeCompositeCompartment_32SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- UMLNodeDescriptor next = descriptorsIterator.next();
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
- String hint = UMLVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentItemSemanticEditPolicy.java
deleted file mode 100644
index f6a642cbc18..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ArtifactCreateCommandCN;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeviceCreateCommandCN;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ExecutionEnvironmentCreateCommandCN;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.NodeCreateCommandCN;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class NodeCompositeCompartmentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public NodeCompositeCompartmentItemSemanticEditPolicy() {
- super(UMLElementTypes.Node_2008);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Device_16 == req.getElementType()) {
- return getGEFWrapper(new DeviceCreateCommandCN(req));
- }
- if(UMLElementTypes.ExecutionEnvironment_21 == req.getElementType()) {
- return getGEFWrapper(new ExecutionEnvironmentCreateCommandCN(req));
- }
- if(UMLElementTypes.Artifact_25 == req.getElementType()) {
- return getGEFWrapper(new ArtifactCreateCommandCN(req));
- }
- if(UMLElementTypes.Node_23 == req.getElementType()) {
- return getGEFWrapper(new NodeCreateCommandCN(req));
- }
- return super.getCreateCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentItemSemanticEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentItemSemanticEditPolicyCN.java
deleted file mode 100644
index c2e59f44b7e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeCompositeCompartmentItemSemanticEditPolicyCN.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ArtifactCreateCommandCN;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeviceCreateCommandCN;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ExecutionEnvironmentCreateCommandCN;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.NodeCreateCommandCN;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class NodeCompositeCompartmentItemSemanticEditPolicyCN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public NodeCompositeCompartmentItemSemanticEditPolicyCN() {
- super(UMLElementTypes.Node_23);
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Device_16 == req.getElementType()) {
- return getGEFWrapper(new DeviceCreateCommandCN(req));
- }
- if(UMLElementTypes.ExecutionEnvironment_21 == req.getElementType()) {
- return getGEFWrapper(new ExecutionEnvironmentCreateCommandCN(req));
- }
- if(UMLElementTypes.Node_23 == req.getElementType()) {
- return getGEFWrapper(new NodeCreateCommandCN(req));
- }
- if(UMLElementTypes.Artifact_25 == req.getElementType()) {
- return getGEFWrapper(new ArtifactCreateCommandCN(req));
- }
- return super.getCreateCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeItemSemanticEditPolicy.java
deleted file mode 100644
index 31d99d84bc4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,163 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeploymentCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.GeneralizationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class NodeItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public NodeItemSemanticEditPolicy() {
- super(UMLElementTypes.Node_2008);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeItemSemanticEditPolicyCN.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeItemSemanticEditPolicyCN.java
deleted file mode 100644
index 0c3e81c0105..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/NodeItemSemanticEditPolicyCN.java
+++ /dev/null
@@ -1,369 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.DeleteCommand;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.command.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.CommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DependencyCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.DeploymentCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.GeneralizationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.commands.ManifestationCreateCommand;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.service.edit.service.IElementEditService;
-
-/**
- * @generated
- */
-public class NodeItemSemanticEditPolicyCN extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public NodeItemSemanticEditPolicyCN() {
- super(UMLElementTypes.Node_23);
- }
-
-
-
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
-
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if(annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyChildNodesCommand(cmd);
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new DeleteCommand(getEditingDomain(), todestroy)));
- } else {
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * @generated
- */
- protected void addDestroyChildNodesCommand(ICompositeCommand cmd) {
- View view = (View)getHost().getModel();
- for(Iterator<?> nit = view.getChildren().iterator(); nit.hasNext();) {
- Node node = (Node)nit.next();
- switch(UMLVisualIDRegistry.getVisualID(node)) {
- case NodeCompositeCompartmentEditPartCN.VISUAL_ID:
- for(Iterator<?> cit = node.getChildren().iterator(); cit.hasNext();) {
- Node cnode = (Node)cit.next();
- switch(UMLVisualIDRegistry.getVisualID(cnode)) {
- case DeviceEditPartCN.VISUAL_ID:
-
-
- for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
- Edge incomingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
- cmd.add(new DestroyReferenceCommand(destroyRefReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(incomingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- }
- }
-
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
- cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
- // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
- // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
- break;
- case ExecutionEnvironmentEditPartCN.VISUAL_ID:
-
-
- for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
- Edge incomingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
- cmd.add(new DestroyReferenceCommand(destroyRefReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(incomingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- }
- }
-
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
- cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
- // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
- // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
- break;
- case NodeEditPartCN.VISUAL_ID:
-
-
- for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
- Edge incomingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
- cmd.add(new DestroyReferenceCommand(destroyRefReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(incomingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- }
- }
-
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
- cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
- // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
- // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
- break;
- case ArtifactEditPartCN.VISUAL_ID:
-
-
- for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
- Edge incomingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
- cmd.add(new DestroyReferenceCommand(destroyRefReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(incomingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
- }
- }
-
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
- cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
- // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
- // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
- break;
- }
- }
- break;
- }
- }
- }
-
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return null;
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.CommentAnnotatedElement_4008 == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.ConstraintConstrainedElement_4009 == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Deployment_4001 == req.getElementType()) {
- return getGEFWrapper(new DeploymentCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Manifestation_4002 == req.getElementType()) {
- return getGEFWrapper(new ManifestationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Generalization_4003 == req.getElementType()) {
- return getGEFWrapper(new GeneralizationCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if(UMLElementTypes.Dependency_4004 == req.getElementType()) {
- return getGEFWrapper(new DependencyCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
- case DeploymentEditPart.VISUAL_ID:
- case ManifestationEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/UMLBaseItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/UMLBaseItemSemanticEditPolicy.java
deleted file mode 100644
index 8d8b423a7e7..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/UMLBaseItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,451 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.MoveElementsCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.helper.UMLBaseEditHelper;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.uml2.uml.Artifact;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.Deployment;
-import org.eclipse.uml2.uml.DeploymentTarget;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Generalization;
-import org.eclipse.uml2.uml.Manifestation;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-
-/**
- * @generated
- */
-public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
-
- /**
- * Extended request data key to hold editpart visual id.
- * @generated
- */
- public static final String VISUAL_ID_KEY = "visual_id"; //$NON-NLS-1$
-
- /**
- * Extended request data key to hold the edge view during a reconnect request.
- * @generated
- */
- public static final String GRAPHICAL_RECONNECTED_EDGE = "graphical_edge"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final IElementType myElementType;
-
- /**
- * @generated
- */
- protected UMLBaseItemSemanticEditPolicy(IElementType elementType) {
- myElementType = elementType;
- }
-
- /**
- * Extended request data key to hold editpart visual id.
- * Add visual id of edited editpart to extended data of the request
- * so command switch can decide what kind of diagram element is being edited.
- * It is done in those cases when it's not possible to deduce diagram
- * element kind from domain element.
- * Add the reoriented view to the request extended data so that the view
- * currently edited can be distinguished from other views of the same element
- * and these latter possibly removed if they become inconsistent after reconnect
- *
- * @generated
- */
- @SuppressWarnings("unchecked")
- public Command getCommand(Request request) {
- if(request instanceof ReconnectRequest) {
- Object view = ((ReconnectRequest)request).getConnectionEditPart().getModel();
- if(view instanceof View) {
- Integer id = new Integer(UMLVisualIDRegistry.getVisualID((View)view));
- request.getExtendedData().put(VISUAL_ID_KEY, id);
- request.getExtendedData().put(GRAPHICAL_RECONNECTED_EDGE, (View)view);
- }
- }
- return super.getCommand(request);
- }
-
- /**
- * Returns visual id from request parameters.
- * @generated
- */
- protected int getVisualID(IEditCommandRequest request) {
- Object id = request.getParameter(VISUAL_ID_KEY);
- return id instanceof Integer ? ((Integer)id).intValue() : -1;
- }
-
- /**
- * @generated
- */
- protected Command getSemanticCommand(IEditCommandRequest request) {
- IEditCommandRequest completedRequest = completeRequest(request);
- Command semanticCommand = getSemanticCommandSwitch(completedRequest);
- semanticCommand = getEditHelperCommand(completedRequest, semanticCommand);
- if(completedRequest instanceof DestroyRequest) {
- DestroyRequest destroyRequest = (DestroyRequest)completedRequest;
- return shouldProceed(destroyRequest) ? addDeleteViewCommand(semanticCommand, destroyRequest) : null;
- }
- return semanticCommand;
- }
-
- /**
- * @generated
- */
- protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View)getHost().getModel()));
- return mainCommand == null ? deleteViewCommand : mainCommand.chain(deleteViewCommand);
- }
-
- /**
- * @generated
- */
- private Command getEditHelperCommand(IEditCommandRequest request, Command editPolicyCommand) {
- if(editPolicyCommand != null) {
- ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy)editPolicyCommand).getICommand() : new CommandProxy(editPolicyCommand);
- request.setParameter(UMLBaseEditHelper.EDIT_POLICY_COMMAND, command);
- }
- IElementType requestContextElementType = getContextElementType(request);
- request.setParameter(UMLBaseEditHelper.CONTEXT_ELEMENT_TYPE, requestContextElementType);
- ICommand command = requestContextElementType.getEditCommand(request);
- request.setParameter(UMLBaseEditHelper.EDIT_POLICY_COMMAND, null);
- request.setParameter(UMLBaseEditHelper.CONTEXT_ELEMENT_TYPE, null);
- if(command != null) {
- if(!(command instanceof CompositeTransactionalCommand)) {
- command = new CompositeTransactionalCommand(getEditingDomain(), command.getLabel()).compose(command);
- }
- return new ICommandProxy(command);
- }
- return editPolicyCommand;
- }
-
- /**
- * @generated
- */
- protected IElementType getContextElementType(IEditCommandRequest request) {
- IElementType requestContextElementType = UMLElementTypes.getElementType(getVisualID(request));
- return requestContextElementType != null ? requestContextElementType : myElementType;
- }
-
- /**
- * @generated
- */
- protected Command getSemanticCommandSwitch(IEditCommandRequest req) {
- if(req instanceof CreateRelationshipRequest) {
- return getCreateRelationshipCommand((CreateRelationshipRequest)req);
- } else if(req instanceof CreateElementRequest) {
- return getCreateCommand((CreateElementRequest)req);
- } else if(req instanceof ConfigureRequest) {
- return getConfigureCommand((ConfigureRequest)req);
- } else if(req instanceof DestroyElementRequest) {
- return getDestroyElementCommand((DestroyElementRequest)req);
- } else if(req instanceof DestroyReferenceRequest) {
- return getDestroyReferenceCommand((DestroyReferenceRequest)req);
- } else if(req instanceof DuplicateElementsRequest) {
- return getDuplicateCommand((DuplicateElementsRequest)req);
- } else if(req instanceof GetEditContextRequest) {
- return getEditContextCommand((GetEditContextRequest)req);
- } else if(req instanceof MoveRequest) {
- return getMoveCommand((MoveRequest)req);
- } else if(req instanceof ReorientReferenceRelationshipRequest) {
- return getReorientReferenceRelationshipCommand((ReorientReferenceRelationshipRequest)req);
- } else if(req instanceof ReorientRelationshipRequest) {
- return getReorientRelationshipCommand((ReorientRelationshipRequest)req);
- } else if(req instanceof SetRequest) {
- return getSetCommand((SetRequest)req);
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getConfigureCommand(ConfigureRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getSetCommand(SetRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getEditContextCommand(GetEditContextRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getDuplicateCommand(DuplicateElementsRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getMoveCommand(MoveRequest req) {
-
-
- return getGEFWrapper(new MoveElementsCommand(req));
-
-
- }
-
- /**
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected final Command getGEFWrapper(ICommand cmd) {
- return new ICommandProxy(cmd);
- }
-
- /**
- * Returns editing domain from the host edit part.
- * @generated
- */
- protected TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
- }
-
- /**
- * Clean all shortcuts to the host element from the same diagram
- * @generated
- */
- protected void addDestroyShortcutsCommand(ICompositeCommand cmd, View view) {
- assert view.getEAnnotation("Shortcut") == null; //$NON-NLS-1$
- for(Iterator it = view.getDiagram().getChildren().iterator(); it.hasNext();) {
- View nextView = (View)it.next();
- if(nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { //$NON-NLS-1$
- continue;
- }
- cmd.add(new DeleteCommand(getEditingDomain(), nextView));
- }
- }
-
-
- /**
- * @generated
- */
- public static LinkConstraints getLinkConstraints() {
- LinkConstraints cached = UMLDiagramEditorPlugin.getInstance().getLinkConstraints();
- if(cached == null) {
- UMLDiagramEditorPlugin.getInstance().setLinkConstraints(cached = new LinkConstraints());
- }
- return cached;
- }
-
-
- /**
- * @generated
- */
- public static class LinkConstraints {
-
- /**
- * @generated
- */
- public LinkConstraints() {
- // use static method #getLinkConstraints() to access instance
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateLink_4005() {
- return canExistLink_4005();
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateCommentAnnotatedElement_4008(Comment source, Element target) {
- if(source != null) {
- if(source.getAnnotatedElements().contains(target)) {
- return false;
- }
- }
-
- return canExistCommentAnnotatedElement_4008(source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateConstraintConstrainedElement_4009(Constraint source, Element target) {
- if(source != null) {
- if(source.getConstrainedElements().contains(target)) {
- return false;
- }
- }
-
- return canExistConstraintConstrainedElement_4009(source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateDeployment_4001(DeploymentTarget container, NamedElement source, NamedElement target) {
- return canExistDeployment_4001(container, null, source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateManifestation_4002(Artifact container, NamedElement source, NamedElement target) {
- return canExistManifestation_4002(container, null, source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateGeneralization_4003(Classifier container, Classifier source, Classifier target) {
- return canExistGeneralization_4003(container, null, source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canCreateDependency_4004(Package container, NamedElement source, NamedElement target) {
- return canExistDependency_4004(container, null, source, target);
- }
-
-
- /**
- * @generated
- */
- public boolean canExistLink_4005() {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistCommentAnnotatedElement_4008(Comment source, Element target) {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistConstraintConstrainedElement_4009(Constraint source, Element target) {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistDeployment_4001(DeploymentTarget container, Deployment linkInstance, NamedElement source, NamedElement target) {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistManifestation_4002(Artifact container, Manifestation linkInstance, NamedElement source, NamedElement target) {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistGeneralization_4003(Classifier container, Generalization linkInstance, Classifier source, Classifier target) {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistDependency_4004(Package container, Dependency linkInstance, NamedElement source, NamedElement target) {
- return true;
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/UMLTextNonResizableEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/UMLTextNonResizableEditPolicy.java
deleted file mode 100644
index f5e93ed461e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/UMLTextNonResizableEditPolicy.java
+++ /dev/null
@@ -1,224 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-
-/**
- * @generated
- */
-public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx {
-
-
- /**
- * @generated
- */
- private IFigure selectionFeedbackFigure;
-
- /**
- * @generated
- */
- private IFigure focusFeedbackFigure;
-
- /**
- * @generated
- */
- private FigureListener hostPositionListener;
-
- /**
- * @generated
- */
- protected void showPrimarySelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- showSelection();
- showFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- hideSelection();
- addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
- getHostFigure().addFigureListener(getHostPositionListener());
- refreshSelectionFeedback();
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void hideSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(false);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(selectionFeedbackFigure != null) {
- removeFeedback(selectionFeedbackFigure);
- getHostFigure().removeFigureListener(getHostPositionListener());
- selectionFeedbackFigure = null;
- }
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- hideFocus();
- addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
- refreshFocusFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void hideFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(focusFeedbackFigure != null) {
- removeFeedback(focusFeedbackFigure);
- focusFeedbackFigure = null;
- }
- }
- }
-
- /**
- * @generated
- */
- protected Rectangle getFeedbackBounds() {
- Rectangle bounds;
- if(getHostFigure() instanceof Label) {
- bounds = ((Label)getHostFigure()).getTextBounds();
- bounds.intersect(getHostFigure().getBounds());
- } else {
- bounds = getHostFigure().getBounds().getCopy();
- }
- getHostFigure().getParent().translateToAbsolute(bounds);
- getFeedbackLayer().translateToRelative(bounds);
- return bounds;
- }
-
- /**
- * @generated
- */
- protected IFigure createSelectionFeedbackFigure() {
- if(getHostFigure() instanceof Label) {
- Label feedbackFigure = new Label();
- feedbackFigure.setOpaque(true);
- feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
- feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
- return feedbackFigure;
- } else {
- RectangleFigure feedbackFigure = new RectangleFigure();
- feedbackFigure.setFill(false);
- return feedbackFigure;
- }
- }
-
- /**
- * @generated
- */
- protected IFigure createFocusFeedbackFigure() {
- return new Figure() {
-
- protected void paintFigure(Graphics graphics) {
- graphics.drawFocus(getBounds().getResized(-1, -1));
- }
- };
- }
-
- /**
- * @generated
- */
- protected void updateLabel(Label target) {
- Label source = (Label)getHostFigure();
- target.setText(source.getText());
- target.setTextAlignment(source.getTextAlignment());
- target.setFont(source.getFont());
- }
-
- /**
- * @generated
- */
- protected void refreshSelectionFeedback() {
- if(selectionFeedbackFigure != null) {
- if(selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)selectionFeedbackFigure);
- selectionFeedbackFigure.setBounds(getFeedbackBounds());
- } else {
- selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFocusFeedback() {
- if(focusFeedbackFigure != null) {
- focusFeedbackFigure.setBounds(getFeedbackBounds());
- }
- }
-
- /**
- * @generated
- */
- public void refreshFeedback() {
- refreshSelectionFeedback();
- refreshFocusFeedback();
- }
-
- /**
- * @generated
- */
- private FigureListener getHostPositionListener() {
- if(hostPositionListener == null) {
- hostPositionListener = new FigureListener() {
-
- public void figureMoved(IFigure source) {
- refreshFeedback();
- }
- };
- }
- return hostPositionListener;
- }
-
- /**
- * @generated
- */
- protected List createSelectionHandles() {
- MoveHandle moveHandle = new MoveHandle((GraphicalEditPart)getHost());
- moveHandle.setBorder(null);
- moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
- return Collections.singletonList(moveHandle);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/UMLTextSelectionEditPolicy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/UMLTextSelectionEditPolicy.java
deleted file mode 100644
index 38be92bf5f5..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/edit/policies/UMLTextSelectionEditPolicy.java
+++ /dev/null
@@ -1,208 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.edit.policies;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.editpolicies.SelectionEditPolicy;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-
-/**
- * @generated
- */
-public class UMLTextSelectionEditPolicy extends SelectionEditPolicy {
-
-
- /**
- * @generated
- */
- private IFigure selectionFeedbackFigure;
-
- /**
- * @generated
- */
- private IFigure focusFeedbackFigure;
-
- /**
- * @generated
- */
- private FigureListener hostPositionListener;
-
- /**
- * @generated
- */
- protected void showPrimarySelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- showSelection();
- showFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- hideSelection();
- addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
- getHostFigure().addFigureListener(getHostPositionListener());
- refreshSelectionFeedback();
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void hideSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(false);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(selectionFeedbackFigure != null) {
- removeFeedback(selectionFeedbackFigure);
- getHostFigure().removeFigureListener(getHostPositionListener());
- selectionFeedbackFigure = null;
- }
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- hideFocus();
- addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
- refreshFocusFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void hideFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(focusFeedbackFigure != null) {
- removeFeedback(focusFeedbackFigure);
- focusFeedbackFigure = null;
- }
- }
- }
-
- /**
- * @generated
- */
- protected Rectangle getFeedbackBounds() {
- Rectangle bounds;
- if(getHostFigure() instanceof Label) {
- bounds = ((Label)getHostFigure()).getTextBounds();
- bounds.intersect(getHostFigure().getBounds());
- } else {
- bounds = getHostFigure().getBounds().getCopy();
- }
- getHostFigure().getParent().translateToAbsolute(bounds);
- getFeedbackLayer().translateToRelative(bounds);
- return bounds;
- }
-
- /**
- * @generated
- */
- protected IFigure createSelectionFeedbackFigure() {
- if(getHostFigure() instanceof Label) {
- Label feedbackFigure = new Label();
- feedbackFigure.setOpaque(true);
- feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
- feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
- return feedbackFigure;
- } else {
- RectangleFigure feedbackFigure = new RectangleFigure();
- feedbackFigure.setFill(false);
- return feedbackFigure;
- }
- }
-
- /**
- * @generated
- */
- protected IFigure createFocusFeedbackFigure() {
- return new Figure() {
-
- protected void paintFigure(Graphics graphics) {
- graphics.drawFocus(getBounds().getResized(-1, -1));
- }
- };
- }
-
- /**
- * @generated
- */
- protected void updateLabel(Label target) {
- Label source = (Label)getHostFigure();
- target.setText(source.getText());
- target.setTextAlignment(source.getTextAlignment());
- target.setFont(source.getFont());
- }
-
- /**
- * @generated
- */
- protected void refreshSelectionFeedback() {
- if(selectionFeedbackFigure != null) {
- if(selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)selectionFeedbackFigure);
- selectionFeedbackFigure.setBounds(getFeedbackBounds());
- } else {
- selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFocusFeedback() {
- if(focusFeedbackFigure != null) {
- focusFeedbackFigure.setBounds(getFeedbackBounds());
- }
- }
-
- /**
- * @generated
- */
- public void refreshFeedback() {
- refreshSelectionFeedback();
- refreshFocusFeedback();
- }
-
- /**
- * @generated
- */
- private FigureListener getHostPositionListener() {
- if(hostPositionListener == null) {
- hostPositionListener = new FigureListener() {
-
- public void figureMoved(IFigure source) {
- refreshFeedback();
- }
- };
- }
- return hostPositionListener;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/expressions/UMLAbstractExpression.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/expressions/UMLAbstractExpression.java
deleted file mode 100644
index 0c0bcf82fec..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/expressions/UMLAbstractExpression.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.expressions;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Collections;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public abstract class UMLAbstractExpression {
-
- /**
- * @generated
- */
- private IStatus status = Status.OK_STATUS;
-
- /**
- * @generated
- */
- protected void setStatus(int severity, String message, Throwable throwable) {
- String pluginID = UMLDiagramEditorPlugin.ID;
- this.status = new Status(severity, pluginID, -1, (message != null) ? message : "", throwable); //$NON-NLS-1$
- if(!this.status.isOK()) {
- UMLDiagramEditorPlugin.getInstance().logError("Expression problem:" + message + "body:" + body(), throwable); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * @generated
- */
- public IStatus getStatus() {
- return status;
- }
-
- /**
- * @generated
- */
- private final String myBody;
-
- /**
- * @generated
- */
- public String body() {
- return myBody;
- }
-
- /**
- * @generated
- */
- private final EClassifier myContext;
-
- /**
- * @generated
- */
- public EClassifier context() {
- return myContext;
- }
-
-
- /**
- * @generated
- */
- protected UMLAbstractExpression(String body, EClassifier context) {
- myBody = body;
- myContext = context;
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected abstract Object doEvaluate(Object context, Map env);
-
- /**
- * @generated
- */
- public Object evaluate(Object context) {
- return evaluate(context, Collections.EMPTY_MAP);
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- public Object evaluate(Object context, Map env) {
- if(context().isInstance(context)) {
- try {
- return doEvaluate(context, env);
- } catch (Exception e) {
- UMLDiagramEditorPlugin.getInstance().logError("Expression evaluation failure: " + body(), e); //$NON-NLS-1$
- }
- }
- return null;
- }
-
- /**
- * Expression may return number value which is not directly compatible with feature type (e.g. Double when Integer is expected), or EEnumLiteral meta-object when literal instance is expected
- * @generated
- */
- public static Object performCast(Object value, EDataType targetType) {
- if(targetType instanceof EEnum) {
- if(value instanceof EEnumLiteral) {
- EEnumLiteral literal = (EEnumLiteral)value;
- return (literal.getInstance() != null) ? literal.getInstance() : literal;
- }
- }
- if(false == value instanceof Number || targetType == null || targetType.getInstanceClass() == null) {
- return value;
- }
- Class<?> targetClass = targetType.getInstanceClass();
- Number num = (Number)value;
- Class<?> valClass = value.getClass();
- Class<?> targetWrapperClass = targetClass;
- if(targetClass.isPrimitive()) {
- targetWrapperClass = EcoreUtil.wrapperClassFor(targetClass);
- }
- if(valClass.equals(targetWrapperClass)) {
- return value;
- }
- if(Number.class.isAssignableFrom(targetWrapperClass)) {
- if(targetWrapperClass.equals(Byte.class))
- return new Byte(num.byteValue());
- if(targetWrapperClass.equals(Integer.class))
- return new Integer(num.intValue());
- if(targetWrapperClass.equals(Short.class))
- return new Short(num.shortValue());
- if(targetWrapperClass.equals(Long.class))
- return new Long(num.longValue());
- if(targetWrapperClass.equals(BigInteger.class))
- return BigInteger.valueOf(num.longValue());
- if(targetWrapperClass.equals(Float.class))
- return new Float(num.floatValue());
- if(targetWrapperClass.equals(Double.class))
- return new Double(num.doubleValue());
- if(targetWrapperClass.equals(BigDecimal.class))
- return new BigDecimal(num.doubleValue());
- }
- return value;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/expressions/UMLOCLFactory.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/expressions/UMLOCLFactory.java
deleted file mode 100644
index a44741438c0..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/expressions/UMLOCLFactory.java
+++ /dev/null
@@ -1,150 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.expressions;
-
-import java.util.Collections;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EParameter;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.ocl.Environment;
-import org.eclipse.ocl.EvaluationEnvironment;
-import org.eclipse.ocl.ParserException;
-import org.eclipse.ocl.ecore.EcoreFactory;
-import org.eclipse.ocl.ecore.OCLExpression;
-import org.eclipse.ocl.ecore.Variable;
-import org.eclipse.ocl.ecore.OCL.Helper;
-import org.eclipse.ocl.options.ParsingOptions;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class UMLOCLFactory {
-
- /**
- * @generated
- */
- private final UMLAbstractExpression[] expressions;
-
- /**
- * @generated
- */
- protected UMLOCLFactory() {
- this.expressions = new UMLAbstractExpression[1];
- }
-
- /**
- * @generated
- */
- public static UMLAbstractExpression getExpression(int index, EClassifier context, Map<String, EClassifier> environment) {
- UMLOCLFactory cached = UMLDiagramEditorPlugin.getInstance().getUMLOCLFactory();
- if(cached == null) {
- UMLDiagramEditorPlugin.getInstance().setUMLOCLFactory(cached = new UMLOCLFactory());
- }
- if(index < 0 || index >= cached.expressions.length) {
- throw new IllegalArgumentException();
- }
- if(cached.expressions[index] == null) {
- final String[] exprBodies = new String[]{ "self.name.concat(\'.file\') ", //$NON-NLS-1$
- };
- cached.expressions[index] = getExpression(exprBodies[index], context, environment == null ? Collections.<String, EClassifier> emptyMap() : environment);
- }
- return cached.expressions[index];
- }
-
-
- /**
- * This is factory method, callers are responsible to keep reference to the return value if they want to reuse parsed expression
- * @generated
- */
- public static UMLAbstractExpression getExpression(String body, EClassifier context, Map<String, EClassifier> environment) {
- return new Expression(body, context, environment);
- }
-
- /**
- * This method will become private in the next release
- * @generated
- */
- public static UMLAbstractExpression getExpression(String body, EClassifier context) {
- return getExpression(body, context, Collections.<String, EClassifier> emptyMap());
- }
-
- /**
- * @generated
- */
- private static class Expression extends UMLAbstractExpression {
-
- /**
- * @generated
- */
- private final org.eclipse.ocl.ecore.OCL oclInstance;
-
- /**
- * @generated
- */
- private OCLExpression oclExpression;
-
- /**
- * @generated
- */
- public Expression(String body, EClassifier context, Map<String, EClassifier> environment) {
- super(body, context);
- oclInstance = org.eclipse.ocl.ecore.OCL.newInstance();
- initCustomEnv(oclInstance.getEnvironment(), environment);
- Helper oclHelper = oclInstance.createOCLHelper();
- oclHelper.setContext(context());
- try {
- oclExpression = oclHelper.createQuery(body());
- setStatus(IStatus.OK, null, null);
- } catch (ParserException e) {
- setStatus(IStatus.ERROR, e.getMessage(), e);
- }
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected Object doEvaluate(Object context, Map env) {
- if(oclExpression == null) {
- return null;
- }
- // on the first call, both evalEnvironment and extentMap are clear, for later we have finally, below.
- EvaluationEnvironment<?, ?, ?, ?, ?> evalEnv = oclInstance.getEvaluationEnvironment();
- // initialize environment
- for(Object nextKey : env.keySet()) {
- evalEnv.replace((String)nextKey, env.get(nextKey));
- }
- try {
- Object result = oclInstance.evaluate(context, oclExpression);
- return oclInstance.isInvalid(result) ? null : result;
- } finally {
- evalEnv.clear();
- oclInstance.setExtentMap(null); // clear allInstances cache, and get the oclInstance ready for the next call
- }
- }
-
- /**
- * @generated
- */
- private static void initCustomEnv(Environment<?, EClassifier, ?, ?, ?, EParameter, ?, ?, ?, ?, ?, ?> ecoreEnv, Map<String, EClassifier> environment) {
- // Use EObject as implicit root class for any object, to allow eContainer() and other EObject operations from OCL expressions
- ParsingOptions.setOption(ecoreEnv, ParsingOptions.implicitRootClass(ecoreEnv), EcorePackage.eINSTANCE.getEObject());
- for(String varName : environment.keySet()) {
- EClassifier varType = environment.get(varName);
- ecoreEnv.addElement(varName, createVar(ecoreEnv, varName, varType), false);
- }
- }
-
- /**
- * @generated
- */
- private static Variable createVar(Environment<?, EClassifier, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?> ecoreEnv, String name, EClassifier type) {
- Variable var = EcoreFactory.eINSTANCE.createVariable();
- var.setName(name);
- var.setType(ecoreEnv.getUMLReflection().getOCLType(type));
- return var;
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/parsers/AbstractParser.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/parsers/AbstractParser.java
deleted file mode 100644
index 940a73df5a2..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/parsers/AbstractParser.java
+++ /dev/null
@@ -1,418 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.parsers;
-
-import java.util.Arrays;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.diagram.deployment.part.Messages;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public abstract class AbstractParser implements IParser {
-
- /**
- * @generated
- */
- protected final EAttribute[] features;
-
- /**
- * @generated
- */
- protected final EAttribute[] editableFeatures;
-
- /**
- * @generated
- */
- private String viewPattern;
-
- /**
- * @generated
- */
- private String editorPattern;
-
- /**
- * @generated
- */
- private String editPattern;
-
- /**
- * @generated
- */
- public AbstractParser(EAttribute[] features) {
- if(features == null || Arrays.asList(features).contains(null)) {
- throw new IllegalArgumentException();
- }
- this.editableFeatures = this.features = features;
- }
-
- /**
- * @generated
- */
- public AbstractParser(EAttribute[] features, EAttribute[] editableFeatures) {
- if(features == null || Arrays.asList(features).contains(null)) {
- throw new IllegalArgumentException();
- }
- this.features = features;
- if(editableFeatures == null || Arrays.asList(editableFeatures).contains(null)) {
- throw new IllegalArgumentException();
- }
- this.editableFeatures = editableFeatures;
- }
-
- /**
- * @generated
- */
- public String getViewPattern() {
- return viewPattern;
- }
-
- /**
- * @generated
- */
- public void setViewPattern(String viewPattern) {
- this.viewPattern = viewPattern;
- }
-
- /**
- * @generated
- */
- public String getEditorPattern() {
- return editorPattern;
- }
-
- /**
- * @generated
- */
- public void setEditorPattern(String editorPattern) {
- this.editorPattern = editorPattern;
- }
-
- /**
- * @generated
- */
- public String getEditPattern() {
- return editPattern;
- }
-
- /**
- * @generated
- */
- public void setEditPattern(String editPattern) {
- this.editPattern = editPattern;
- }
-
- /**
- * @generated
- */
- public boolean isAffectingEvent(Object event, int flags) {
- if(event instanceof Notification) {
- return isAffectingFeature(((Notification)event).getFeature());
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean isAffectingFeature(Object feature) {
- for(int i = 0; i < features.length; i++) {
- if(features[i] == feature) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Object[] getValues(EObject element) {
- Object[] values = new Object[features.length];
- for(int i = 0; i < features.length; i++) {
- values[i] = getValue(element, features[i]);
- }
- return values;
- }
-
- /**
- * @generated
- */
- protected Object[] getEditableValues(EObject element) {
- Object[] values = new Object[editableFeatures.length];
- for(int i = 0; i < editableFeatures.length; i++) {
- values[i] = getValue(element, editableFeatures[i]);
- }
- return values;
- }
-
- /**
- * @generated
- */
- protected Object getValue(EObject element, EAttribute feature) {
- Object value = element.eGet(feature);
- Class iClass = feature.getEAttributeType().getInstanceClass();
- if(String.class.equals(iClass)) {
- if(value == null) {
- value = ""; //$NON-NLS-1$
- }
- }
- return value;
- }
-
- /**
- * @generated
- */
- protected ICommand getParseCommand(IAdaptable adapter, Object[] values, int flags) {
- if(values == null || validateNewValues(values).getCode() != IParserEditStatus.EDITABLE) {
- return UnexecutableCommand.INSTANCE;
- }
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(element);
- if(editingDomain == null) {
- return UnexecutableCommand.INSTANCE;
- }
- CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values"); //$NON-NLS-1$
- for(int i = 0; i < values.length; i++) {
- command.compose(getModificationCommand(element, editableFeatures[i], values[i]));
- }
- return command;
- }
-
- /**
- * @generated
- */
- protected ICommand getModificationCommand(EObject element, EAttribute feature, Object value) {
- value = getValidNewValue(feature, value);
- if(value instanceof InvalidValue) {
- return UnexecutableCommand.INSTANCE;
- }
- SetRequest request = new SetRequest(element, feature, value);
- return new SetValueCommand(request);
- }
-
- /**
- * @generated
- */
- protected IParserEditStatus validateNewValues(Object[] values) {
- if(values.length != editableFeatures.length) {
- return ParserEditStatus.UNEDITABLE_STATUS;
- }
- for(int i = 0; i < values.length; i++) {
- Object value = getValidNewValue(editableFeatures[i], values[i]);
- if(value instanceof InvalidValue) {
- return new ParserEditStatus(UMLDiagramEditorPlugin.ID, IParserEditStatus.UNEDITABLE, value.toString());
- }
- }
- return ParserEditStatus.EDITABLE_STATUS;
- }
-
- /**
- * @generated
- */
- protected Object getValidNewValue(EAttribute feature, Object value) {
- EClassifier type = feature.getEType();
- if(type instanceof EDataType) {
- Class iClass = type.getInstanceClass();
- if(Boolean.TYPE.equals(iClass)) {
- if(value instanceof Boolean) {
- // ok
- } else if(value instanceof String) {
- value = Boolean.valueOf((String)value);
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Character.TYPE.equals(iClass)) {
- if(value instanceof Character) {
- // ok
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- value = new Character(s.charAt(0));
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Byte.TYPE.equals(iClass)) {
- if(value instanceof Byte) {
- // ok
- } else if(value instanceof Number) {
- value = new Byte(((Number)value).byteValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Byte.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Short.TYPE.equals(iClass)) {
- if(value instanceof Short) {
- // ok
- } else if(value instanceof Number) {
- value = new Short(((Number)value).shortValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Short.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Integer.TYPE.equals(iClass)) {
- if(value instanceof Integer) {
- // ok
- } else if(value instanceof Number) {
- value = new Integer(((Number)value).intValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Integer.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Long.TYPE.equals(iClass)) {
- if(value instanceof Long) {
- // ok
- } else if(value instanceof Number) {
- value = new Long(((Number)value).longValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Long.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Float.TYPE.equals(iClass)) {
- if(value instanceof Float) {
- // ok
- } else if(value instanceof Number) {
- value = new Float(((Number)value).floatValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Float.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Double.TYPE.equals(iClass)) {
- if(value instanceof Double) {
- // ok
- } else if(value instanceof Number) {
- value = new Double(((Number)value).doubleValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Double.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(type instanceof EEnum) {
- if(value instanceof String) {
- EEnumLiteral literal = ((EEnum)type).getEEnumLiteralByLiteral((String)value);
- if(literal == null) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnknownLiteral, value));
- } else {
- value = literal.getInstance();
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, String.class.getName()));
- }
- }
- }
- return value;
- }
-
- /**
- * @generated
- */
- protected class InvalidValue {
-
- /**
- * @generated
- */
- private String description;
-
- /**
- * @generated
- */
- public InvalidValue(String description) {
- this.description = description;
- }
-
- /**
- * @generated
- */
- public String toString() {
- return description;
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/parsers/MessageFormatParser.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/parsers/MessageFormatParser.java
deleted file mode 100644
index 508ec4ef71f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/parsers/MessageFormatParser.java
+++ /dev/null
@@ -1,192 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.parsers;
-
-import java.text.FieldPosition;
-import java.text.MessageFormat;
-import java.text.ParsePosition;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.diagram.deployment.part.Messages;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class MessageFormatParser extends AbstractParser {
-
- /**
- * @generated
- */
- private String defaultPattern;
-
- /**
- * @generated
- */
- private String defaultEditablePattern;
-
- /**
- * @generated
- */
- private MessageFormat viewProcessor;
-
- /**
- * @generated
- */
- private MessageFormat editorProcessor;
-
- /**
- * @generated
- */
- private MessageFormat editProcessor;
-
- /**
- * @generated
- */
- public MessageFormatParser(EAttribute[] features) {
- super(features);
- }
-
- /**
- * @generated
- */
- public MessageFormatParser(EAttribute[] features, EAttribute[] editableFeatures) {
- super(features, editableFeatures);
- }
-
- /**
- * @generated
- */
- protected String getDefaultPattern() {
- if(defaultPattern == null) {
- StringBuffer sb = new StringBuffer();
- for(int i = 0; i < features.length; i++) {
- if(i > 0) {
- sb.append(' ');
- }
- sb.append('{');
- sb.append(i);
- sb.append('}');
- }
- defaultPattern = sb.toString();
- }
- return defaultPattern;
- }
-
- /**
- * @generated
- */
- public void setViewPattern(String viewPattern) {
- super.setViewPattern(viewPattern);
- viewProcessor = null;
- }
-
- /**
- * @generated
- */
- public void setEditorPattern(String editorPattern) {
- super.setEditorPattern(editorPattern);
- editorProcessor = null;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getViewProcessor() {
- if(viewProcessor == null) {
- viewProcessor = new MessageFormat(getViewPattern() == null ? getDefaultPattern() : getViewPattern());
- }
- return viewProcessor;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getEditorProcessor() {
- if(editorProcessor == null) {
- editorProcessor = new MessageFormat(getEditorPattern() == null ? getDefaultEditablePattern() : getEditorPattern());
- }
- return editorProcessor;
- }
-
- /**
- * @generated
- */
- protected String getDefaultEditablePattern() {
- if(defaultEditablePattern == null) {
- StringBuffer sb = new StringBuffer();
- for(int i = 0; i < editableFeatures.length; i++) {
- if(i > 0) {
- sb.append(' ');
- }
- sb.append('{');
- sb.append(i);
- sb.append('}');
- }
- defaultEditablePattern = sb.toString();
- }
- return defaultEditablePattern;
- }
-
- /**
- * @generated
- */
- public void setEditPattern(String editPattern) {
- super.setEditPattern(editPattern);
- editProcessor = null;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getEditProcessor() {
- if(editProcessor == null) {
- editProcessor = new MessageFormat(getEditPattern() == null ? getDefaultEditablePattern() : getEditPattern());
- }
- return editProcessor;
- }
-
- /**
- * @generated
- */
- public String getEditString(IAdaptable adapter, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- return getEditorProcessor().format(getEditableValues(element), new StringBuffer(), new FieldPosition(0)).toString();
- }
-
- /**
- * @generated
- */
- public IParserEditStatus isValidEditString(IAdaptable adapter, String editString) {
- ParsePosition pos = new ParsePosition(0);
- Object[] values = getEditProcessor().parse(editString, pos);
- if(values == null) {
- return new ParserEditStatus(UMLDiagramEditorPlugin.ID, IParserEditStatus.UNEDITABLE, NLS.bind(Messages.MessageFormatParser_InvalidInputError, new Integer(pos.getErrorIndex())));
- }
- return validateNewValues(values);
- }
-
- /**
- * @generated
- */
- public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) {
- Object[] values = getEditProcessor().parse(newString, new ParsePosition(0));
- return getParseCommand(adapter, values, flags);
- }
-
- /**
- * @generated
- */
- public String getPrintString(IAdaptable adapter, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- return getViewProcessor().format(getValues(element), new StringBuffer(), new FieldPosition(0)).toString();
- }
-
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/DeleteElementAction.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/DeleteElementAction.java
deleted file mode 100644
index 8205c3b72f5..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/DeleteElementAction.java
+++ /dev/null
@@ -1,2 +0,0 @@
-//This file is not used.
-//The DeleteElementAction is removed from the plugin and replaced by DeleteFromModelAction in the plugin org.eclipse.diagram.common.
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/DiagramEditorContextMenuProvider.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/DiagramEditorContextMenuProvider.java
deleted file mode 100644
index 5cf24897d63..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/DiagramEditorContextMenuProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService;
-import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
-import org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @generated
- */
-public class DiagramEditorContextMenuProvider extends DiagramContextMenuProvider {
-
- /**
- * @generated
- */
- private IWorkbenchPart part;
-
- /**
- * @generated
- */
- public DiagramEditorContextMenuProvider(IWorkbenchPart part, EditPartViewer viewer) {
- super(part, viewer);
- this.part = part;
-
- }
-
- /**
- * @generated
- */
- public void buildContextMenu(final IMenuManager menu) {
- getViewer().flush();
- try {
- TransactionUtil.getEditingDomain((EObject)getViewer().getContents().getModel()).runExclusive(new Runnable() {
-
- public void run() {
- ContributionItemService.getInstance().contributeToPopupMenu(DiagramEditorContextMenuProvider.this, part);
- menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL);
-
- }
- });
- } catch (Exception e) {
- UMLDiagramEditorPlugin.getInstance().logError("Error building context menu", e);
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/LoadResourceAction.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/LoadResourceAction.java
deleted file mode 100644
index 262e2b92c1f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/LoadResourceAction.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * @generated
- */
-public class LoadResourceAction extends AbstractHandler {
-
- /**
- * @generated
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart diagramEditor = HandlerUtil.getActiveEditorChecked(event);
- Shell shell = diagramEditor.getEditorSite().getShell();
- assert diagramEditor instanceof DiagramEditor;
- TransactionalEditingDomain editingDomain = ((DiagramEditor)diagramEditor).getEditingDomain();
- org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog loadResourceDialog = new org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog(shell, editingDomain);
- loadResourceDialog.open();
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/Messages.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/Messages.java
deleted file mode 100644
index e25d9382c86..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/Messages.java
+++ /dev/null
@@ -1,458 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * @generated
- */
-public class Messages extends NLS {
-
- /**
- * @generated
- */
- static {
- NLS.initializeMessages("messages", Messages.class); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- private Messages() {
- }
-
-
-
- /**
- * @generated
- */
- public static String UMLCreationWizardTitle;
-
- /**
- * @generated
- */
- public static String UMLCreationWizard_DiagramModelFilePageTitle;
-
- /**
- * @generated
- */
- public static String UMLCreationWizard_DiagramModelFilePageDescription;
-
- /**
- * @generated
- */
- public static String UMLCreationWizard_DomainModelFilePageTitle;
-
- /**
- * @generated
- */
- public static String UMLCreationWizard_DomainModelFilePageDescription;
-
- /**
- * @generated
- */
- public static String UMLCreationWizardOpenEditorError;
-
- /**
- * @generated
- */
- public static String UMLCreationWizardCreationError;
-
- /**
- * @generated
- */
- public static String UMLCreationWizardPageExtensionError;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditorUtil_OpenModelResourceErrorDialogTitle;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditorUtil_OpenModelResourceErrorDialogMessage;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditorUtil_CreateDiagramProgressTask;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditorUtil_CreateDiagramCommandLabel;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_isModifiable;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_handleElementContentChanged;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_IncorrectInputError;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_NoDiagramInResourceError;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_DiagramLoadingError;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_UnsynchronizedFileSaveError;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_SaveDiagramTask;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_SaveNextResourceTask;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_SaveAsOperation;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_ResourceErrorDialogTitle;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_ResourceErrorDialogMessage;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_WizardTitle;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_OpenModelFileDialogTitle;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_CreationPageName;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_CreationPageTitle;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_CreationPageDescription;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageName;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageTitle;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageDescription;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_InitDiagramCommand;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_IncorrectRootError;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditor_SavingDeletedFile;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditor_SaveAsErrorTitle;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditor_SaveAsErrorMessage;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditor_SaveErrorTitle;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditor_SaveErrorMessage;
-
- /**
- * @generated
- */
- public static String UMLElementChooserDialog_SelectModelElementTitle;
-
- /**
- * @generated
- */
- public static String ModelElementSelectionPageMessage;
-
- /**
- * @generated
- */
- public static String ValidateActionMessage;
-
- /**
- * @generated
- */
- public static String createNodesGroup_title;
-
- /**
- * @generated
- */
- public static String createNodesGroup_desc;
-
- /**
- * @generated
- */
- public static String createLinksGroup_title;
-
- /**
- * @generated
- */
- public static String createLinksGroup_desc;
-
- /**
- * @generated
- */
- public static String createNodeCreationTool_title;
-
- /**
- * @generated
- */
- public static String createNodeCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createDeviceCreationTool_title;
-
- /**
- * @generated
- */
- public static String createDeviceCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createExecutionEnvironmentCreationTool_title;
-
- /**
- * @generated
- */
- public static String createExecutionEnvironmentCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createArtifactCreationTool_title;
-
- /**
- * @generated
- */
- public static String createArtifactCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createCommentCreationTool_title;
-
- /**
- * @generated
- */
- public static String createCommentCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createConstraintCreationTool_title;
-
- /**
- * @generated
- */
- public static String createConstraintCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createLinkCreationTool_title;
-
- /**
- * @generated
- */
- public static String createLinkCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createDependencyCreationTool_title;
-
- /**
- * @generated
- */
- public static String createDependencyCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createGeneralizationCreationTool_title;
-
- /**
- * @generated
- */
- public static String createGeneralizationCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createDeploymentCreationTool_title;
-
- /**
- * @generated
- */
- public static String createDeploymentCreationTool_desc;
-
- /**
- * @generated
- */
- public static String createManifestationCreationTool_title;
-
- /**
- * @generated
- */
- public static String createManifestationCreationTool_desc;
-
- /**
- * @generated
- */
- public static String DeviceCompositeCompartmentEditPart_title;
-
- /**
- * @generated
- */
- public static String ExecutionEnvironmentCompositeCompartmentEditPart_title;
-
- /**
- * @generated
- */
- public static String NodeCompositeCompartmentEditPart_title;
-
- /**
- * @generated
- */
- public static String ArtifactCompositeCompartmentEditPart_title;
-
- /**
- * @generated
- */
- public static String DeviceCompositeCompartmentEditPartCN_title;
-
- /**
- * @generated
- */
- public static String ExecutionEnvironmentCompositeCompartmentEditPartCN_title;
-
- /**
- * @generated
- */
- public static String NodeCompositeCompartmentEditPartCN_title;
-
- /**
- * @generated
- */
- public static String ArtifactCompositeCompartmentEditPartCN_title;
-
- /**
- * @generated
- */
- public static String ArtifactCompositeCompartmentEditPartACN_title;
-
-
- /**
- * @generated
- */
- public static String CommandName_OpenDiagram;
-
- /**
- * @generated
- */
- public static String AbstractParser_UnexpectedValueType;
-
- /**
- * @generated
- */
- public static String AbstractParser_WrongStringConversion;
-
- /**
- * @generated
- */
- public static String AbstractParser_UnknownLiteral;
-
-
- /**
- * @generated
- */
- public static String MessageFormatParser_InvalidInputError;
-
- /**
- * @generated
- */
- public static String UMLModelingAssistantProviderTitle;
-
- /**
- * @generated
- */
- public static String UMLModelingAssistantProviderMessage;
-
- //TODO: put accessor fields manually
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/ModelElementSelectionPage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/ModelElementSelectionPage.java
deleted file mode 100644
index dbc996af79b..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/ModelElementSelectionPage.java
+++ /dev/null
@@ -1,140 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.FeatureMap;
-import org.eclipse.emf.edit.provider.IWrapperItemProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * Wizard page that allows to select element from model.
- * @generated
- */
-public class ModelElementSelectionPage extends WizardPage {
-
- /**
- * @generated
- */
- protected EObject selectedModelElement;
-
- /**
- * @generated
- */
- private TreeViewer modelViewer;
-
- /**
- * @generated
- */
- public ModelElementSelectionPage(String pageName) {
- super(pageName);
- }
-
- /**
- * @generated
- */
- public EObject getModelElement() {
- return selectedModelElement;
- }
-
- /**
- * @generated
- */
- public void setModelElement(EObject modelElement) {
- selectedModelElement = modelElement;
- if(modelViewer != null) {
- if(selectedModelElement != null) {
- modelViewer.setInput(selectedModelElement.eResource());
- modelViewer.setSelection(new StructuredSelection(selectedModelElement));
- } else {
- modelViewer.setInput(null);
- }
- setPageComplete(validatePage());
- }
- }
-
- /**
- * @generated
- */
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
-
- Composite plate = new Composite(parent, SWT.NONE);
- plate.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- plate.setLayout(layout);
- setControl(plate);
-
- Label label = new Label(plate, SWT.NONE);
- label.setText(getSelectionTitle());
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- modelViewer = new TreeViewer(plate, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- GridData layoutData = new GridData(GridData.FILL_BOTH);
- layoutData.heightHint = 300;
- layoutData.widthHint = 300;
- modelViewer.getTree().setLayoutData(layoutData);
- modelViewer.setContentProvider(new AdapterFactoryContentProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()));
- modelViewer.setLabelProvider(new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()));
- if(selectedModelElement != null) {
- modelViewer.setInput(selectedModelElement.eResource());
- modelViewer.setSelection(new StructuredSelection(selectedModelElement));
- }
- modelViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- ModelElementSelectionPage.this.updateSelection((IStructuredSelection)event.getSelection());
- }
- });
-
- setPageComplete(validatePage());
- }
-
- /**
- * Override to provide custom model element description.
- * @generated
- */
- protected String getSelectionTitle() {
- return Messages.ModelElementSelectionPageMessage;
- }
-
- /**
- * @generated
- */
- protected void updateSelection(IStructuredSelection selection) {
- selectedModelElement = null;
- if(selection.size() == 1) {
- Object selectedElement = selection.getFirstElement();
- if(selectedElement instanceof IWrapperItemProvider) {
- selectedElement = ((IWrapperItemProvider)selectedElement).getValue();
- }
- if(selectedElement instanceof FeatureMap.Entry) {
- selectedElement = ((FeatureMap.Entry)selectedElement).getValue();
- }
- if(selectedElement instanceof EObject) {
- selectedModelElement = (EObject)selectedElement;
- }
- }
- setPageComplete(validatePage());
- }
-
- /**
- * Override to provide specific validation of the selected model element.
- * @generated
- */
- protected boolean validatePage() {
- return true;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLCreationWizard.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLCreationWizard.java
deleted file mode 100644
index 3deb2479fba..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLCreationWizard.java
+++ /dev/null
@@ -1,154 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-/**
- * @generated
- */
-public class UMLCreationWizard extends Wizard implements INewWizard {
-
- /**
- * @generated
- */
- private IWorkbench workbench;
-
- /**
- * @generated
- */
- protected IStructuredSelection selection;
-
- /**
- * @generated
- */
- protected UMLCreationWizardPage diagramModelFilePage;
-
- /**
- * @generated
- */
- protected UMLCreationWizardPage domainModelFilePage;
-
- /**
- * @generated
- */
- protected Resource diagram;
-
- /**
- * @generated
- */
- private boolean openNewlyCreatedDiagramEditor = true;
-
- /**
- * @generated
- */
- public IWorkbench getWorkbench() {
- return workbench;
- }
-
- /**
- * @generated
- */
- public IStructuredSelection getSelection() {
- return selection;
- }
-
- /**
- * @generated
- */
- public final Resource getDiagram() {
- return diagram;
- }
-
- /**
- * @generated
- */
- public final boolean isOpenNewlyCreatedDiagramEditor() {
- return openNewlyCreatedDiagramEditor;
- }
-
- /**
- * @generated
- */
- public void setOpenNewlyCreatedDiagramEditor(boolean openNewlyCreatedDiagramEditor) {
- this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor;
- }
-
- /**
- * @generated
- */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.workbench = workbench;
- this.selection = selection;
- setWindowTitle(Messages.UMLCreationWizardTitle);
- setDefaultPageImageDescriptor(UMLDiagramEditorPlugin.getBundledImageDescriptor("icons/wizban/NewUMLWizard.gif")); //$NON-NLS-1$
- setNeedsProgressMonitor(true);
- }
-
- /**
- * @generated
- */
- public void addPages() {
- diagramModelFilePage = new UMLCreationWizardPage("DiagramModelFile", getSelection(), "PapyrusUMLDeployment_diagram"); //$NON-NLS-1$ //$NON-NLS-2$
- diagramModelFilePage.setTitle(Messages.UMLCreationWizard_DiagramModelFilePageTitle);
- diagramModelFilePage.setDescription(Messages.UMLCreationWizard_DiagramModelFilePageDescription);
- addPage(diagramModelFilePage);
-
- domainModelFilePage = new UMLCreationWizardPage("DomainModelFile", getSelection(), "PapyrusUMLDeployment") { //$NON-NLS-1$ //$NON-NLS-2$
-
- public void setVisible(boolean visible) {
- if(visible) {
- String fileName = diagramModelFilePage.getFileName();
- fileName = fileName.substring(0, fileName.length() - ".PapyrusUMLDeployment_diagram".length()); //$NON-NLS-1$
- setFileName(UMLDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), fileName, "PapyrusUMLDeployment")); //$NON-NLS-1$
- }
- super.setVisible(visible);
- }
- };
- domainModelFilePage.setTitle(Messages.UMLCreationWizard_DomainModelFilePageTitle);
- domainModelFilePage.setDescription(Messages.UMLCreationWizard_DomainModelFilePageDescription);
- addPage(domainModelFilePage);
- }
-
- /**
- * @generated
- */
- public boolean performFinish() {
- IRunnableWithProgress op = new WorkspaceModifyOperation(null) {
-
- protected void execute(IProgressMonitor monitor) throws CoreException, InterruptedException {
- diagram = UMLDiagramEditorUtil.createDiagram(diagramModelFilePage.getURI(), domainModelFilePage.getURI(), monitor);
- if(isOpenNewlyCreatedDiagramEditor() && diagram != null) {
- try {
- UMLDiagramEditorUtil.openDiagram(diagram);
- } catch (PartInitException e) {
- ErrorDialog.openError(getContainer().getShell(), Messages.UMLCreationWizardOpenEditorError, null, e.getStatus());
- }
- }
- }
- };
- try {
- getContainer().run(false, true, op);
- } catch (InterruptedException e) {
- return false;
- } catch (InvocationTargetException e) {
- if(e.getTargetException() instanceof CoreException) {
- ErrorDialog.openError(getContainer().getShell(), Messages.UMLCreationWizardCreationError, null, ((CoreException)e.getTargetException()).getStatus());
- } else {
- UMLDiagramEditorPlugin.getInstance().logError("Error creating diagram", e.getTargetException()); //$NON-NLS-1$
- }
- return false;
- }
- return diagram != null;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLCreationWizardPage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLCreationWizardPage.java
deleted file mode 100644
index 0bf9bd48edc..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLCreationWizardPage.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-
-/**
- * @generated
- */
-public class UMLCreationWizardPage extends WizardNewFileCreationPage {
-
- /**
- * @generated
- */
- private final String fileExtension;
-
- /**
- * @generated
- */
- public UMLCreationWizardPage(String pageName, IStructuredSelection selection, String fileExtension) {
- super(pageName, selection);
- this.fileExtension = fileExtension;
- }
-
- /**
- * Override to create files with this extension.
- *
- * @generated
- */
- protected String getExtension() {
- return fileExtension;
- }
-
- /**
- * @generated
- */
- public URI getURI() {
- return URI.createPlatformResourceURI(getFilePath().toString(), false);
- }
-
- /**
- * @generated
- */
- protected IPath getFilePath() {
- IPath path = getContainerFullPath();
- if(path == null) {
- path = new Path(""); //$NON-NLS-1$
- }
- String fileName = getFileName();
- if(fileName != null) {
- path = path.append(fileName);
- }
- return path;
- }
-
- /**
- * @generated
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- setFileName(UMLDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), getFileName(), getExtension()));
- setPageComplete(validatePage());
- }
-
- /**
- * @generated
- */
- protected boolean validatePage() {
- if(!super.validatePage()) {
- return false;
- }
- String extension = getExtension();
- if(extension != null && !getFilePath().toString().endsWith("." + extension)) {
- setErrorMessage(NLS.bind(Messages.UMLCreationWizardPageExtensionError, extension));
- return false;
- }
- return true;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramActionBarContributor.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramActionBarContributor.java
deleted file mode 100644
index 0617a0549f4..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramActionBarContributor.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * @generated
- */
-public class UMLDiagramActionBarContributor extends DiagramActionBarContributor {
-
- /**
- * @generated
- */
- protected Class getEditorClass() {
- return UMLDiagramEditor.class;
- }
-
- /**
- * @generated
- */
- protected String getEditorId() {
- return UMLDiagramEditor.ID;
- }
-
- /**
- * @generated
- */
- public void init(IActionBars bars, IWorkbenchPage page) {
- super.init(bars, page);
- // print preview
- IMenuManager fileMenu = bars.getMenuManager().findMenuUsingPath(IWorkbenchActionConstants.M_FILE);
- assert fileMenu != null;
- fileMenu.remove("pageSetupAction"); //$NON-NLS-1$
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramEditor.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramEditor.java
deleted file mode 100644
index 0b51b54a38e..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramEditor.java
+++ /dev/null
@@ -1,493 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import java.util.EventObject;
-
-import org.eclipse.core.commands.operations.IUndoableOperation;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.KeyHandler;
-import org.eclipse.gef.Tool;
-import org.eclipse.gef.commands.CommandStackListener;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.ui.palette.PaletteViewer;
-import org.eclipse.gef.ui.palette.PaletteViewerProvider;
-import org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener;
-import org.eclipse.gmf.runtime.common.core.service.ProviderChangeEvent;
-import org.eclipse.gmf.runtime.common.ui.services.marker.MarkerNavigationService;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
-import org.eclipse.gmf.runtime.diagram.ui.internal.parts.PaletteToolTransferDragSourceListener;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.papyrus.core.adaptor.gmf.GmfMultiDiagramDocumentProvider;
-import org.eclipse.papyrus.core.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.core.services.ServiceException;
-import org.eclipse.papyrus.core.services.ServicesRegistry;
-import org.eclipse.papyrus.diagram.common.listeners.DropTargetListener;
-import org.eclipse.papyrus.diagram.common.part.PapyrusPaletteContextMenuProvider;
-import org.eclipse.papyrus.diagram.common.part.PapyrusPaletteViewer;
-import org.eclipse.papyrus.diagram.common.part.UmlGmfDiagramEditor;
-import org.eclipse.papyrus.diagram.common.service.PapyrusPaletteService;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.ide.IGotoMarker;
-import org.eclipse.ui.part.ShowInContext;
-
-/**
- * @generated
- */
-public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderChangeListener, IGotoMarker {
-
- /**
- * @generated
- */
- public static final String ID = "org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorID"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final String CONTEXT_ID = "org.eclipse.papyrus.diagram.deployment.ui.diagramContext"; //$NON-NLS-1$
-
-
-
- /**
- * @generated
- */
- private KeyHandler paletteKeyHandler = null;
-
- /**
- * @generated
- */
- private MouseListener paletteMouseListener = null;
-
-
- /**
- * @generated
- */
- private IUndoableOperation savedOperation = null;
-
- /**
- * @generated
- */
- private TransactionalEditingDomain editingDomain;
-
- /**
- * @generated
- */
- private IDocumentProvider documentProvider;
-
-
-
-
- /**
- * @generated
- */
- public UMLDiagramEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws ServiceException {
- super(servicesRegistry, diagram);
-
-
- // adds a listener to the palette service, which reacts to palette customizations
- PapyrusPaletteService.getInstance().addProviderChangeListener(this);
-
-
- // Share the same editing provider
- editingDomain = servicesRegistry.getService(TransactionalEditingDomain.class);
- documentProvider = new GmfMultiDiagramDocumentProvider(editingDomain);
-
- // overrides editing domain created by super constructor
- setDocumentProvider(documentProvider);
-
-
- }
-
- /**
- * @generated
- */
- protected String getContextID() {
- return CONTEXT_ID;
- }
-
- /**
- * @generated
- */
- protected PaletteRoot createPaletteRoot(PaletteRoot existingPaletteRoot) {
- PaletteRoot paletteRoot;
- if(existingPaletteRoot == null) {
- paletteRoot = PapyrusPaletteService.getInstance().createPalette(this, getDefaultPaletteContent());
- } else {
- PapyrusPaletteService.getInstance().updatePalette(existingPaletteRoot, this, getDefaultPaletteContent());
- paletteRoot = existingPaletteRoot;
- }
- applyCustomizationsToPalette(paletteRoot);
- return paletteRoot;
- }
-
- /**
- * @generated
- */
- protected PreferencesHint getPreferencesHint() {
- return UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
- }
-
- /**
- * @generated
- */
- public String getContributorId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- protected final IDocumentProvider getDocumentProvider(IEditorInput input) {
- return documentProvider;
- }
-
- /**
- * @generated
- */
- public TransactionalEditingDomain getEditingDomain() {
- return editingDomain;
- }
-
- /**
- * @generated
- */
- protected final void setDocumentProvider(IEditorInput input) {
- // Already set in the constructor
- }
-
- /**
- * @generated
- */
- public void gotoMarker(IMarker marker) {
- MarkerNavigationService.getInstance().gotoMarker(this, marker);
- }
-
- /**
- * @generated
- */
- public boolean isSaveAsAllowed() {
- return true;
- }
-
- /**
- * @generated
- */
- public void doSaveAs() {
- performSaveAs(new NullProgressMonitor());
- }
-
- /**
- * @generated
- */
- protected void performSaveAs(IProgressMonitor progressMonitor) {
- // Nothing
- }
-
- /**
- * @generated
- */
- public ShowInContext getShowInContext() {
- return new ShowInContext(getEditorInput(), getGraphicalViewer().getSelection());
- }
-
- /**
- * @generated
- */
- protected void configureGraphicalViewer() {
- super.configureGraphicalViewer();
- DiagramEditorContextMenuProvider provider = new DiagramEditorContextMenuProvider(this, getDiagramGraphicalViewer());
- getDiagramGraphicalViewer().setContextMenu(provider);
- getSite().registerContextMenu(ActionIds.DIAGRAM_EDITOR_CONTEXT_MENU, provider, getDiagramGraphicalViewer());
- }
-
-
-
- /**
- * @generated
- */
- protected TransactionalEditingDomain createEditingDomain() {
- // Already configured
- return editingDomain;
- }
-
- /**
- * @generated
- */
- protected void configureDiagramEditDomain() {
- super.configureDiagramEditDomain();
- getDiagramEditDomain().getDiagramCommandStack().addCommandStackListener(new CommandStackListener() {
-
- public void commandStackChanged(EventObject event) {
- firePropertyChange(IEditorPart.PROP_DIRTY);
- }
- });
- }
-
- /**
- * @generated
- */
- public void doSave(IProgressMonitor progressMonitor) {
- // The saving of the resource is done by the CoreMultiDiagramEditor
- savedOperation = getOperationHistory().getUndoOperation(getUndoContext());
- }
-
- /**
- * @generated
- */
- public boolean isDirty() {
- IUndoableOperation op = getOperationHistory().getUndoOperation(getUndoContext());
- return savedOperation != op;
- }
-
-
- /**
- * @generated
- */
- public void providerChanged(ProviderChangeEvent event) {
- // update the palette if the palette service has changed
- if(PapyrusPaletteService.getInstance().equals(event.getSource())) {
- PapyrusPaletteService.getInstance().updatePalette(getPaletteViewer().getPaletteRoot(), this, getDefaultPaletteContent());
- }
- }
-
- /**
- * @generated
- */
- public void dispose() {
- // remove palette service listener
- // remove preference listener
- PapyrusPaletteService.getInstance().removeProviderChangeListener(this);
-
- super.dispose();
- }
-
- /**
- * @generated
- */
- protected PaletteViewer getPaletteViewer() {
- return getEditDomain().getPaletteViewer();
- }
-
-
-
- /**
- * @generated
- */
- protected PaletteViewer constructPaletteViewer() {
- return new PapyrusPaletteViewer();
- }
-
- /**
- * @generated
- */
- protected PaletteViewerProvider createPaletteViewerProvider() {
- getEditDomain().setPaletteRoot(createPaletteRoot(null));
- return new PaletteViewerProvider(getEditDomain()) {
-
- /**
- * Override to provide the additional behavior for the tools. Will intialize with a
- * PaletteEditPartFactory that has a TrackDragger that understand how to handle the
- * mouseDoubleClick event for shape creation tools. Also will initialize the palette
- * with a defaultTool that is the SelectToolEx that undestands how to handle the enter
- * key which will result in the creation of the shape also.
- */
- protected void configurePaletteViewer(PaletteViewer viewer) {
- super.configurePaletteViewer(viewer);
-
- // customize menu...
- viewer.setContextMenu(new PapyrusPaletteContextMenuProvider(viewer));
-
- viewer.getKeyHandler().setParent(getPaletteKeyHandler());
- viewer.getControl().addMouseListener(getPaletteMouseListener());
-
- // Add a transfer drag target listener that is supported on
- // palette template entries whose template is a creation tool.
- // This will enable drag and drop of the palette shape creation
- // tools.
- viewer.addDragSourceListener(new PaletteToolTransferDragSourceListener(viewer));
- viewer.setCustomizer(createPaletteCustomizer());
- }
-
- public PaletteViewer createPaletteViewer(Composite parent) {
- PaletteViewer pViewer = constructPaletteViewer();
- pViewer.createControl(parent);
- configurePaletteViewer(pViewer);
- hookPaletteViewer(pViewer);
- return pViewer;
- }
-
- /**
- * @return Palette Key Handler for the palette
- */
- private KeyHandler getPaletteKeyHandler() {
-
- if(paletteKeyHandler == null) {
-
- paletteKeyHandler = new KeyHandler() {
-
- /**
- * Processes a <i>key released </i> event. This method is called by the Tool
- * whenever a key is released, and the Tool is in the proper state. Override
- * to support pressing the enter key to create a shape or connection
- * (between two selected shapes)
- *
- * @param event
- * the KeyEvent
- * @return <code>true</code> if KeyEvent was handled in some way
- */
- public boolean keyReleased(KeyEvent event) {
-
- if(event.keyCode == SWT.Selection) {
-
- Tool tool = getPaletteViewer().getActiveTool().createTool();
-
- if(toolSupportsAccessibility(tool)) {
-
- tool.keyUp(event, getDiagramGraphicalViewer());
-
- // deactivate current selection
- getPaletteViewer().setActiveTool(null);
-
- return true;
- }
-
- }
- return super.keyReleased(event);
- }
-
- };
-
- }
- return paletteKeyHandler;
- }
-
- /**
- * @return Palette Mouse listener for the palette
- */
- private MouseListener getPaletteMouseListener() {
-
- if(paletteMouseListener == null) {
-
- paletteMouseListener = new MouseListener() {
-
- /**
- * Flag to indicate that the current active tool should be cleared after a
- * mouse double-click event.
- */
- private boolean clearActiveTool = false;
-
- /**
- * Override to support double-clicking a palette tool entry to create a
- * shape or connection (between two selected shapes).
- *
- * @see MouseListener#mouseDoubleClick(MouseEvent)
- */
- public void mouseDoubleClick(MouseEvent e) {
- Tool tool = getPaletteViewer().getActiveTool().createTool();
-
- if(toolSupportsAccessibility(tool)) {
-
- tool.setViewer(getDiagramGraphicalViewer());
- tool.setEditDomain(getDiagramGraphicalViewer().getEditDomain());
- tool.mouseDoubleClick(e, getDiagramGraphicalViewer());
-
- // Current active tool should be deactivated,
- // but if it is down here it will get
- // reactivated deep in GEF palette code after
- // receiving mouse up events.
- clearActiveTool = true;
- }
- }
-
- public void mouseDown(MouseEvent e) {
- // do nothing
- }
-
- public void mouseUp(MouseEvent e) {
- // Deactivate current active tool here if a
- // double-click was handled.
- if(clearActiveTool) {
- getPaletteViewer().setActiveTool(null);
- clearActiveTool = false;
- }
-
- }
- };
-
- }
- return paletteMouseListener;
- }
-
- };
- }
-
- /**
- * @generated
- */
- @Override
- public GraphicalViewer getGraphicalViewer() {
- return super.getGraphicalViewer();
- }
-
- /**
- * @generated
- */
- @Override
- protected void initializeGraphicalViewer() {
- super.initializeGraphicalViewer();
-
- // Enable Drop
- getDiagramGraphicalViewer().addDropTargetListener(new DropTargetListener(getDiagramGraphicalViewer(), LocalSelectionTransfer.getTransfer()) {
-
- @Override
- protected Object getJavaObject(TransferData data) {
- return LocalSelectionTransfer.getTransfer().nativeToJava(data);
- }
-
- @Override
- protected TransactionalEditingDomain getTransactionalEditingDomain() {
- return getEditingDomain();
- }
- });
-
- }
-
- /**
- * @generated
- */
- @Override
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if(getSite().getPage().getActiveEditor() instanceof IMultiDiagramEditor) {
- IMultiDiagramEditor editor = (IMultiDiagramEditor)getSite().getPage().getActiveEditor();
- // If not the active editor, ignore selection changed.
- if(this.equals(editor.getActiveEditor())) {
- updateActions(getSelectionActions());
- super.selectionChanged(part, selection);
- } else {
- super.selectionChanged(part, selection);
- }
- } else {
- super.selectionChanged(part, selection);
- }
- // from
- // org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.selectionChanged(IWorkbenchPart,
- // ISelection)
- if(part == this) {
- rebuildStatusLine();
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramEditorPlugin.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramEditorPlugin.java
deleted file mode 100644
index e1f0a8786a5..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramEditorPlugin.java
+++ /dev/null
@@ -1,319 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
-import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
-import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.diagram.deployment.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.diagram.deployment.expressions.UMLOCLFactory;
-import org.eclipse.papyrus.diagram.deployment.preferences.DiagramPreferenceInitializer;
-import org.eclipse.papyrus.diagram.deployment.providers.ElementInitializers;
-import org.eclipse.papyrus.preferences.Activator;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
-import org.osgi.framework.BundleContext;
-
-/**
- * @generated
- */
-public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
-
- /**
- * @generated
- */
- public static final String ID = "org.eclipse.papyrus.diagram.deployment"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(ID);
-
- /**
- * @generated
- */
- private static UMLDiagramEditorPlugin instance;
-
- /**
- * @generated
- */
- private ComposedAdapterFactory adapterFactory;
-
- /**
- * @generated
- */
- private UMLDocumentProvider documentProvider;
-
- /**
- * @generated
- */
- private UMLBaseItemSemanticEditPolicy.LinkConstraints linkConstraints;
-
-
- /**
- * @generated
- */
- private ElementInitializers initializers;
-
- /**
- * @generated
- */
- private UMLOCLFactory oclFactory;
-
- /**
- * @generated
- */
- public UMLDiagramEditorPlugin() {
- }
-
- /**
- * @generated
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- instance = this;
- PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore());
- adapterFactory = createAdapterFactory();
- DiagramPreferenceInitializer diagramPreferenceInitializer = new DiagramPreferenceInitializer();
- diagramPreferenceInitializer.initializeDefaultPreferences();
- }
-
- /**
- * @generated
- */
- public void stop(BundleContext context) throws Exception {
- adapterFactory.dispose();
- adapterFactory = null;
- linkConstraints = null;
- initializers = null;
- oclFactory = null;
- instance = null;
- super.stop(context);
- }
-
- /**
- * @generated
- */
- public static UMLDiagramEditorPlugin getInstance() {
- return instance;
- }
-
- /**
- * @generated
- */
- public IPreferenceStore getPreferenceStore() {
- IPreferenceStore store = Activator.getDefault().getPreferenceStore();
- return store;
- }
-
- /**
- * @generated
- */
- protected ComposedAdapterFactory createAdapterFactory() {
- ArrayList<AdapterFactory> factories = new ArrayList<AdapterFactory>();
- fillItemProviderFactories(factories);
- return new ComposedAdapterFactory(factories);
- }
-
- /**
- * @generated
- */
- protected void fillItemProviderFactories(List<AdapterFactory> factories) {
- factories.add(new UMLItemProviderAdapterFactory());
- factories.add(new EcoreItemProviderAdapterFactory());
- factories.add(new ResourceItemProviderAdapterFactory());
- factories.add(new ReflectiveItemProviderAdapterFactory());
- }
-
- /**
- * @generated
- */
- public AdapterFactory getItemProvidersAdapterFactory() {
- return adapterFactory;
- }
-
- /**
- * @generated
- */
- public ImageDescriptor getItemImageDescriptor(Object item) {
- IItemLabelProvider labelProvider = (IItemLabelProvider)adapterFactory.adapt(item, IItemLabelProvider.class);
- if(labelProvider != null) {
- return ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(item));
- }
- return null;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @generated
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getBundledImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
- }
-
- /**
- * Respects images residing in any plug-in. If path is relative,
- * then this bundle is looked up for the image, otherwise, for absolute
- * path, first segment is taken as id of plug-in with image
- *
- * @generated
- * @param path the path to image, either absolute (with plug-in id as first segment), or relative for bundled images
- * @return the image descriptor
- */
- public static ImageDescriptor findImageDescriptor(String path) {
- final IPath p = new Path(path);
- if(p.isAbsolute() && p.segmentCount() > 1) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p.removeFirstSegments(1).makeAbsolute().toString());
- } else {
- return getBundledImageDescriptor(p.makeAbsolute().toString());
- }
- }
-
- /**
- * Returns an image for the image file at the given plug-in relative path.
- * Client do not need to dispose this image. Images will be disposed automatically.
- *
- * @generated
- * @param path the path
- * @return image instance
- */
- public Image getBundledImage(String path) {
- Image image = getImageRegistry().get(path);
- if(image == null) {
- getImageRegistry().put(path, getBundledImageDescriptor(path));
- image = getImageRegistry().get(path);
- }
- return image;
- }
-
- /**
- * Returns string from plug-in's resource bundle
- *
- * @generated
- */
- public static String getString(String key) {
- return Platform.getResourceString(getInstance().getBundle(), "%" + key); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- public UMLDocumentProvider getDocumentProvider() {
- if(documentProvider == null) {
- documentProvider = new UMLDocumentProvider();
- }
- return documentProvider;
- }
-
- /**
- * @generated
- */
- public UMLBaseItemSemanticEditPolicy.LinkConstraints getLinkConstraints() {
- return linkConstraints;
- }
-
- /**
- * @generated
- */
- public void setLinkConstraints(UMLBaseItemSemanticEditPolicy.LinkConstraints lc) {
- this.linkConstraints = lc;
- }
-
- /**
- * @generated
- */
- public ElementInitializers getElementInitializers() {
- return initializers;
- }
-
- /**
- * @generated
- */
- public void setElementInitializers(ElementInitializers i) {
- this.initializers = i;
- }
-
- /**
- * @generated
- */
- public UMLOCLFactory getUMLOCLFactory() {
- return oclFactory;
- }
-
- /**
- * @generated
- */
- public void setUMLOCLFactory(UMLOCLFactory f) {
- this.oclFactory = f;
- }
-
-
- /**
- * @generated
- */
- public void logError(String error) {
- logError(error, null);
- }
-
- /**
- * @generated
- */
- public void logError(String error, Throwable throwable) {
- if(error == null && throwable != null) {
- error = throwable.getMessage();
- }
- getLog().log(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, IStatus.OK, error, throwable));
- debug(error, throwable);
- }
-
- /**
- * @generated
- */
- public void logInfo(String message) {
- logInfo(message, null);
- }
-
- /**
- * @generated
- */
- public void logInfo(String message, Throwable throwable) {
- if(message == null && throwable != null) {
- message = throwable.getMessage();
- }
- getLog().log(new Status(IStatus.INFO, UMLDiagramEditorPlugin.ID, IStatus.OK, message, throwable));
- debug(message, throwable);
- }
-
- /**
- * @generated
- */
- private void debug(String message, Throwable throwable) {
- if(!isDebugging()) {
- return;
- }
- if(message != null) {
- System.err.println(message);
- }
- if(throwable != null) {
- throwable.printStackTrace();
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramEditorUtil.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramEditorUtil.java
deleted file mode 100644
index f8a4b3c784b..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramEditorUtil.java
+++ /dev/null
@@ -1,376 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.OperationHistoryFactory;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.uml2.uml.Model;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class UMLDiagramEditorUtil {
-
- /**
- * @generated
- */
- public static Map<?, ?> getSaveOptions() {
- HashMap<String, Object> saveOptions = new HashMap<String, Object>();
- saveOptions.put(XMLResource.OPTION_ENCODING, "UTF-8"); //$NON-NLS-1$
- saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
- return saveOptions;
- }
-
- /**
- * @generated
- */
- public static boolean openDiagram(Resource diagram) throws PartInitException {
- String path = diagram.getURI().toPlatformString(true);
- IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path));
- if(workspaceResource instanceof IFile) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- return null != page.openEditor(new FileEditorInput((IFile)workspaceResource), UMLDiagramEditor.ID);
- }
- return false;
- }
-
- /**
- * @generated
- */
- public static void setCharset(IFile file) {
- if(file == null) {
- return;
- }
- try {
- file.setCharset("UTF-8", new NullProgressMonitor()); //$NON-NLS-1$
- } catch (CoreException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to set charset for file " + file.getFullPath(), e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public static String getUniqueFileName(IPath containerFullPath, String fileName, String extension) {
- if(containerFullPath == null) {
- containerFullPath = new Path(""); //$NON-NLS-1$
- }
- if(fileName == null || fileName.trim().length() == 0) {
- fileName = "default"; //$NON-NLS-1$
- }
- IPath filePath = containerFullPath.append(fileName);
- if(extension != null && !extension.equals(filePath.getFileExtension())) {
- filePath = filePath.addFileExtension(extension);
- }
- extension = filePath.getFileExtension();
- fileName = filePath.removeFileExtension().lastSegment();
- int i = 1;
- while(ResourcesPlugin.getWorkspace().getRoot().exists(filePath)) {
- i++;
- filePath = containerFullPath.append(fileName + i);
- if(extension != null) {
- filePath = filePath.addFileExtension(extension);
- }
- }
- return filePath.lastSegment();
- }
-
-
-
- /**
- * Runs the wizard in a dialog.
- *
- * @generated
- */
- public static void runWizard(Shell shell, Wizard wizard, String settingsKey) {
- IDialogSettings pluginDialogSettings = UMLDiagramEditorPlugin.getInstance().getDialogSettings();
- IDialogSettings wizardDialogSettings = pluginDialogSettings.getSection(settingsKey);
- if(wizardDialogSettings == null) {
- wizardDialogSettings = pluginDialogSettings.addNewSection(settingsKey);
- }
- wizard.setDialogSettings(wizardDialogSettings);
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.getShell().setSize(Math.max(500, dialog.getShell().getSize().x), 500);
- dialog.open();
- }
-
- /**
- * This method should be called within a workspace modify operation since it creates resources.
- * @generated
- */
- public static Resource createDiagram(URI diagramURI, URI modelURI, IProgressMonitor progressMonitor) {
- TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
- progressMonitor.beginTask(Messages.UMLDiagramEditorUtil_CreateDiagramProgressTask, 3);
- final Resource diagramResource = editingDomain.getResourceSet().createResource(diagramURI);
- final Resource modelResource = editingDomain.getResourceSet().createResource(modelURI);
- final String diagramName = diagramURI.lastSegment();
- AbstractTransactionalCommand command = new AbstractTransactionalCommand(editingDomain, Messages.UMLDiagramEditorUtil_CreateDiagramCommandLabel, Collections.EMPTY_LIST) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- Model model = createInitialModel();
- attachModelToResource(model, modelResource);
-
- Diagram diagram = ViewService.createDiagram(model, DeploymentDiagramEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- if(diagram != null) {
- diagramResource.getContents().add(diagram);
- diagram.setName(diagramName);
- diagram.setElement(model);
- }
-
- try {
- modelResource.save(org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorUtil.getSaveOptions());
- diagramResource.save(org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorUtil.getSaveOptions());
- } catch (IOException e) {
-
- UMLDiagramEditorPlugin.getInstance().logError("Unable to store model and diagram resources", e); //$NON-NLS-1$
- }
- return CommandResult.newOKCommandResult();
- }
- };
- try {
- OperationHistoryFactory.getOperationHistory().execute(command, new SubProgressMonitor(progressMonitor, 1), null);
- } catch (ExecutionException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
- }
- setCharset(WorkspaceSynchronizer.getFile(modelResource));
- setCharset(WorkspaceSynchronizer.getFile(diagramResource));
- return diagramResource;
- }
-
-
- /**
- * Create a new instance of domain element associated with canvas.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static Model createInitialModel() {
- return UMLFactory.eINSTANCE.createModel();
- }
-
-
- /**
- * Store model element in the resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static void attachModelToResource(Model model, Resource resource) {
- resource.getContents().add(model);
- }
-
-
-
-
-
- /**
- * @generated
- */
- public static void selectElementsInDiagram(IDiagramWorkbenchPart diagramPart, List<EditPart> editParts) {
- diagramPart.getDiagramGraphicalViewer().deselectAll();
-
- EditPart firstPrimary = null;
- for(EditPart nextPart : editParts) {
- diagramPart.getDiagramGraphicalViewer().appendSelection(nextPart);
- if(firstPrimary == null && nextPart instanceof IPrimaryEditPart) {
- firstPrimary = nextPart;
- }
- }
-
- if(!editParts.isEmpty()) {
- diagramPart.getDiagramGraphicalViewer().reveal(firstPrimary != null ? firstPrimary : (EditPart)editParts.get(0));
- }
- }
-
-
- /**
- * @generated
- */
- private static int findElementsInDiagramByID(DiagramEditPart diagramPart, EObject element, List<EditPart> editPartCollector) {
- IDiagramGraphicalViewer viewer = (IDiagramGraphicalViewer)diagramPart.getViewer();
- final int intialNumOfEditParts = editPartCollector.size();
-
- if(element instanceof View) { // support notation element lookup
- EditPart editPart = (EditPart)viewer.getEditPartRegistry().get(element);
- if(editPart != null) {
- editPartCollector.add(editPart);
- return 1;
- }
- }
-
- String elementID = EMFCoreUtil.getProxyID(element);
- @SuppressWarnings("unchecked")
- List<EditPart> associatedParts = viewer.findEditPartsForElement(elementID, IGraphicalEditPart.class);
- // perform the possible hierarchy disjoint -> take the top-most parts only
- for(EditPart nextPart : associatedParts) {
- EditPart parentPart = nextPart.getParent();
- while(parentPart != null && !associatedParts.contains(parentPart)) {
- parentPart = parentPart.getParent();
- }
- if(parentPart == null) {
- editPartCollector.add(nextPart);
- }
- }
-
- if(intialNumOfEditParts == editPartCollector.size()) {
- if(!associatedParts.isEmpty()) {
- editPartCollector.add(associatedParts.get(0));
- } else {
- if(element.eContainer() != null) {
- return findElementsInDiagramByID(diagramPart, element.eContainer(), editPartCollector);
- }
- }
- }
- return editPartCollector.size() - intialNumOfEditParts;
- }
-
-
- /**
- * @generated
- */
- public static View findView(DiagramEditPart diagramEditPart, EObject targetElement, LazyElement2ViewMap lazyElement2ViewMap) {
- boolean hasStructuralURI = false;
- if(targetElement.eResource() instanceof XMLResource) {
- hasStructuralURI = ((XMLResource)targetElement.eResource()).getID(targetElement) == null;
- }
-
- View view = null;
- LinkedList<EditPart> editPartHolder = new LinkedList<EditPart>();
- if(hasStructuralURI && !lazyElement2ViewMap.getElement2ViewMap().isEmpty()) {
- view = lazyElement2ViewMap.getElement2ViewMap().get(targetElement);
- } else if(findElementsInDiagramByID(diagramEditPart, targetElement, editPartHolder) > 0) {
- EditPart editPart = editPartHolder.get(0);
- view = editPart.getModel() instanceof View ? (View)editPart.getModel() : null;
- }
-
- return (view == null) ? diagramEditPart.getDiagramView() : view;
- }
-
- /**
- * XXX This is quite suspicious code (especially editPartTmpHolder) and likely to be removed soon
- * @generated
- */
- public static class LazyElement2ViewMap {
-
- /**
- * @generated
- */
- private Map<EObject, View> element2ViewMap;
-
- /**
- * @generated
- */
- private View scope;
-
- /**
- * @generated
- */
- private Set<? extends EObject> elementSet;
-
- /**
- * @generated
- */
- public LazyElement2ViewMap(View scope, Set<? extends EObject> elements) {
- this.scope = scope;
- this.elementSet = elements;
- }
-
- /**
- * @generated
- */
- public final Map<EObject, View> getElement2ViewMap() {
- if(element2ViewMap == null) {
- element2ViewMap = new HashMap<EObject, View>();
- // map possible notation elements to itself as these can't be found by view.getElement()
- for(EObject element : elementSet) {
- if(element instanceof View) {
- View view = (View)element;
- if(view.getDiagram() == scope.getDiagram()) {
- element2ViewMap.put(element, view); // take only those that part of our diagram
- }
- }
- }
-
- buildElement2ViewMap(scope, element2ViewMap, elementSet);
- }
- return element2ViewMap;
- }
-
- /**
- * @generated
- */
- private static boolean buildElement2ViewMap(View parentView, Map<EObject, View> element2ViewMap, Set<? extends EObject> elements) {
- if(elements.size() == element2ViewMap.size()) {
- return true;
- }
-
- if(parentView.isSetElement() && !element2ViewMap.containsKey(parentView.getElement()) && elements.contains(parentView.getElement())) {
- element2ViewMap.put(parentView.getElement(), parentView);
- if(elements.size() == element2ViewMap.size()) {
- return true;
- }
- }
- boolean complete = false;
- for(Iterator<?> it = parentView.getChildren().iterator(); it.hasNext() && !complete;) {
- complete = buildElement2ViewMap((View)it.next(), element2ViewMap, elements);
- }
- for(Iterator<?> it = parentView.getSourceEdges().iterator(); it.hasNext() && !complete;) {
- complete = buildElement2ViewMap((View)it.next(), element2ViewMap, elements);
- }
- for(Iterator<?> it = parentView.getTargetEdges().iterator(); it.hasNext() && !complete;) {
- complete = buildElement2ViewMap((View)it.next(), element2ViewMap, elements);
- }
- return complete;
- }
- } //LazyElement2ViewMap
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramUpdateCommand.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramUpdateCommand.java
deleted file mode 100644
index d10433dbde0..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramUpdateCommand.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.commands.IHandlerListener;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class UMLDiagramUpdateCommand implements IHandler {
-
- /**
- * @generated
- */
- public void addHandlerListener(IHandlerListener handlerListener) {
- }
-
- /**
- * @generated
- */
- public void dispose() {
- }
-
- /**
- * @generated
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- if(selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- if(structuredSelection.size() != 1) {
- return null;
- }
- if(structuredSelection.getFirstElement() instanceof EditPart && ((EditPart)structuredSelection.getFirstElement()).getModel() instanceof View) {
- EObject modelElement = ((View)((EditPart)structuredSelection.getFirstElement()).getModel()).getElement();
- List editPolicies = CanonicalEditPolicy.getRegisteredEditPolicies(modelElement);
- for(Iterator it = editPolicies.iterator(); it.hasNext();) {
- CanonicalEditPolicy nextEditPolicy = (CanonicalEditPolicy)it.next();
- nextEditPolicy.refresh();
- }
-
- }
- }
- return null;
- }
-
- /**
- * @generated
- */
- public boolean isEnabled() {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean isHandled() {
- return true;
- }
-
- /**
- * @generated
- */
- public void removeHandlerListener(IHandlerListener handlerListener) {
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramUpdater.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramUpdater.java
deleted file mode 100644
index 39db07350db..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDiagramUpdater.java
+++ /dev/null
@@ -1,1642 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.uml2.uml.Artifact;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.Deployment;
-import org.eclipse.uml2.uml.DeploymentTarget;
-import org.eclipse.uml2.uml.Device;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.ExecutionEnvironment;
-import org.eclipse.uml2.uml.Generalization;
-import org.eclipse.uml2.uml.Manifestation;
-import org.eclipse.uml2.uml.Model;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Node;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.PackageableElement;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class UMLDiagramUpdater {
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getSemanticChildren(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
- case DeploymentDiagramEditPart.VISUAL_ID:
- return getModel_1000SemanticChildren(view);
- case DeviceCompositeCompartmentEditPart.VISUAL_ID:
- return getDeviceDeviceCompositeCompartment_17SemanticChildren(view);
- case ExecutionEnvironmentCompositeCompartmentEditPart.VISUAL_ID:
- return getExecutionEnvironmentExecutionEnvironmentCompositeCompartment_18SemanticChildren(view);
- case NodeCompositeCompartmentEditPart.VISUAL_ID:
- return getNodeCompositeCompartment_19SemanticChildren(view);
- case ArtifactCompositeCompartmentEditPart.VISUAL_ID:
- return getArtifactArtifactCompositeCompartment_26SemanticChildren(view);
- case DeviceCompositeCompartmentEditPartCN.VISUAL_ID:
- return getDeviceDeviceCompositeCompartment_30SemanticChildren(view);
- case ExecutionEnvironmentCompositeCompartmentEditPartCN.VISUAL_ID:
- return getExecutionEnvironmentExecutionEnvironmentCompositeCompartment_31SemanticChildren(view);
- case NodeCompositeCompartmentEditPartCN.VISUAL_ID:
- return getNodeCompositeCompartment_32SemanticChildren(view);
- case ArtifactCompositeCompartmentEditPartCN.VISUAL_ID:
- return getArtifactArtifactCompositeCompartment_33SemanticChildren(view);
- case ArtifactCompositeCompartmentEditPartACN.VISUAL_ID:
- return getArtifactArtifactCompositeCompartment_34SemanticChildren(view);
- }
- return Collections.emptyList();
- }
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getModel_1000SemanticChildren(View view) {
- if(!view.isSetElement()) {
- return Collections.EMPTY_LIST;
- }
- Model modelElement = (Model)view.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPart.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ConstraintEditPart.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- for(Iterator<?> it = modelElement.getPackagedElements().iterator(); it.hasNext();) {
- PackageableElement childElement = (PackageableElement)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ExecutionEnvironmentEditPart.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- if(visualID == DeviceEditPart.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- if(visualID == ArtifactEditPart.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- if(visualID == NodeEditPart.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getDeviceDeviceCompositeCompartment_17SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
- return Collections.emptyList();
- }
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
- return Collections.emptyList();
- }
- Device modelElement = (Device)containerView.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getNestedNodes().iterator(); it.hasNext();) {
- Node childElement = (Node)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ExecutionEnvironmentEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getExecutionEnvironmentExecutionEnvironmentCompositeCompartment_18SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
- return Collections.emptyList();
- }
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
- return Collections.emptyList();
- }
- ExecutionEnvironment modelElement = (ExecutionEnvironment)containerView.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getNestedNodes().iterator(); it.hasNext();) {
- Node childElement = (Node)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ExecutionEnvironmentEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getNodeCompositeCompartment_19SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
- return Collections.emptyList();
- }
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
- return Collections.emptyList();
- }
- Node modelElement = (Node)containerView.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getNestedNodes().iterator(); it.hasNext();) {
- Node childElement = (Node)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DeviceEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- if(visualID == ExecutionEnvironmentEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- if(visualID == NodeEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getArtifactArtifactCompositeCompartment_26SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
- return Collections.emptyList();
- }
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
- return Collections.emptyList();
- }
- Artifact modelElement = (Artifact)containerView.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getNestedArtifacts().iterator(); it.hasNext();) {
- Artifact childElement = (Artifact)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ArtifactEditPartACN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getDeviceDeviceCompositeCompartment_30SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
- return Collections.emptyList();
- }
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
- return Collections.emptyList();
- }
- Device modelElement = (Device)containerView.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getNestedNodes().iterator(); it.hasNext();) {
- Node childElement = (Node)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ExecutionEnvironmentEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getExecutionEnvironmentExecutionEnvironmentCompositeCompartment_31SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
- return Collections.emptyList();
- }
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
- return Collections.emptyList();
- }
- ExecutionEnvironment modelElement = (ExecutionEnvironment)containerView.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- for(Iterator<?> it = modelElement.getNestedNodes().iterator(); it.hasNext();) {
- Node childElement = (Node)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ExecutionEnvironmentEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getNodeCompositeCompartment_32SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
- return Collections.emptyList();
- }
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
- return Collections.emptyList();
- }
- Node modelElement = (Node)containerView.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getNestedNodes().iterator(); it.hasNext();) {
- Node childElement = (Node)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DeviceEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- if(visualID == ExecutionEnvironmentEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- if(visualID == NodeEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getArtifactArtifactCompositeCompartment_33SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
- return Collections.emptyList();
- }
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
- return Collections.emptyList();
- }
- Artifact modelElement = (Artifact)containerView.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getNestedArtifacts().iterator(); it.hasNext();) {
- Artifact childElement = (Artifact)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ArtifactEditPartACN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
-
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getArtifactArtifactCompositeCompartment_34SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
- return Collections.emptyList();
- }
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
- return Collections.emptyList();
- }
- Artifact modelElement = (Artifact)containerView.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getNestedArtifacts().iterator(); it.hasNext();) {
- Artifact childElement = (Artifact)it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ArtifactEditPartACN.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getContainedLinks(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
- case DeploymentDiagramEditPart.VISUAL_ID:
- return getModel_1000ContainedLinks(view);
- case CommentEditPart.VISUAL_ID:
- return getComment_2001ContainedLinks(view);
- case ConstraintEditPart.VISUAL_ID:
- return getConstraint_2005ContainedLinks(view);
- case ExecutionEnvironmentEditPart.VISUAL_ID:
- return getExecutionEnvironment_2002ContainedLinks(view);
- case DeviceEditPart.VISUAL_ID:
- return getDevice_2003ContainedLinks(view);
- case ArtifactEditPart.VISUAL_ID:
- return getArtifact_2006ContainedLinks(view);
- case NodeEditPart.VISUAL_ID:
- return getNode_2008ContainedLinks(view);
- case NodeEditPartCN.VISUAL_ID:
- return getNode_23ContainedLinks(view);
- case DeviceEditPartCN.VISUAL_ID:
- return getDevice_16ContainedLinks(view);
- case ExecutionEnvironmentEditPartCN.VISUAL_ID:
- return getExecutionEnvironment_21ContainedLinks(view);
- case ArtifactEditPartCN.VISUAL_ID:
- return getArtifact_25ContainedLinks(view);
- case ArtifactEditPartACN.VISUAL_ID:
- return getArtifact_28ContainedLinks(view);
- case DeploymentEditPart.VISUAL_ID:
- return getDeployment_4001ContainedLinks(view);
- case ManifestationEditPart.VISUAL_ID:
- return getManifestation_4002ContainedLinks(view);
- case GeneralizationEditPart.VISUAL_ID:
- return getGeneralization_4003ContainedLinks(view);
- case DependencyEditPart.VISUAL_ID:
- return getDependency_4004ContainedLinks(view);
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getIncomingLinks(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
- case CommentEditPart.VISUAL_ID:
- return getComment_2001IncomingLinks(view);
- case ConstraintEditPart.VISUAL_ID:
- return getConstraint_2005IncomingLinks(view);
- case ExecutionEnvironmentEditPart.VISUAL_ID:
- return getExecutionEnvironment_2002IncomingLinks(view);
- case DeviceEditPart.VISUAL_ID:
- return getDevice_2003IncomingLinks(view);
- case ArtifactEditPart.VISUAL_ID:
- return getArtifact_2006IncomingLinks(view);
- case NodeEditPart.VISUAL_ID:
- return getNode_2008IncomingLinks(view);
- case NodeEditPartCN.VISUAL_ID:
- return getNode_23IncomingLinks(view);
- case DeviceEditPartCN.VISUAL_ID:
- return getDevice_16IncomingLinks(view);
- case ExecutionEnvironmentEditPartCN.VISUAL_ID:
- return getExecutionEnvironment_21IncomingLinks(view);
- case ArtifactEditPartCN.VISUAL_ID:
- return getArtifact_25IncomingLinks(view);
- case ArtifactEditPartACN.VISUAL_ID:
- return getArtifact_28IncomingLinks(view);
- case DeploymentEditPart.VISUAL_ID:
- return getDeployment_4001IncomingLinks(view);
- case ManifestationEditPart.VISUAL_ID:
- return getManifestation_4002IncomingLinks(view);
- case GeneralizationEditPart.VISUAL_ID:
- return getGeneralization_4003IncomingLinks(view);
- case DependencyEditPart.VISUAL_ID:
- return getDependency_4004IncomingLinks(view);
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getOutgoingLinks(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
- case CommentEditPart.VISUAL_ID:
- return getComment_2001OutgoingLinks(view);
- case ConstraintEditPart.VISUAL_ID:
- return getConstraint_2005OutgoingLinks(view);
- case ExecutionEnvironmentEditPart.VISUAL_ID:
- return getExecutionEnvironment_2002OutgoingLinks(view);
- case DeviceEditPart.VISUAL_ID:
- return getDevice_2003OutgoingLinks(view);
- case ArtifactEditPart.VISUAL_ID:
- return getArtifact_2006OutgoingLinks(view);
- case NodeEditPart.VISUAL_ID:
- return getNode_2008OutgoingLinks(view);
- case NodeEditPartCN.VISUAL_ID:
- return getNode_23OutgoingLinks(view);
- case DeviceEditPartCN.VISUAL_ID:
- return getDevice_16OutgoingLinks(view);
- case ExecutionEnvironmentEditPartCN.VISUAL_ID:
- return getExecutionEnvironment_21OutgoingLinks(view);
- case ArtifactEditPartCN.VISUAL_ID:
- return getArtifact_25OutgoingLinks(view);
- case ArtifactEditPartACN.VISUAL_ID:
- return getArtifact_28OutgoingLinks(view);
- case DeploymentEditPart.VISUAL_ID:
- return getDeployment_4001OutgoingLinks(view);
- case ManifestationEditPart.VISUAL_ID:
- return getManifestation_4002OutgoingLinks(view);
- case GeneralizationEditPart.VISUAL_ID:
- return getGeneralization_4003OutgoingLinks(view);
- case DependencyEditPart.VISUAL_ID:
- return getDependency_4004OutgoingLinks(view);
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getModel_1000ContainedLinks(View view) {
- Model modelElement = (Model)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Dependency_4004(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComment_2001ContainedLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getConstraint_2005ContainedLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getExecutionEnvironment_2002ContainedLinks(View view) {
- ExecutionEnvironment modelElement = (ExecutionEnvironment)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Generalization_4003(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getDevice_2003ContainedLinks(View view) {
- Device modelElement = (Device)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Generalization_4003(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getArtifact_2006ContainedLinks(View view) {
- Artifact modelElement = (Artifact)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Generalization_4003(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getNode_2008ContainedLinks(View view) {
- Node modelElement = (Node)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Generalization_4003(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getNode_23ContainedLinks(View view) {
- Node modelElement = (Node)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Generalization_4003(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getDevice_16ContainedLinks(View view) {
- Device modelElement = (Device)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Generalization_4003(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getExecutionEnvironment_21ContainedLinks(View view) {
- ExecutionEnvironment modelElement = (ExecutionEnvironment)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Generalization_4003(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getArtifact_25ContainedLinks(View view) {
- Artifact modelElement = (Artifact)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Generalization_4003(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getArtifact_28ContainedLinks(View view) {
- Artifact modelElement = (Artifact)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getContainedTypeModelFacetLinks_Generalization_4003(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getDeployment_4001ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getManifestation_4002ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getGeneralization_4003ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getDependency_4004ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComment_2001IncomingLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getConstraint_2005IncomingLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Deployment_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4004(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getExecutionEnvironment_2002IncomingLinks(View view) {
- ExecutionEnvironment modelElement = (ExecutionEnvironment)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Deployment_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Generalization_4003(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4004(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getDevice_2003IncomingLinks(View view) {
- Device modelElement = (Device)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Deployment_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Generalization_4003(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4004(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getArtifact_2006IncomingLinks(View view) {
- Artifact modelElement = (Artifact)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Deployment_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Generalization_4003(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4004(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getNode_2008IncomingLinks(View view) {
- Node modelElement = (Node)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Deployment_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Generalization_4003(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4004(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getNode_23IncomingLinks(View view) {
- Node modelElement = (Node)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Deployment_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Generalization_4003(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4004(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getDevice_16IncomingLinks(View view) {
- Device modelElement = (Device)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Deployment_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Generalization_4003(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4004(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getExecutionEnvironment_21IncomingLinks(View view) {
- ExecutionEnvironment modelElement = (ExecutionEnvironment)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Deployment_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Generalization_4003(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4004(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getArtifact_25IncomingLinks(View view) {
- Artifact modelElement = (Artifact)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Deployment_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Generalization_4003(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4004(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getArtifact_28IncomingLinks(View view) {
- Artifact modelElement = (Artifact)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Deployment_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Generalization_4003(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4004(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getDeployment_4001IncomingLinks(View view) {
- Deployment modelElement = (Deployment)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Deployment_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4004(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getManifestation_4002IncomingLinks(View view) {
- Manifestation modelElement = (Manifestation)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Deployment_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4004(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getGeneralization_4003IncomingLinks(View view) {
- Generalization modelElement = (Generalization)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getDependency_4004IncomingLinks(View view) {
- Dependency modelElement = (Dependency)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement, crossReferences));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Deployment_4001(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(modelElement, crossReferences));
- result.addAll(getIncomingTypeModelFacetLinks_Dependency_4004(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComment_2001OutgoingLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getConstraint_2005OutgoingLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4004(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getExecutionEnvironment_2002OutgoingLinks(View view) {
- ExecutionEnvironment modelElement = (ExecutionEnvironment)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4003(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4004(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getDevice_2003OutgoingLinks(View view) {
- Device modelElement = (Device)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4003(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4004(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getArtifact_2006OutgoingLinks(View view) {
- Artifact modelElement = (Artifact)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4003(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4004(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getNode_2008OutgoingLinks(View view) {
- Node modelElement = (Node)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4003(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4004(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getNode_23OutgoingLinks(View view) {
- Node modelElement = (Node)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4003(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4004(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getDevice_16OutgoingLinks(View view) {
- Device modelElement = (Device)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4003(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4004(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getExecutionEnvironment_21OutgoingLinks(View view) {
- ExecutionEnvironment modelElement = (ExecutionEnvironment)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4003(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4004(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getArtifact_25OutgoingLinks(View view) {
- Artifact modelElement = (Artifact)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4003(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4004(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getArtifact_28OutgoingLinks(View view) {
- Artifact modelElement = (Artifact)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4003(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4004(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getDeployment_4001OutgoingLinks(View view) {
- Deployment modelElement = (Deployment)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4004(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getManifestation_4002OutgoingLinks(View view) {
- Manifestation modelElement = (Manifestation)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4004(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getGeneralization_4003OutgoingLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getDependency_4004OutgoingLinks(View view) {
- Dependency modelElement = (Dependency)view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Deployment_4001(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4002(modelElement));
- result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4004(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Deployment_4001(DeploymentTarget container) {
- Collection result = new LinkedList();
- for(Iterator links = container.getDeployments().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Deployment) {
- continue;
- }
- Deployment link = (Deployment)linkObject;
- if(DeploymentEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Deployment_4001, DeploymentEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Manifestation_4002(Artifact container) {
- Collection result = new LinkedList();
- for(Iterator links = container.getManifestations().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Manifestation) {
- continue;
- }
- Manifestation link = (Manifestation)linkObject;
- if(ManifestationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Manifestation_4002, ManifestationEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Generalization_4003(Classifier container) {
- Collection result = new LinkedList();
- for(Iterator links = container.getGeneralizations().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Generalization) {
- continue;
- }
- Generalization link = (Generalization)linkObject;
- if(GeneralizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- Classifier dst = link.getGeneral();
- Classifier src = link.getSpecific();
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Generalization_4003, GeneralizationEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Dependency_4004(Package container) {
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Dependency) {
- continue;
- }
- Dependency link = (Dependency)linkObject;
- if(DependencyEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Dependency_4004, DependencyEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(Element target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getComment_AnnotatedElement()) {
- result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.CommentAnnotatedElement_4008, CommentAnnotatedElementEditPart.VISUAL_ID));
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(Element target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getConstraint_ConstrainedElement()) {
- result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.ConstraintConstrainedElement_4009, ConstraintConstrainedElementEditPart.VISUAL_ID));
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Deployment_4001(NamedElement target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Deployment) {
- continue;
- }
- Deployment link = (Deployment)setting.getEObject();
- if(DeploymentEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Deployment_4001, DeploymentEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Manifestation_4002(NamedElement target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Manifestation) {
- continue;
- }
- Manifestation link = (Manifestation)setting.getEObject();
- if(ManifestationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Manifestation_4002, ManifestationEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Generalization_4003(Classifier target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getGeneralization_General() || false == setting.getEObject() instanceof Generalization) {
- continue;
- }
- Generalization link = (Generalization)setting.getEObject();
- if(GeneralizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
- Classifier src = link.getSpecific();
- result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Generalization_4003, GeneralizationEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Dependency_4004(NamedElement target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- Collection<EStructuralFeature.Setting> settings = crossReferences.get(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Dependency) {
- continue;
- }
- Dependency link = (Dependency)setting.getEObject();
- if(DependencyEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Dependency_4004, DependencyEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_4008(Comment source) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> destinations = source.getAnnotatedElements().iterator(); destinations.hasNext();) {
- Element destination = (Element)destinations.next();
- result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.CommentAnnotatedElement_4008, CommentAnnotatedElementEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4009(Constraint source) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> destinations = source.getConstrainedElements().iterator(); destinations.hasNext();) {
- Element destination = (Element)destinations.next();
- result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.ConstraintConstrainedElement_4009, ConstraintConstrainedElementEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_Deployment_4001(NamedElement source) {
- DeploymentTarget container = null;
- // Find container element for the link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof DeploymentTarget) {
- container = (DeploymentTarget)element;
- }
- }
- if(container == null) {
- return Collections.emptyList();
- }
- Collection result = new LinkedList();
- for(Iterator links = container.getDeployments().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Deployment) {
- continue;
- }
- Deployment link = (Deployment)linkObject;
- if(DeploymentEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
- continue;
- }
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Deployment_4001, DeploymentEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_Manifestation_4002(NamedElement source) {
- Artifact container = null;
- // Find container element for the link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Artifact) {
- container = (Artifact)element;
- }
- }
- if(container == null) {
- return Collections.emptyList();
- }
- Collection result = new LinkedList();
- for(Iterator links = container.getManifestations().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Manifestation) {
- continue;
- }
- Manifestation link = (Manifestation)linkObject;
- if(ManifestationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
- continue;
- }
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Manifestation_4002, ManifestationEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_Generalization_4003(Classifier source) {
- Classifier container = null;
- // Find container element for the link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Classifier) {
- container = (Classifier)element;
- }
- }
- if(container == null) {
- return Collections.emptyList();
- }
- Collection result = new LinkedList();
- for(Iterator links = container.getGeneralizations().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Generalization) {
- continue;
- }
- Generalization link = (Generalization)linkObject;
- if(GeneralizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- Classifier dst = link.getGeneral();
- Classifier src = link.getSpecific();
- if(src != source) {
- continue;
- }
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Generalization_4003, GeneralizationEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
- /**
- * @generated
- */
- private static Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_Dependency_4004(NamedElement source) {
- Package container = null;
- // Find container element for the link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
- }
- }
- if(container == null) {
- return Collections.emptyList();
- }
- Collection result = new LinkedList();
- for(Iterator links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Dependency) {
- continue;
- }
- Dependency link = (Dependency)linkObject;
- if(DependencyEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
-
-
-
-
- List targets = link.getSuppliers();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
- continue;
- }
- NamedElement dst = (NamedElement)theTarget;
- List sources = link.getClients();
-
-
- Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-
- if(false == theSource instanceof NamedElement) {
- continue;
- }
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
- continue;
- }
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Dependency_4004, DependencyEditPart.VISUAL_ID));
-
-
- }
- return result;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDocumentProvider.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDocumentProvider.java
deleted file mode 100644
index e061358287f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLDocumentProvider.java
+++ /dev/null
@@ -1,974 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.MultiRule;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EContentAdapter;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.transaction.NotificationFilter;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.DiagramDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocumentProvider;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.EditorStatusCodes;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.util.DiagramIOUtil;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.part.FileEditorInput;
-
-/**
- * @generated
- */
-public class UMLDocumentProvider extends AbstractDocumentProvider implements IDiagramDocumentProvider {
-
- /**
- * @generated
- */
- protected ElementInfo createElementInfo(Object element) throws CoreException {
- if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- IEditorInput editorInput = (IEditorInput)element;
- IDiagramDocument document = (IDiagramDocument)createDocument(editorInput);
-
- ResourceSetInfo info = new ResourceSetInfo(document, editorInput);
- info.setModificationStamp(computeModificationStamp(info));
- info.fStatus = null;
- return info;
- }
-
- /**
- * @generated
- */
- protected IDocument createDocument(Object element) throws CoreException {
- if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- IDocument document = createEmptyDocument();
- setDocumentContent(document, (IEditorInput)element);
- setupDocument(element, document);
- return document;
- }
-
- /**
- * Sets up the given document as it would be provided for the given element. The
- * content of the document is not changed. This default implementation is empty.
- * Subclasses may reimplement.
- *
- * @param element the blue-print element
- * @param document the document to set up
- * @generated
- */
- protected void setupDocument(Object element, IDocument document) {
- // for subclasses
- }
-
- /**
- * @generated
- */
- private long computeModificationStamp(ResourceSetInfo info) {
- int result = 0;
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- if(file.getLocation() != null) {
- result += file.getLocation().toFile().lastModified();
- } else {
- result += file.getModificationStamp();
- }
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected IDocument createEmptyDocument() {
- DiagramDocument document = new DiagramDocument();
- document.setEditingDomain(createEditingDomain());
- return document;
- }
-
- /**
- * @generated
- */
- private TransactionalEditingDomain createEditingDomain() {
- TransactionalEditingDomain editingDomain = DiagramEditingDomainFactory.getInstance().createEditingDomain();
- editingDomain.setID("org.eclipse.papyrus.diagram.deployment.EditingDomain"); //$NON-NLS-1$
- final NotificationFilter diagramResourceModifiedFilter = NotificationFilter.createNotifierFilter(editingDomain.getResourceSet()).and(NotificationFilter.createEventTypeFilter(Notification.ADD)).and(NotificationFilter.createFeatureFilter(ResourceSet.class, ResourceSet.RESOURCE_SET__RESOURCES));
- editingDomain.getResourceSet().eAdapters().add(new Adapter() {
-
- private Notifier myTarger;
-
- public Notifier getTarget() {
- return myTarger;
- }
-
- public boolean isAdapterForType(Object type) {
- return false;
- }
-
- public void notifyChanged(Notification notification) {
- if(diagramResourceModifiedFilter.matches(notification)) {
- Object value = notification.getNewValue();
- if(value instanceof Resource) {
- ((Resource)value).setTrackingModification(true);
- }
- }
- }
-
- public void setTarget(Notifier newTarget) {
- myTarger = newTarget;
- }
-
- });
-
- return editingDomain;
- }
-
- /**
- * @generated
- */
- protected void setDocumentContent(IDocument document, IEditorInput element) throws CoreException {
- IDiagramDocument diagramDocument = (IDiagramDocument)document;
- TransactionalEditingDomain domain = diagramDocument.getEditingDomain();
- if(element instanceof FileEditorInput) {
- IStorage storage = ((FileEditorInput)element).getStorage();
- Diagram diagram = DiagramIOUtil.load(domain, storage, true, getProgressMonitor());
- document.setContent(diagram);
- } else if(element instanceof URIEditorInput) {
- URI uri = ((URIEditorInput)element).getURI();
- Resource resource = null;
- try {
- resource = domain.getResourceSet().getResource(uri.trimFragment(), false);
- if(resource == null) {
- resource = domain.getResourceSet().createResource(uri.trimFragment());
- }
- if(!resource.isLoaded()) {
- try {
- Map options = new HashMap(GMFResourceFactory.getDefaultLoadOptions());
- // @see 171060
- // options.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
- resource.load(options);
- } catch (IOException e) {
- resource.unload();
- throw e;
- }
- }
- if(uri.fragment() != null) {
- EObject rootElement = resource.getEObject(uri.fragment());
- if(rootElement instanceof Diagram) {
- document.setContent((Diagram)rootElement);
- return;
- }
- } else {
- for(Iterator it = resource.getContents().iterator(); it.hasNext();) {
- Object rootElement = it.next();
- if(rootElement instanceof Diagram) {
- document.setContent((Diagram)rootElement);
- return;
- }
- }
- }
- throw new RuntimeException(Messages.UMLDocumentProvider_NoDiagramInResourceError);
- } catch (Exception e) {
- CoreException thrownExcp = null;
- if(e instanceof CoreException) {
- thrownExcp = (CoreException)e;
- } else {
- String msg = e.getLocalizedMessage();
- thrownExcp = new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, msg != null ? msg : Messages.UMLDocumentProvider_DiagramLoadingError, e));
- }
- throw thrownExcp;
- }
- } else {
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- }
-
- /**
- * @generated
- */
- public long getModificationStamp(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- return computeModificationStamp(info);
- }
- return super.getModificationStamp(element);
- }
-
- /**
- * @generated
- */
- public boolean isDeleted(Object element) {
- IDiagramDocument document = getDiagramDocument(element);
- if(document != null) {
- Resource diagramResource = document.getDiagram().eResource();
- if(diagramResource != null) {
- IFile file = WorkspaceSynchronizer.getFile(diagramResource);
- return file == null || file.getLocation() == null || !file.getLocation().toFile().exists();
- }
- }
- return super.isDeleted(element);
- }
-
- /**
- * @generated
- */
- public ResourceSetInfo getResourceSetInfo(Object editorInput) {
- return (ResourceSetInfo)super.getElementInfo(editorInput);
- }
-
- /**
- * @generated
- */
- protected void disposeElementInfo(Object element, ElementInfo info) {
- if(info instanceof ResourceSetInfo) {
- ResourceSetInfo resourceSetInfo = (ResourceSetInfo)info;
- resourceSetInfo.dispose();
- }
- super.disposeElementInfo(element, info);
- }
-
- /**
- * @generated
- */
- protected void doValidateState(Object element, Object computationContext) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- LinkedList<IFile> files2Validate = new LinkedList<IFile>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null && file.isReadOnly()) {
- files2Validate.add(file);
- }
- }
- ResourcesPlugin.getWorkspace().validateEdit((IFile[])files2Validate.toArray(new IFile[files2Validate.size()]), computationContext);
- }
-
- super.doValidateState(element, computationContext);
- }
-
- /**
- * @generated
- */
- public boolean isReadOnly(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(info.isUpdateCache()) {
- try {
- updateCache(element);
- } catch (CoreException ex) {
- UMLDiagramEditorPlugin.getInstance().logError(Messages.UMLDocumentProvider_isModifiable, ex);
- // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.StorageDocumentProvider_isModifiable
- }
- }
- return info.isReadOnly();
- }
- return super.isReadOnly(element);
- }
-
- /**
- * @generated
- */
- public boolean isModifiable(Object element) {
- if(!isStateValidated(element)) {
- if(element instanceof FileEditorInput || element instanceof URIEditorInput) {
- return true;
- }
- }
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(info.isUpdateCache()) {
- try {
- updateCache(element);
- } catch (CoreException ex) {
- UMLDiagramEditorPlugin.getInstance().logError(Messages.UMLDocumentProvider_isModifiable, ex);
- // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.StorageDocumentProvider_isModifiable
- }
- }
- return info.isModifiable();
- }
- return super.isModifiable(element);
- }
-
- /**
- * @generated
- */
- protected void updateCache(Object element) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null && file.isReadOnly()) {
- info.setReadOnly(true);
- info.setModifiable(false);
- return;
- }
- }
- info.setReadOnly(false);
- info.setModifiable(true);
- return;
- }
- }
-
- /**
- * @generated
- */
- protected void doUpdateStateCache(Object element) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- info.setUpdateCache(true);
- }
- super.doUpdateStateCache(element);
- }
-
- /**
- * @generated
- */
- public boolean isSynchronized(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- return info.isSynchronized();
- }
- return super.isSynchronized(element);
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getResetRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(file));
- }
- }
- return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getSaveRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- rules.add(computeSchedulingRule(file));
- }
- }
- return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getSynchronizeRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().refreshRule(file));
- }
- }
- return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getValidateStateRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- LinkedList<ISchedulingRule> files = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- files.add(file);
- }
- }
- return ResourcesPlugin.getWorkspace().getRuleFactory().validateEditRule((IFile[])files.toArray(new IFile[files.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- private ISchedulingRule computeSchedulingRule(IResource toCreateOrModify) {
- if(toCreateOrModify.exists())
- return ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(toCreateOrModify);
-
- IResource parent = toCreateOrModify;
- do {
- /*
- * XXX This is a workaround for
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=67601
- * IResourceRuleFactory.createRule should iterate the hierarchy
- * itself.
- */
- toCreateOrModify = parent;
- parent = toCreateOrModify.getParent();
- } while(parent != null && !parent.exists());
-
- return ResourcesPlugin.getWorkspace().getRuleFactory().createRule(toCreateOrModify);
- }
-
- /**
- * @generated
- */
- protected void doSynchronize(Object element, IProgressMonitor monitor) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- handleElementChanged(info, nextResource, monitor);
- }
- return;
- }
- super.doSynchronize(element, monitor);
- }
-
- /**
- * @generated
- */
- protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(!overwrite && !info.isSynchronized()) {
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, IResourceStatus.OUT_OF_SYNC_LOCAL, Messages.UMLDocumentProvider_UnsynchronizedFileSaveError, null));
- }
- info.stopResourceListening();
- fireElementStateChanging(element);
- try {
- monitor.beginTask(Messages.UMLDocumentProvider_SaveDiagramTask, info.getResourceSet().getResources().size() + 1); //"Saving diagram"
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- monitor.setTaskName(NLS.bind(Messages.UMLDocumentProvider_SaveNextResourceTask, nextResource.getURI()));
- if(nextResource.isLoaded() && !info.getEditingDomain().isReadOnly(nextResource)) {
- try {
- nextResource.save(UMLDiagramEditorUtil.getSaveOptions());
- } catch (IOException e) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, EditorStatusCodes.RESOURCE_FAILURE, e.getLocalizedMessage(), null));
- }
- }
- monitor.worked(1);
- }
- monitor.done();
- info.setModificationStamp(computeModificationStamp(info));
- } catch (RuntimeException x) {
- fireElementStateChangeFailed(element);
- throw x;
- } finally {
- info.startResourceListening();
- }
- } else {
- URI newResoruceURI;
- List<IFile> affectedFiles = null;
- if(element instanceof FileEditorInput) {
- IFile newFile = ((FileEditorInput)element).getFile();
- affectedFiles = Collections.singletonList(newFile);
- newResoruceURI = URI.createPlatformResourceURI(newFile.getFullPath().toString(), true);
- } else if(element instanceof URIEditorInput) {
- newResoruceURI = ((URIEditorInput)element).getURI();
- } else {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- if(false == document instanceof IDiagramDocument) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, "Incorrect document used: " + document + " instead of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument", null)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- IDiagramDocument diagramDocument = (IDiagramDocument)document;
- final Resource newResource = diagramDocument.getEditingDomain().getResourceSet().createResource(newResoruceURI);
- final Diagram diagramCopy = (Diagram)EcoreUtil.copy(diagramDocument.getDiagram());
- try {
- new AbstractTransactionalCommand(diagramDocument.getEditingDomain(), NLS.bind(Messages.UMLDocumentProvider_SaveAsOperation, diagramCopy.getName()), affectedFiles) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- newResource.getContents().add(diagramCopy);
- return CommandResult.newOKCommandResult();
- }
- }.execute(monitor, null);
- newResource.save(UMLDiagramEditorUtil.getSaveOptions());
- } catch (ExecutionException e) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, e.getLocalizedMessage(), null));
- } catch (IOException e) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, e.getLocalizedMessage(), null));
- }
- newResource.unload();
- }
- }
-
- /**
- * @generated
- */
- protected void handleElementChanged(ResourceSetInfo info, Resource changedResource, IProgressMonitor monitor) {
- IFile file = WorkspaceSynchronizer.getFile(changedResource);
- if(file != null) {
- try {
- file.refreshLocal(IResource.DEPTH_INFINITE, monitor);
- } catch (CoreException ex) {
- UMLDiagramEditorPlugin.getInstance().logError(Messages.UMLDocumentProvider_handleElementContentChanged, ex);
- // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.FileDocumentProvider_handleElementContentChanged
- }
- }
- changedResource.unload();
-
- fireElementContentAboutToBeReplaced(info.getEditorInput());
- removeUnchangedElementListeners(info.getEditorInput(), info);
- info.fStatus = null;
- try {
- setDocumentContent(info.fDocument, info.getEditorInput());
- } catch (CoreException e) {
- info.fStatus = e.getStatus();
- }
- if(!info.fCanBeSaved) {
- info.setModificationStamp(computeModificationStamp(info));
- }
- addUnchangedElementListeners(info.getEditorInput(), info);
- fireElementContentReplaced(info.getEditorInput());
- }
-
- /**
- * @generated
- */
- protected void handleElementMoved(IEditorInput input, URI uri) {
- if(input instanceof FileEditorInput) {
- IFile newFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(URI.decode(uri.path())).removeFirstSegments(1));
- fireElementMoved(input, newFile == null ? null : new FileEditorInput(newFile));
- return;
- }
- // TODO: append suffix to the URI! (use diagram as a parameter)
- fireElementMoved(input, new URIEditorInput(uri));
- }
-
- /**
- * @generated
- */
- public IEditorInput createInputWithEditingDomain(IEditorInput editorInput, TransactionalEditingDomain domain) {
- return editorInput;
- }
-
- /**
- * @generated
- */
- public IDiagramDocument getDiagramDocument(Object element) {
- IDocument doc = getDocument(element);
- if(doc instanceof IDiagramDocument) {
- return (IDiagramDocument)doc;
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
- return null;
- }
-
- /**
- * @generated
- */
- protected class ResourceSetInfo extends ElementInfo {
-
- /**
- * @generated
- */
- private long myModificationStamp = IResource.NULL_STAMP;
-
- /**
- * @generated
- */
- private WorkspaceSynchronizer mySynchronizer;
-
- /**
- * @generated
- */
- private LinkedList<Resource> myUnSynchronizedResources = new LinkedList<Resource>();
-
- /**
- * @generated
- */
- private IDiagramDocument myDocument;
-
- /**
- * @generated
- */
- private IEditorInput myEditorInput;
-
- /**
- * @generated
- */
- private boolean myUpdateCache = true;
-
- /**
- * @generated
- */
- private boolean myModifiable = false;
-
- /**
- * @generated
- */
- private boolean myReadOnly = true;
-
- /**
- * @generated
- */
- private ResourceSetModificationListener myResourceSetListener;
-
- /**
- * @generated
- */
- public ResourceSetInfo(IDiagramDocument document, IEditorInput editorInput) {
- super(document);
- myDocument = document;
- myEditorInput = editorInput;
- startResourceListening();
- myResourceSetListener = new ResourceSetModificationListener(this);
- getResourceSet().eAdapters().add(myResourceSetListener);
- }
-
- /**
- * @generated
- */
- public long getModificationStamp() {
- return myModificationStamp;
- }
-
- /**
- * @generated
- */
- public void setModificationStamp(long modificationStamp) {
- myModificationStamp = modificationStamp;
- }
-
- /**
- * @generated
- */
- public TransactionalEditingDomain getEditingDomain() {
- return myDocument.getEditingDomain();
- }
-
- /**
- * @generated
- */
- public ResourceSet getResourceSet() {
- return getEditingDomain().getResourceSet();
- }
-
- /**
- * @generated
- */
- public Iterator<Resource> getLoadedResourcesIterator() {
- return new ArrayList<Resource>(getResourceSet().getResources()).iterator();
- }
-
- /**
- * @generated
- */
- public IEditorInput getEditorInput() {
- return myEditorInput;
- }
-
- /**
- * @generated
- */
- public void dispose() {
- stopResourceListening();
- getResourceSet().eAdapters().remove(myResourceSetListener);
- for(Iterator<Resource> it = getLoadedResourcesIterator(); it.hasNext();) {
- Resource resource = it.next();
- resource.unload();
- }
- getEditingDomain().dispose();
- }
-
- /**
- * @generated
- */
- public boolean isSynchronized() {
- return myUnSynchronizedResources.size() == 0;
- }
-
- /**
- * @generated
- */
- public void setUnSynchronized(Resource resource) {
- myUnSynchronizedResources.add(resource);
- }
-
- /**
- * @generated
- */
- public void setSynchronized(Resource resource) {
- myUnSynchronizedResources.remove(resource);
- }
-
- /**
- * @generated
- */
- public final void stopResourceListening() {
- mySynchronizer.dispose();
- mySynchronizer = null;
- }
-
- /**
- * @generated
- */
- public final void startResourceListening() {
- mySynchronizer = new WorkspaceSynchronizer(getEditingDomain(), new SynchronizerDelegate());
- }
-
- /**
- * @generated
- */
- public boolean isUpdateCache() {
- return myUpdateCache;
- }
-
- /**
- * @generated
- */
- public void setUpdateCache(boolean update) {
- myUpdateCache = update;
- }
-
- /**
- * @generated
- */
- public boolean isModifiable() {
- return myModifiable;
- }
-
- /**
- * @generated
- */
- public void setModifiable(boolean modifiable) {
- myModifiable = modifiable;
- }
-
- /**
- * @generated
- */
- public boolean isReadOnly() {
- return myReadOnly;
- }
-
- /**
- * @generated
- */
- public void setReadOnly(boolean readOnly) {
- myReadOnly = readOnly;
- }
-
- /**
- * @generated
- */
- private class SynchronizerDelegate implements WorkspaceSynchronizer.Delegate {
-
- /**
- * @generated
- */
- public void dispose() {
- }
-
- /**
- * @generated
- */
- public boolean handleResourceChanged(final Resource resource) {
- synchronized(ResourceSetInfo.this) {
- if(ResourceSetInfo.this.fCanBeSaved) {
- ResourceSetInfo.this.setUnSynchronized(resource);
- return true;
- }
- }
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- handleElementChanged(ResourceSetInfo.this, resource, null);
- }
- });
- return true;
- }
-
- /**
- * @generated
- */
- public boolean handleResourceDeleted(Resource resource) {
- synchronized(ResourceSetInfo.this) {
- if(ResourceSetInfo.this.fCanBeSaved) {
- ResourceSetInfo.this.setUnSynchronized(resource);
- return true;
- }
- }
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- fireElementDeleted(ResourceSetInfo.this.getEditorInput());
- }
- });
- return true;
- }
-
- /**
- * @generated
- */
- public boolean handleResourceMoved(Resource resource, final URI newURI) {
- synchronized(ResourceSetInfo.this) {
- if(ResourceSetInfo.this.fCanBeSaved) {
- ResourceSetInfo.this.setUnSynchronized(resource);
- return true;
- }
- }
- if(myDocument.getDiagram().eResource() == resource) {
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- handleElementMoved(ResourceSetInfo.this.getEditorInput(), newURI);
- }
- });
- } else {
- handleResourceDeleted(resource);
- }
- return true;
- }
-
- }
-
- }
-
- /**
- * @generated
- */
- private class ResourceSetModificationListener extends EContentAdapter {
-
- /**
- * @generated
- */
- private NotificationFilter myModifiedFilter;
-
- /**
- * @generated
- */
- private ResourceSetInfo myInfo;
-
- /**
- * @generated
- */
- public ResourceSetModificationListener(ResourceSetInfo info) {
- myInfo = info;
- myModifiedFilter = NotificationFilter.createEventTypeFilter(Notification.SET).or(NotificationFilter.createEventTypeFilter(Notification.UNSET)).and(NotificationFilter.createFeatureFilter(Resource.class, Resource.RESOURCE__IS_MODIFIED));
- }
-
- /**
- * @generated
- */
- public void notifyChanged(Notification notification) {
- if(notification.getNotifier() instanceof ResourceSet) {
- super.notifyChanged(notification);
- }
- if(!notification.isTouch() && myModifiedFilter.matches(notification)) {
- if(notification.getNotifier() instanceof Resource) {
- Resource resource = (Resource)notification.getNotifier();
- if(resource.isLoaded()) {
- boolean modified = false;
- for(Iterator/*<org.eclipse.emf.ecore.resource.Resource>*/it = myInfo.getLoadedResourcesIterator(); it.hasNext() && !modified;) {
- Resource nextResource = (Resource)it.next();
- if(nextResource.isLoaded()) {
- modified = nextResource.isModified();
- }
- }
- boolean dirtyStateChanged = false;
- synchronized(myInfo) {
- if(modified != myInfo.fCanBeSaved) {
- myInfo.fCanBeSaved = modified;
- dirtyStateChanged = true;
- }
- if(!resource.isModified()) {
- myInfo.setSynchronized(resource);
- }
- }
- if(dirtyStateChanged) {
- fireElementDirtyStateChanged(myInfo.getEditorInput(), modified);
-
- if(!modified) {
- myInfo.setModificationStamp(computeModificationStamp(myInfo));
- }
- }
- }
- }
- }
- }
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLInitDiagramFileAction.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLInitDiagramFileAction.java
deleted file mode 100644
index fcccaac4df9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLInitDiagramFileAction.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.common.util.WrappedException;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @generated
- */
-public class UMLInitDiagramFileAction implements IObjectActionDelegate {
-
- /**
- * @generated
- */
- private IWorkbenchPart targetPart;
-
- /**
- * @generated
- */
- private URI domainModelURI;
-
- /**
- * @generated
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.targetPart = targetPart;
- }
-
- /**
- * @generated
- */
- public void selectionChanged(IAction action, ISelection selection) {
- domainModelURI = null;
- action.setEnabled(false);
- if(selection instanceof IStructuredSelection == false || selection.isEmpty()) {
- return;
- }
- IFile file = (IFile)((IStructuredSelection)selection).getFirstElement();
- domainModelURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
- action.setEnabled(true);
- }
-
- /**
- * @generated
- */
- private Shell getShell() {
- return targetPart.getSite().getShell();
- }
-
- /**
- * @generated
- */
- public void run(IAction action) {
- TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
- ResourceSet resourceSet = editingDomain.getResourceSet();
- EObject diagramRoot = null;
- try {
- Resource resource = resourceSet.getResource(domainModelURI, true);
- diagramRoot = (EObject)resource.getContents().get(0);
- } catch (WrappedException ex) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to load resource: " + domainModelURI, ex); //$NON-NLS-1$
- }
- if(diagramRoot == null) {
- MessageDialog.openError(getShell(), Messages.InitDiagramFile_ResourceErrorDialogTitle, Messages.InitDiagramFile_ResourceErrorDialogMessage);
- return;
- }
- Wizard wizard = new UMLNewDiagramFileWizard(domainModelURI, diagramRoot, editingDomain);
- wizard.setWindowTitle(NLS.bind(Messages.InitDiagramFile_WizardTitle, DeploymentDiagramEditPart.MODEL_ID));
- UMLDiagramEditorUtil.runWizard(getShell(), wizard, "InitDiagramFile"); //$NON-NLS-1$
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLLinkDescriptor.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLLinkDescriptor.java
deleted file mode 100644
index cb4deb6527f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLLinkDescriptor.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-
-/**
- * @generated
- */
-public class UMLLinkDescriptor extends UMLNodeDescriptor {
-
- /**
- * @generated
- */
- private EObject mySource;
-
- /**
- * @generated
- */
- private EObject myDestination;
-
- /**
- * @generated
- */
- private IAdaptable mySemanticAdapter;
-
- /**
- * @generated
- */
- private UMLLinkDescriptor(EObject source, EObject destination, EObject linkElement, int linkVID) {
- super(linkElement, linkVID);
- mySource = source;
- myDestination = destination;
- }
-
- /**
- * @generated
- */
- public UMLLinkDescriptor(EObject source, EObject destination, IElementType elementType, int linkVID) {
- this(source, destination, (EObject)null, linkVID);
- final IElementType elementTypeCopy = elementType;
- mySemanticAdapter = new IAdaptable() {
-
- public Object getAdapter(Class adapter) {
- if(IElementType.class.equals(adapter)) {
- return elementTypeCopy;
- }
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public UMLLinkDescriptor(EObject source, EObject destination, EObject linkElement, IElementType elementType, int linkVID) {
- this(source, destination, linkElement, linkVID);
- final IElementType elementTypeCopy = elementType;
- mySemanticAdapter = new EObjectAdapter(linkElement) {
-
- public Object getAdapter(Class adapter) {
- if(IElementType.class.equals(adapter)) {
- return elementTypeCopy;
- }
- return super.getAdapter(adapter);
- }
- };
- }
-
- /**
- * @generated
- */
- public EObject getSource() {
- return mySource;
- }
-
- /**
- * @generated
- */
- public EObject getDestination() {
- return myDestination;
- }
-
- /**
- * @generated
- */
- public IAdaptable getSemanticAdapter() {
- return mySemanticAdapter;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLMatchingStrategy.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLMatchingStrategy.java
deleted file mode 100644
index f19776e71fb..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLMatchingStrategy.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorMatchingStrategy;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.PartInitException;
-
-/**
- * @generated
- */
-public class UMLMatchingStrategy implements IEditorMatchingStrategy {
-
- /**
- * @generated
- */
- public boolean matches(IEditorReference editorRef, IEditorInput input) {
- IEditorInput editorInput;
- try {
- editorInput = editorRef.getEditorInput();
- } catch (PartInitException e) {
- return false;
- }
-
- if(editorInput.equals(input)) {
- return true;
- }
- if(editorInput instanceof URIEditorInput && input instanceof URIEditorInput) {
- return ((URIEditorInput)editorInput).getURI().equals(((URIEditorInput)input).getURI());
- }
- return false;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLNewDiagramFileWizard.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLNewDiagramFileWizard.java
deleted file mode 100644
index 00c363c0f35..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLNewDiagramFileWizard.java
+++ /dev/null
@@ -1,161 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import java.io.IOException;
-import java.util.LinkedList;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.OperationHistoryFactory;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-
-/**
- * @generated
- */
-public class UMLNewDiagramFileWizard extends Wizard {
-
- /**
- * @generated
- */
- private WizardNewFileCreationPage myFileCreationPage;
-
- /**
- * @generated
- */
- private ModelElementSelectionPage diagramRootElementSelectionPage;
-
- /**
- * @generated
- */
- private TransactionalEditingDomain myEditingDomain;
-
- /**
- * @generated
- */
- public UMLNewDiagramFileWizard(URI domainModelURI, EObject diagramRoot, TransactionalEditingDomain editingDomain) {
- assert domainModelURI != null : "Domain model uri must be specified"; //$NON-NLS-1$
- assert diagramRoot != null : "Doagram root element must be specified"; //$NON-NLS-1$
- assert editingDomain != null : "Editing domain must be specified"; //$NON-NLS-1$
-
- myFileCreationPage = new WizardNewFileCreationPage(Messages.UMLNewDiagramFileWizard_CreationPageName, StructuredSelection.EMPTY);
- myFileCreationPage.setTitle(Messages.UMLNewDiagramFileWizard_CreationPageTitle);
- myFileCreationPage.setDescription(NLS.bind(Messages.UMLNewDiagramFileWizard_CreationPageDescription, DeploymentDiagramEditPart.MODEL_ID));
- IPath filePath;
- String fileName = URI.decode(domainModelURI.trimFileExtension().lastSegment());
- if(domainModelURI.isPlatformResource()) {
- filePath = new Path(domainModelURI.trimSegments(1).toPlatformString(true));
- } else if(domainModelURI.isFile()) {
- filePath = new Path(domainModelURI.trimSegments(1).toFileString());
- } else {
- // TODO : use some default path
- throw new IllegalArgumentException("Unsupported URI: " + domainModelURI); //$NON-NLS-1$
- }
- myFileCreationPage.setContainerFullPath(filePath);
- myFileCreationPage.setFileName(UMLDiagramEditorUtil.getUniqueFileName(filePath, fileName, "PapyrusUMLDeployment_diagram")); //$NON-NLS-1$
-
- diagramRootElementSelectionPage = new DiagramRootElementSelectionPage(Messages.UMLNewDiagramFileWizard_RootSelectionPageName);
- diagramRootElementSelectionPage.setTitle(Messages.UMLNewDiagramFileWizard_RootSelectionPageTitle);
- diagramRootElementSelectionPage.setDescription(Messages.UMLNewDiagramFileWizard_RootSelectionPageDescription);
- diagramRootElementSelectionPage.setModelElement(diagramRoot);
-
- myEditingDomain = editingDomain;
- }
-
- /**
- * @generated
- */
- public void addPages() {
- addPage(myFileCreationPage);
- addPage(diagramRootElementSelectionPage);
- }
-
- /**
- * @generated
- */
- public boolean performFinish() {
- LinkedList<IFile> affectedFiles = new LinkedList<IFile>();
- IFile diagramFile = myFileCreationPage.createNewFile();
- UMLDiagramEditorUtil.setCharset(diagramFile);
- affectedFiles.add(diagramFile);
- URI diagramModelURI = URI.createPlatformResourceURI(diagramFile.getFullPath().toString(), true);
- ResourceSet resourceSet = myEditingDomain.getResourceSet();
- final Resource diagramResource = resourceSet.createResource(diagramModelURI);
- AbstractTransactionalCommand command = new AbstractTransactionalCommand(myEditingDomain, Messages.UMLNewDiagramFileWizard_InitDiagramCommand, affectedFiles) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- int diagramVID = UMLVisualIDRegistry.getDiagramVisualID(diagramRootElementSelectionPage.getModelElement());
- if(diagramVID != DeploymentDiagramEditPart.VISUAL_ID) {
- return CommandResult.newErrorCommandResult(Messages.UMLNewDiagramFileWizard_IncorrectRootError);
- }
- Diagram diagram = ViewService.createDiagram(diagramRootElementSelectionPage.getModelElement(), DeploymentDiagramEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- diagramResource.getContents().add(diagram);
- return CommandResult.newOKCommandResult();
- }
- };
- try {
- OperationHistoryFactory.getOperationHistory().execute(command, new NullProgressMonitor(), null);
- diagramResource.save(UMLDiagramEditorUtil.getSaveOptions());
- UMLDiagramEditorUtil.openDiagram(diagramResource);
- } catch (ExecutionException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
- } catch (IOException ex) {
- UMLDiagramEditorPlugin.getInstance().logError("Save operation failed for: " + diagramModelURI, ex); //$NON-NLS-1$
- } catch (PartInitException ex) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to open editor", ex); //$NON-NLS-1$
- }
- return true;
- }
-
- /**
- * @generated
- */
- private static class DiagramRootElementSelectionPage extends ModelElementSelectionPage {
-
- /**
- * @generated
- */
- protected DiagramRootElementSelectionPage(String pageName) {
- super(pageName);
- }
-
- /**
- * @generated
- */
- protected String getSelectionTitle() {
- return Messages.UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle;
- }
-
- /**
- * @generated
- */
- protected boolean validatePage() {
- if(selectedModelElement == null) {
- setErrorMessage(Messages.UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage);
- return false;
- }
- boolean result = ViewService.getInstance().provides(new CreateDiagramViewOperation(new EObjectAdapter(selectedModelElement), DeploymentDiagramEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT));
- setErrorMessage(result ? null : Messages.UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage);
- return result;
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLNodeDescriptor.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLNodeDescriptor.java
deleted file mode 100644
index 255ef958d71..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLNodeDescriptor.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * @generated
- */
-public class UMLNodeDescriptor {
-
- /**
- * @generated
- */
- private final EObject myModelElement;
-
- /**
- * @generated
- */
- private final int myVisualID;
-
- /**
- * @generated
- */
- public UMLNodeDescriptor(EObject modelElement, int visualID) {
- myModelElement = modelElement;
- myVisualID = visualID;
- }
-
- /**
- * @generated
- */
- public EObject getModelElement() {
- return myModelElement;
- }
-
- /**
- * @generated
- */
- public int getVisualID() {
- return myVisualID;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLPaletteFactory.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLPaletteFactory.java
deleted file mode 100644
index 9833425eaac..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLPaletteFactory.java
+++ /dev/null
@@ -1,272 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.Tool;
-import org.eclipse.gmf.runtime.diagram.ui.services.palette.PaletteFactory;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.papyrus.diagram.common.service.AspectUnspecifiedTypeConnectionTool;
-import org.eclipse.papyrus.diagram.common.service.AspectUnspecifiedTypeCreationTool;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class UMLPaletteFactory extends PaletteFactory.Adapter {
-
-
-
-
-
- /**
- * @generated
- */
- private final static String DEPLOYMENT_TOOL_NODE = "deployment.tool.node"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String DEPLOYMENT_TOOL_DEVICE = "deployment.tool.device"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String DEPLOYMENT_TOOL_EXECUTIONENVIRONMENT = "deployment.tool.executionEnvironment"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String DEPLOYMENT_TOOL_ARTIFACT = "deployment.tool.artifact"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String DEPLOYMENT_TOOL_COMMENT = "deployment.tool.comment"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String DEPLOYMENT_TOOL_CONSTRAINT = "deployment.tool.constraint"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String DEPLOYMENT_TOOL_LINK = "deployment.tool.link"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String DEPLOYMENT_TOOL_DEPENDENCY = "deployment.tool.dependency"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String DEPLOYMENT_TOOL_GENERALIZATION = "deployment.tool.generalization"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String DEPLOYMENT_TOOL_DEPLOYMENT = "deployment.tool.deployment"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String DEPLOYMENT_TOOL_MANIFESTATION = "deployment.tool.manifestation"; //$NON-NLS-1$
-
-
-
- /**
- * @generated
- */
- public UMLPaletteFactory() {
-
- }
-
-
-
- /**
- * @generated
- */
- public Tool createTool(String toolId) {
- if(toolId.equals(DEPLOYMENT_TOOL_NODE)) {
- return createNodeCreationTool();
- }
- if(toolId.equals(DEPLOYMENT_TOOL_DEVICE)) {
- return createDeviceCreationTool();
- }
- if(toolId.equals(DEPLOYMENT_TOOL_EXECUTIONENVIRONMENT)) {
- return createExecutionEnvironmentCreationTool();
- }
- if(toolId.equals(DEPLOYMENT_TOOL_ARTIFACT)) {
- return createArtifactCreationTool();
- }
- if(toolId.equals(DEPLOYMENT_TOOL_COMMENT)) {
- return createCommentCreationTool();
- }
- if(toolId.equals(DEPLOYMENT_TOOL_CONSTRAINT)) {
- return createConstraintCreationTool();
- }
- if(toolId.equals(DEPLOYMENT_TOOL_LINK)) {
- return createLinkCreationTool();
- }
- if(toolId.equals(DEPLOYMENT_TOOL_DEPENDENCY)) {
- return createDependencyCreationTool();
- }
- if(toolId.equals(DEPLOYMENT_TOOL_GENERALIZATION)) {
- return createGeneralizationCreationTool();
- }
- if(toolId.equals(DEPLOYMENT_TOOL_DEPLOYMENT)) {
- return createDeploymentCreationTool();
- }
- if(toolId.equals(DEPLOYMENT_TOOL_MANIFESTATION)) {
- return createManifestationCreationTool();
- }
-
- // default return: null
- return null;
- }
-
-
-
-
- /**
- * @generated
- */
- public Object getTemplate(String templateId) {
-
- // default return: null
- return null;
- }
-
-
-
- /**
- * @generated
- */
- private Tool createNodeCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(2);
- types.add(UMLElementTypes.Node_2008);
- types.add(UMLElementTypes.Node_23);
-
- Tool tool = new AspectUnspecifiedTypeCreationTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createDeviceCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(2);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Device_16);
-
- Tool tool = new AspectUnspecifiedTypeCreationTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createExecutionEnvironmentCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(2);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
-
- Tool tool = new AspectUnspecifiedTypeCreationTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createArtifactCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(3);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Artifact_28);
-
- Tool tool = new AspectUnspecifiedTypeCreationTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createCommentCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Comment_2001);
-
- Tool tool = new AspectUnspecifiedTypeCreationTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createConstraintCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Constraint_2005);
-
- Tool tool = new AspectUnspecifiedTypeCreationTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createLinkCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(2);
- types.add(UMLElementTypes.CommentAnnotatedElement_4008);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4009);
-
- Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createDependencyCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Dependency_4004);
-
- Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createGeneralizationCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Generalization_4003);
-
- Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createDeploymentCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Deployment_4001);
-
- Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createManifestationCreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Manifestation_4002);
-
- Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
- return tool;
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLVisualIDRegistry.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLVisualIDRegistry.java
deleted file mode 100644
index 88b1e690356..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/part/UMLVisualIDRegistry.java
+++ /dev/null
@@ -1,723 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.part;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.providers.BaseViewInfo;
-import org.eclipse.papyrus.diagram.common.providers.ViewInfo;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactNameEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactNameEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentBodyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintSpecificationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceNameEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentNameEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeNameEditPartCN;
-import org.eclipse.uml2.uml.Model;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * This registry is used to determine which type of visual object should be
- * created for the corresponding Diagram, Node, ChildNode or Link represented
- * by a domain model object.
- *
- * @generated
- */
-public class UMLVisualIDRegistry {
-
- /**
- * @generated
- */
- private static final String DEBUG_KEY = "org.eclipse.papyrus.diagram.deployment/debug/visualID"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static int getVisualID(View view) {
- if(view instanceof Diagram) {
- if(DeploymentDiagramEditPart.MODEL_ID.equals(view.getType())) {
- return DeploymentDiagramEditPart.VISUAL_ID;
- } else {
- return -1;
- }
- }
- return org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry.getVisualID(view.getType());
- }
-
- /**
- * @generated
- */
- public static String getModelID(View view) {
- View diagram = view.getDiagram();
- while(view != diagram) {
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if(annotation != null) {
- return (String)annotation.getDetails().get("modelID"); //$NON-NLS-1$
- }
- view = (View)view.eContainer();
- }
- return diagram != null ? diagram.getType() : null;
- }
-
- /**
- * @generated
- */
- public static int getVisualID(String type) {
- try {
- return Integer.parseInt(type);
- } catch (NumberFormatException e) {
- if(Boolean.TRUE.toString().equalsIgnoreCase(Platform.getDebugOption(DEBUG_KEY))) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to parse view type as a visualID number: " + type);
- }
- }
- return -1;
- }
-
- /**
- * @generated
- */
- public static String getType(int visualID) {
- return Integer.toString(visualID);
- }
-
- /**
- * @generated
- */
- public static int getDiagramVisualID(EObject domainElement) {
- if(domainElement == null) {
- return -1;
- }
- if(UMLPackage.eINSTANCE.getModel().isSuperTypeOf(domainElement.eClass()) && isDiagram((Model)domainElement)) {
- return DeploymentDiagramEditPart.VISUAL_ID;
- }
-
- return -1;
- }
-
- /**
- * @generated
- */
- public static int getNodeVisualID(View containerView, EObject domainElement) {
- if(domainElement == null) {
- return -1;
- }
- String containerModelID = org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry.getModelID(containerView);
- if(!DeploymentDiagramEditPart.MODEL_ID.equals(containerModelID)) {
- return -1;
- }
- int containerVisualID;
- if(DeploymentDiagramEditPart.MODEL_ID.equals(containerModelID)) {
- containerVisualID = org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry.getVisualID(containerView);
- } else {
- if(containerView instanceof Diagram) {
- containerVisualID = DeploymentDiagramEditPart.VISUAL_ID;
- } else {
- return -1;
- }
- }
- switch(containerVisualID) {
- case DeploymentDiagramEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return CommentEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ConstraintEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ExecutionEnvironmentEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return DeviceEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ArtifactEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return NodeEditPart.VISUAL_ID;
- }
- break;
- case DeviceCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ExecutionEnvironmentEditPartCN.VISUAL_ID;
- }
- break;
- case ExecutionEnvironmentCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ExecutionEnvironmentEditPartCN.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ArtifactEditPartCN.VISUAL_ID;
- }
- break;
- case NodeCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return DeviceEditPartCN.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ExecutionEnvironmentEditPartCN.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ArtifactEditPartCN.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return NodeEditPartCN.VISUAL_ID;
- }
- break;
- case ArtifactCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ArtifactEditPartACN.VISUAL_ID;
- }
- break;
- case DeviceCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ExecutionEnvironmentEditPartCN.VISUAL_ID;
- }
- break;
- case ExecutionEnvironmentCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ArtifactEditPartCN.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ExecutionEnvironmentEditPartCN.VISUAL_ID;
- }
- break;
- case NodeCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return DeviceEditPartCN.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ExecutionEnvironmentEditPartCN.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return NodeEditPartCN.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ArtifactEditPartCN.VISUAL_ID;
- }
- break;
- case ArtifactCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ArtifactEditPartACN.VISUAL_ID;
- }
- break;
- case ArtifactCompositeCompartmentEditPartACN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ArtifactEditPartACN.VISUAL_ID;
- }
- break;
- }
- return -1;
- }
-
- /**
- * @generated
- */
- public static boolean canCreateNode(View containerView, int nodeVisualID) {
- String containerModelID = org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry.getModelID(containerView);
- if(!DeploymentDiagramEditPart.MODEL_ID.equals(containerModelID)) {
- return false;
- }
- int containerVisualID;
- if(DeploymentDiagramEditPart.MODEL_ID.equals(containerModelID)) {
- containerVisualID = org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry.getVisualID(containerView);
- } else {
- if(containerView instanceof Diagram) {
- containerVisualID = DeploymentDiagramEditPart.VISUAL_ID;
- } else {
- return false;
- }
- }
- switch(containerVisualID) {
- case DeploymentDiagramEditPart.VISUAL_ID:
- if(CommentEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ConstraintEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ExecutionEnvironmentEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(DeviceEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ArtifactEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(NodeEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case CommentEditPart.VISUAL_ID:
- if(CommentBodyEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ConstraintEditPart.VISUAL_ID:
- if(ConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ConstraintSpecificationEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ExecutionEnvironmentEditPart.VISUAL_ID:
- if(ExecutionEnvironmentNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ExecutionEnvironmentCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case DeviceEditPart.VISUAL_ID:
- if(DeviceNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(DeviceCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ArtifactEditPart.VISUAL_ID:
- if(ArtifactNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ArtifactCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case NodeEditPart.VISUAL_ID:
- if(NodeNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(NodeCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case NodeEditPartCN.VISUAL_ID:
- if(NodeNameEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(NodeCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case DeviceEditPartCN.VISUAL_ID:
- if(DeviceNameEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(DeviceCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ExecutionEnvironmentEditPartCN.VISUAL_ID:
- if(ExecutionEnvironmentNameEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ExecutionEnvironmentCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ArtifactEditPartCN.VISUAL_ID:
- if(ArtifactNameEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ArtifactCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ArtifactEditPartACN.VISUAL_ID:
- if(ArtifactNameEditPartACN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ArtifactCompositeCompartmentEditPartACN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case DeviceCompositeCompartmentEditPart.VISUAL_ID:
- if(ExecutionEnvironmentEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ExecutionEnvironmentCompositeCompartmentEditPart.VISUAL_ID:
- if(ExecutionEnvironmentEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case NodeCompositeCompartmentEditPart.VISUAL_ID:
- if(DeviceEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ExecutionEnvironmentEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(NodeEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ArtifactCompositeCompartmentEditPart.VISUAL_ID:
- if(ArtifactEditPartACN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case DeviceCompositeCompartmentEditPartCN.VISUAL_ID:
- if(ExecutionEnvironmentEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ExecutionEnvironmentCompositeCompartmentEditPartCN.VISUAL_ID:
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ExecutionEnvironmentEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case NodeCompositeCompartmentEditPartCN.VISUAL_ID:
- if(DeviceEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ExecutionEnvironmentEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(NodeEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ArtifactCompositeCompartmentEditPartCN.VISUAL_ID:
- if(ArtifactEditPartACN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ArtifactCompositeCompartmentEditPartACN.VISUAL_ID:
- if(ArtifactEditPartACN.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case DeploymentEditPart.VISUAL_ID:
- if(DeploymentNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(DeploymentAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ManifestationEditPart.VISUAL_ID:
- if(ManifestationNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ManifestationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case GeneralizationEditPart.VISUAL_ID:
- if(GeneralizationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case DependencyEditPart.VISUAL_ID:
- if(DependencyNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(DependencyAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- }
- return false;
- }
-
- /**
- * @generated
- */
- public static int getLinkWithClassVisualID(EObject domainElement) {
- if(domainElement == null) {
- return -1;
- }
- if(UMLPackage.eINSTANCE.getDeployment().isSuperTypeOf(domainElement.eClass())
-
-
-
- ) {
- return DeploymentEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getManifestation().isSuperTypeOf(domainElement.eClass())
-
-
-
- ) {
- return ManifestationEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getGeneralization().isSuperTypeOf(domainElement.eClass())
-
-
-
- ) {
- return GeneralizationEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getDependency().isSuperTypeOf(domainElement.eClass())
-
-
-
- ) {
- return DependencyEditPart.VISUAL_ID;
- }
- return -1;
- }
-
- /**
- * "User can change implementation of this method to handle some specific\n""situations not covered by default logic.\n"
- * @generated
- */
- private static boolean isDiagram(Model element) {
- return true;
- }
-
-
-
-
-
- /**
- * @generated
- */
- private static ViewInfo diagramViewInfo = null;
-
-
- /**
- * @generated
- */
- public static ViewInfo getDiagramViewInfo() {
- if(diagramViewInfo == null) {
- diagramViewInfo = getModel_1000ViewInfo();
- }
- return diagramViewInfo;
- }
-
-
-
- /**
- * @generated
- */
- protected static ViewInfo getModel_1000ViewInfo() {
- ViewInfo root = new BaseViewInfo(1000, ViewInfo.Head, "", null, null);
- ViewInfo viewInfo = null;
- ViewInfo labelInfo = null;
-
- viewInfo = new BaseViewInfo(2001, ViewInfo.Node, "Comment");
- root.addNode(1000, viewInfo);
-
- viewInfo = new BaseViewInfo(2005, ViewInfo.Node, "Constraint");
- root.addNode(1000, viewInfo);
-
- viewInfo = new BaseViewInfo(2002, ViewInfo.Node, "ExecutionEnvironment");
- root.addNode(1000, viewInfo);
-
- viewInfo = new BaseViewInfo(2003, ViewInfo.Node, "Device");
- root.addNode(1000, viewInfo);
-
- viewInfo = new BaseViewInfo(2006, ViewInfo.Node, "Artifact");
- root.addNode(1000, viewInfo);
-
- viewInfo = new BaseViewInfo(2008, ViewInfo.Node, "Node");
- root.addNode(1000, viewInfo);
-
- viewInfo = new BaseViewInfo(4005, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- viewInfo = new BaseViewInfo(4008, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- viewInfo = new BaseViewInfo(4009, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- viewInfo = new BaseViewInfo(4001, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- labelInfo = new BaseViewInfo(13, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- labelInfo = new BaseViewInfo(14, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- viewInfo = new BaseViewInfo(4002, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- labelInfo = new BaseViewInfo(10, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- labelInfo = new BaseViewInfo(11, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- viewInfo = new BaseViewInfo(4003, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- labelInfo = new BaseViewInfo(4, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- viewInfo = new BaseViewInfo(4004, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
-
- labelInfo = new BaseViewInfo(12, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- labelInfo = new BaseViewInfo(15, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
-
- viewInfo = new BaseViewInfo(23, ViewInfo.Node, "Node");
-
- root.addNode(19, viewInfo);
-
- root.addNode(32, viewInfo);
-
-
- viewInfo = new BaseViewInfo(16, ViewInfo.Node, "Device");
-
- root.addNode(19, viewInfo);
-
- root.addNode(32, viewInfo);
-
-
- viewInfo = new BaseViewInfo(21, ViewInfo.Node, "ExecutionEnvironment");
-
- root.addNode(17, viewInfo);
-
- root.addNode(18, viewInfo);
-
- root.addNode(19, viewInfo);
-
- root.addNode(30, viewInfo);
-
- root.addNode(31, viewInfo);
-
- root.addNode(32, viewInfo);
-
-
- viewInfo = new BaseViewInfo(25, ViewInfo.Node, "Artifact");
-
- root.addNode(18, viewInfo);
-
- root.addNode(19, viewInfo);
-
- root.addNode(31, viewInfo);
-
- root.addNode(32, viewInfo);
-
-
- viewInfo = new BaseViewInfo(28, ViewInfo.Node, "Artifact");
-
- root.addNode(26, viewInfo);
-
- root.addNode(33, viewInfo);
-
- root.addNode(34, viewInfo);
-
- return root;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ArtifactPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ArtifactPreferencePage.java
deleted file mode 100644
index af5ccdb7806..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ArtifactPreferencePage.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-
-/**
- * @generated
- */
-public class ArtifactPreferencePage extends AbstractPapyrusNodePreferencePage {
-
- /**
- * @generated
- */
- public static final String compartments[] = { "ArtifactCompositeCompartment" };
-
-
- /**
- * @generated
- */
- public ArtifactPreferencePage() {
- super();
- setPreferenceKey(DeploymentDiagramEditPart.MODEL_ID + "_Artifact");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String key = DeploymentDiagramEditPart.MODEL_ID + "_Artifact";
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 150);
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 50);
-
- for(String name : compartments) {
- String preferenceName = PreferenceConstantHelper.getCompartmentElementConstant(key, name, PreferenceConstantHelper.COMPARTMENT_VISIBILITY);
- store.setDefault(preferenceName, true);
- }
-
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
-
- // Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- }
-
- /**
- * @generated
- */
- @Override
- protected void initializeCompartmentsList() {
- for(String name : compartments) {
- this.compartmentsList.add(name);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/CommentPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/CommentPreferencePage.java
deleted file mode 100644
index edb1eefd8be..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/CommentPreferencePage.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-
-/**
- * @generated
- */
-public class CommentPreferencePage extends AbstractPapyrusNodePreferencePage {
-
-
-
- /**
- * @generated
- */
- public CommentPreferencePage() {
- super();
- setPreferenceKey(DeploymentDiagramEditPart.MODEL_ID + "_Comment");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String key = DeploymentDiagramEditPart.MODEL_ID + "_Comment";
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 40);
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 40);
-
-
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
-
- // Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ConstraintPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ConstraintPreferencePage.java
deleted file mode 100644
index 7e6aa930743..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ConstraintPreferencePage.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-
-/**
- * @generated
- */
-public class ConstraintPreferencePage extends AbstractPapyrusNodePreferencePage {
-
-
-
- /**
- * @generated
- */
- public ConstraintPreferencePage() {
- super();
- setPreferenceKey(DeploymentDiagramEditPart.MODEL_ID + "_Constraint");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String key = DeploymentDiagramEditPart.MODEL_ID + "_Constraint";
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 40);
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 40);
-
-
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
-
- // Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DependencyPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DependencyPreferencePage.java
deleted file mode 100644
index 1289424ba39..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DependencyPreferencePage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-/**
- * @generated
- */
-public class DependencyPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * @generated
- */
- public DependencyPreferencePage() {
- super();
- setPreferenceKey(DeploymentDiagramEditPart.MODEL_ID + "_Dependency");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DeploymentPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DeploymentPreferencePage.java
deleted file mode 100644
index 2160d86d85c..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DeploymentPreferencePage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-/**
- * @generated
- */
-public class DeploymentPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * @generated
- */
- public DeploymentPreferencePage() {
- super();
- setPreferenceKey(DeploymentDiagramEditPart.MODEL_ID + "_Deployment");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DevicePreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DevicePreferencePage.java
deleted file mode 100644
index 04ed0b94aa2..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DevicePreferencePage.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-
-/**
- * @generated
- */
-public class DevicePreferencePage extends AbstractPapyrusNodePreferencePage {
-
- /**
- * @generated
- */
- public static final String compartments[] = { "DeviceCompositeCompartment" };
-
-
- /**
- * @generated
- */
- public DevicePreferencePage() {
- super();
- setPreferenceKey(DeploymentDiagramEditPart.MODEL_ID + "_Device");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String key = DeploymentDiagramEditPart.MODEL_ID + "_Device";
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 150);
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 100);
-
- for(String name : compartments) {
- String preferenceName = PreferenceConstantHelper.getCompartmentElementConstant(key, name, PreferenceConstantHelper.COMPARTMENT_VISIBILITY);
- store.setDefault(preferenceName, true);
- }
-
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
-
- // Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- }
-
- /**
- * @generated
- */
- @Override
- protected void initializeCompartmentsList() {
- for(String name : compartments) {
- this.compartmentsList.add(name);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramAppearancePreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramAppearancePreferencePage.java
deleted file mode 100644
index 20097fb9ba6..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramAppearancePreferencePage.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramAppearancePreferencePage extends AppearancePreferencePage {
-
- /**
- * @generated
- */
- public DiagramAppearancePreferencePage() {
- setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore());
-
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramConnectionsPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramConnectionsPreferencePage.java
deleted file mode 100644
index d560eaef856..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramConnectionsPreferencePage.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.gmf.runtime.diagram.ui.preferences.ConnectionsPreferencePage;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramConnectionsPreferencePage extends ConnectionsPreferencePage {
-
- /**
- * @generated
- */
- public DiagramConnectionsPreferencePage() {
- setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore());
-
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramGeneralPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramGeneralPreferencePage.java
deleted file mode 100644
index 642bfd99f24..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramGeneralPreferencePage.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.DiagramPreferencePage;
-
-/**
- * @generated
- */
-public class DiagramGeneralPreferencePage extends DiagramPreferencePage {
-
- /**
- * @generated
- */
- public DiagramGeneralPreferencePage() {
- setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore());
- setPreferenceKey(DeploymentDiagramEditPart.MODEL_ID);
-
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramPreferenceInitializer.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramPreferenceInitializer.java
deleted file mode 100644
index 9c1c5ea183f..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramPreferenceInitializer.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer {
-
- /**
- * @generated
- */
- public void initializeDefaultPreferences() {
- IPreferenceStore store = getPreferenceStore();
-
- ExecutionEnvironmentPreferencePage.initDefaults(store);
-
-
- ArtifactPreferencePage.initDefaults(store);
-
-
- DevicePreferencePage.initDefaults(store);
-
-
- NodePreferencePage.initDefaults(store);
-
-
- ConstraintPreferencePage.initDefaults(store);
-
-
- CommentPreferencePage.initDefaults(store);
-
-
-
-
- ConstraintConstrainedElementPreferencePage.initDefaults(store);
-
-
- CommentAnnotatedElementPreferencePage.initDefaults(store);
-
-
- GeneralizationPreferencePage.initDefaults(store);
-
-
- ManifestationPreferencePage.initDefaults(store);
-
-
-
- DependencyPreferencePage.initDefaults(store);
-
-
- DeploymentPreferencePage.initDefaults(store);
-
-
- }
-
- /**
- * @generated
- */
- protected IPreferenceStore getPreferenceStore() {
- return UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramPrintingPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramPrintingPreferencePage.java
deleted file mode 100644
index 7ae9c407634..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramPrintingPreferencePage.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.gmf.runtime.diagram.ui.preferences.PrintingPreferencePage;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramPrintingPreferencePage extends PrintingPreferencePage {
-
- /**
- * @generated
- */
- public DiagramPrintingPreferencePage() {
- setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore());
-
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramRulersAndGridPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramRulersAndGridPreferencePage.java
deleted file mode 100644
index 631eac10e29..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/DiagramRulersAndGridPreferencePage.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.gmf.runtime.diagram.ui.preferences.RulerGridPreferencePage;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramRulersAndGridPreferencePage extends RulerGridPreferencePage {
-
- /**
- * @generated
- */
- public DiagramRulersAndGridPreferencePage() {
- setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore());
-
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ExecutionEnvironmentPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ExecutionEnvironmentPreferencePage.java
deleted file mode 100644
index 4117c7d656b..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ExecutionEnvironmentPreferencePage.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-
-/**
- * @generated
- */
-public class ExecutionEnvironmentPreferencePage extends AbstractPapyrusNodePreferencePage {
-
- /**
- * @generated
- */
- public static final String compartments[] = { "ExecutionEnvironmentCompositeCompartment" };
-
-
- /**
- * @generated
- */
- public ExecutionEnvironmentPreferencePage() {
- super();
- setPreferenceKey(DeploymentDiagramEditPart.MODEL_ID + "_ExecutionEnvironment");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String key = DeploymentDiagramEditPart.MODEL_ID + "_ExecutionEnvironment";
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 150);
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 100);
-
- for(String name : compartments) {
- String preferenceName = PreferenceConstantHelper.getCompartmentElementConstant(key, name, PreferenceConstantHelper.COMPARTMENT_VISIBILITY);
- store.setDefault(preferenceName, true);
- }
-
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
-
- // Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- }
-
- /**
- * @generated
- */
- @Override
- protected void initializeCompartmentsList() {
- for(String name : compartments) {
- this.compartmentsList.add(name);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/GeneralizationPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/GeneralizationPreferencePage.java
deleted file mode 100644
index 5a6a3102559..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/GeneralizationPreferencePage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-/**
- * @generated
- */
-public class GeneralizationPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * @generated
- */
- public GeneralizationPreferencePage() {
- super();
- setPreferenceKey(DeploymentDiagramEditPart.MODEL_ID + "_Generalization");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ManifestationPreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ManifestationPreferencePage.java
deleted file mode 100644
index 8a793029781..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/ManifestationPreferencePage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
-
-/**
- * @generated
- */
-public class ManifestationPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * @generated
- */
- public ManifestationPreferencePage() {
- super();
- setPreferenceKey(DeploymentDiagramEditPart.MODEL_ID + "_Manifestation");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/NodePreferencePage.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/NodePreferencePage.java
deleted file mode 100644
index f95cf047fe5..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/preferences/NodePreferencePage.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-
-/**
- * @generated
- */
-public class NodePreferencePage extends AbstractPapyrusNodePreferencePage {
-
- /**
- * @generated
- */
- public static final String compartments[] = { "CompositeCompartment" };
-
-
- /**
- * @generated
- */
- public NodePreferencePage() {
- super();
- setPreferenceKey(DeploymentDiagramEditPart.MODEL_ID + "_Node");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String key = DeploymentDiagramEditPart.MODEL_ID + "_Node";
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 150);
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 150);
-
- for(String name : compartments) {
- String preferenceName = PreferenceConstantHelper.getCompartmentElementConstant(key, name, PreferenceConstantHelper.COMPARTMENT_VISIBILITY);
- store.setDefault(preferenceName, true);
- }
-
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
-
- // Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- }
-
- /**
- * @generated
- */
- @Override
- protected void initializeCompartmentsList() {
- for(String name : compartments) {
- this.compartmentsList.add(name);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/ElementInitializers.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/ElementInitializers.java
deleted file mode 100644
index f365316c2fe..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/ElementInitializers.java
+++ /dev/null
@@ -1,325 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.providers;
-
-import org.eclipse.papyrus.diagram.common.helper.NamedElementHelper;
-import org.eclipse.papyrus.diagram.deployment.expressions.UMLOCLFactory;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.uml2.uml.Artifact;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.Deployment;
-import org.eclipse.uml2.uml.Device;
-import org.eclipse.uml2.uml.ExecutionEnvironment;
-import org.eclipse.uml2.uml.LiteralString;
-import org.eclipse.uml2.uml.Manifestation;
-import org.eclipse.uml2.uml.Node;
-import org.eclipse.uml2.uml.UMLFactory;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.ValueSpecification;
-
-/**
- * @generated
- */
-public class ElementInitializers {
-
- protected ElementInitializers() {
- // use #getInstance to access cached instance
- }
-
- /**
- * @generated
- */
- public void init_Comment_2001(Comment instance) {
- try {
- Object value_0 = body_Comment_2001(instance);
- instance.setBody((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Constraint_2005(Constraint instance) {
- try {
- Object value_0 = name_Constraint_2005(instance);
- instance.setName((String)value_0);
- Object value_1 = specification_Constraint_2005(instance);
- instance.setSpecification((ValueSpecification)value_1);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_ExecutionEnvironment_2002(ExecutionEnvironment instance) {
- try {
- Object value_0 = name_ExecutionEnvironment_2002(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Device_2003(Device instance) {
- try {
- Object value_0 = name_Device_2003(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Artifact_2006(Artifact instance) {
- try {
- Object value_0 = name_Artifact_2006(instance);
- instance.setName((String)value_0);
- Object value_1 = UMLOCLFactory.getExpression(0, UMLPackage.eINSTANCE.getArtifact(), null).evaluate(instance);
- instance.setFileName((String)value_1);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Node_2008(Node instance) {
- try {
- Object value_0 = name_Node_2008(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Node_23(Node instance) {
- try {
- Object value_0 = name_Node_23(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Device_16(Device instance) {
- try {
- Object value_0 = name_Device_16(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_ExecutionEnvironment_21(ExecutionEnvironment instance) {
- try {
- Object value_0 = name_ExecutionEnvironment_21(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Artifact_25(Artifact instance) {
- try {
- Object value_0 = name_Artifact_25(instance);
- instance.setName((String)value_0);
- Object value_1 = UMLOCLFactory.getExpression(0, UMLPackage.eINSTANCE.getArtifact(), null).evaluate(instance);
- instance.setFileName((String)value_1);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Artifact_28(Artifact instance) {
- try {
- Object value_0 = name_Artifact_28(instance);
- instance.setName((String)value_0);
- Object value_1 = UMLOCLFactory.getExpression(0, UMLPackage.eINSTANCE.getArtifact(), null).evaluate(instance);
- instance.setFileName((String)value_1);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Deployment_4001(Deployment instance) {
- try {
- Object value_0 = name_Deployment_4001(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Manifestation_4002(Manifestation instance) {
- try {
- Object value_0 = name_Manifestation_4002(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Dependency_4004(Dependency instance) {
- try {
- Object value_0 = name_Dependency_4004(instance);
- instance.setName((String)value_0);
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- private String body_Comment_2001(Comment self) {
- // Comment body init
- return "";
- }
-
- /**
- * @generated
- */
- private String name_Constraint_2005(Constraint self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private ValueSpecification specification_Constraint_2005(Constraint self) {
- // Constraint specification init
- LiteralString value = UMLFactory.eINSTANCE.createLiteralString();
- value.setValue("");
- return value;
- }
-
- /**
- * @generated
- */
- private String name_ExecutionEnvironment_2002(ExecutionEnvironment self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private String name_Device_2003(Device self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private String name_Artifact_2006(Artifact self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private String name_Node_2008(Node self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private String name_Node_23(Node self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private String name_Device_16(Device self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private String name_ExecutionEnvironment_21(ExecutionEnvironment self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private String name_Artifact_25(Artifact self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private String name_Artifact_28(Artifact self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private String name_Deployment_4001(Deployment self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private String name_Manifestation_4002(Manifestation self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
- /**
- * @generated
- */
- private String name_Dependency_4004(Dependency self) {
- return NamedElementHelper.EINSTANCE.getNewUMLElementName(self.getOwner(), self.eClass());
- }
-
-
- /**
- * @generated
- */
- public static ElementInitializers getInstance() {
- ElementInitializers cached = UMLDiagramEditorPlugin.getInstance().getElementInitializers();
- if(cached == null) {
- UMLDiagramEditorPlugin.getInstance().setElementInitializers(cached = new ElementInitializers());
- }
- return cached;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLEditPartProvider.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLEditPartProvider.java
deleted file mode 100644
index 22c608505c6..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLEditPartProvider.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.providers;
-
-import java.lang.ref.WeakReference;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.AbstractEditPartProvider;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.UMLEditPartFactory;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-
-/**
- * @generated
- */
-public class UMLEditPartProvider extends AbstractEditPartProvider {
-
- /**
- * @generated
- */
- private EditPartFactory factory;
-
- /**
- * @generated
- */
- private boolean allowCaching;
-
- /**
- * @generated
- */
- private WeakReference cachedPart;
-
- /**
- * @generated
- */
- private WeakReference cachedView;
-
- /**
- * @generated
- */
- public UMLEditPartProvider() {
- setFactory(new UMLEditPartFactory());
- setAllowCaching(true);
- }
-
- /**
- * @generated
- */
- public final EditPartFactory getFactory() {
- return factory;
- }
-
- /**
- * @generated
- */
- protected void setFactory(EditPartFactory factory) {
- this.factory = factory;
- }
-
- /**
- * @generated
- */
- public final boolean isAllowCaching() {
- return allowCaching;
- }
-
- /**
- * @generated
- */
- protected synchronized void setAllowCaching(boolean allowCaching) {
- this.allowCaching = allowCaching;
- if(!allowCaching) {
- cachedPart = null;
- cachedView = null;
- }
- }
-
- /**
- * @generated
- */
- protected IGraphicalEditPart createEditPart(View view) {
- EditPart part = factory.createEditPart(null, view);
- if(part instanceof IGraphicalEditPart) {
- return (IGraphicalEditPart)part;
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected IGraphicalEditPart getCachedPart(View view) {
- if(cachedView != null && cachedView.get() == view) {
- return (IGraphicalEditPart)cachedPart.get();
- }
- return null;
- }
-
- /**
- * @generated
- */
- public synchronized IGraphicalEditPart createGraphicEditPart(View view) {
- if(isAllowCaching()) {
- IGraphicalEditPart part = getCachedPart(view);
- cachedPart = null;
- cachedView = null;
- if(part != null) {
- return part;
- }
- }
- return createEditPart(view);
- }
-
- /**
- * @generated
- */
- public synchronized boolean provides(IOperation operation) {
- if(operation instanceof CreateGraphicEditPartOperation) {
- View view = ((IEditPartOperation)operation).getView();
- if(!DeploymentDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view))) {
- return false;
- }
- if(isAllowCaching() && getCachedPart(view) != null) {
- return true;
- }
- IGraphicalEditPart part = createEditPart(view);
- if(part != null) {
- if(isAllowCaching()) {
- cachedPart = new WeakReference(part);
- cachedView = new WeakReference(view);
- }
- return true;
- }
- }
- return false;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLElementTypes.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLElementTypes.java
deleted file mode 100644
index acee5c8c3cc..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLElementTypes.java
+++ /dev/null
@@ -1,404 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.providers;
-
-import java.util.HashSet;
-import java.util.IdentityHashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.LinkDescriptorEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class UMLElementTypes {
-
- /**
- * @generated
- */
- private UMLElementTypes() {
- }
-
- /**
- * @generated
- */
- private static Map<IElementType, ENamedElement> elements;
-
- /**
- * @generated
- */
- private static ImageRegistry imageRegistry;
-
- /**
- * @generated
- */
- private static Set<IElementType> KNOWN_ELEMENT_TYPES;
-
- /**
- * @generated
- */
- public static final IElementType Model_1000 = getElementType("org.eclipse.papyrus.diagram.deployment.Model_1000"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Comment_2001 = getElementType("org.eclipse.papyrus.diagram.deployment.Comment_2001"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Constraint_2005 = getElementType("org.eclipse.papyrus.diagram.deployment.Constraint_2005"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType ExecutionEnvironment_2002 = getElementType("org.eclipse.papyrus.diagram.deployment.ExecutionEnvironment_2002"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Device_2003 = getElementType("org.eclipse.papyrus.diagram.deployment.Device_2003"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Artifact_2006 = getElementType("org.eclipse.papyrus.diagram.deployment.Artifact_2006"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Node_2008 = getElementType("org.eclipse.papyrus.diagram.deployment.Node_2008"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Node_23 = getElementType("org.eclipse.papyrus.diagram.deployment.Node_23"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Device_16 = getElementType("org.eclipse.papyrus.diagram.deployment.Device_16"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType ExecutionEnvironment_21 = getElementType("org.eclipse.papyrus.diagram.deployment.ExecutionEnvironment_21"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Artifact_25 = getElementType("org.eclipse.papyrus.diagram.deployment.Artifact_25"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Artifact_28 = getElementType("org.eclipse.papyrus.diagram.deployment.Artifact_28"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Link_4005 = getElementType("org.eclipse.papyrus.diagram.deployment.Link_4005"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType CommentAnnotatedElement_4008 = getElementType("org.eclipse.papyrus.diagram.deployment.CommentAnnotatedElement_4006"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType ConstraintConstrainedElement_4009 = getElementType("org.eclipse.papyrus.diagram.deployment.ConstraintConstrainedElement_4007"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Deployment_4001 = getElementType("org.eclipse.papyrus.diagram.deployment.Deployment_4001"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Manifestation_4002 = getElementType("org.eclipse.papyrus.diagram.deployment.Manifestation_4002"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Generalization_4003 = getElementType("org.eclipse.papyrus.diagram.deployment.Generalization_4003"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Dependency_4004 = getElementType("org.eclipse.papyrus.diagram.deployment.Dependency_4004"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- private static ImageRegistry getImageRegistry() {
- if(imageRegistry == null) {
- imageRegistry = new ImageRegistry();
- }
- return imageRegistry;
- }
-
- /**
- * @generated
- */
- private static String getImageRegistryKey(ENamedElement element) {
- return element.getName();
- }
-
- /**
- * @generated
- */
- private static ImageDescriptor getProvidedImageDescriptor(ENamedElement element) {
- if(element instanceof EStructuralFeature) {
- EStructuralFeature feature = ((EStructuralFeature)element);
- EClass eContainingClass = feature.getEContainingClass();
- EClassifier eType = feature.getEType();
- if(eContainingClass != null && !eContainingClass.isAbstract()) {
- element = eContainingClass;
- } else if(eType instanceof EClass && !((EClass)eType).isAbstract()) {
- element = eType;
- }
- }
- if(element instanceof EClass) {
- EClass eClass = (EClass)element;
- if(!eClass.isAbstract()) {
- return UMLDiagramEditorPlugin.getInstance().getItemImageDescriptor(eClass.getEPackage().getEFactoryInstance().create(eClass));
- }
- }
- // TODO : support structural features
- return null;
- }
-
- /**
- * @generated
- */
- public static ImageDescriptor getImageDescriptor(ENamedElement element) {
- String key = getImageRegistryKey(element);
- ImageDescriptor imageDescriptor = getImageRegistry().getDescriptor(key);
- if(imageDescriptor == null) {
- imageDescriptor = getProvidedImageDescriptor(element);
- if(imageDescriptor == null) {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- getImageRegistry().put(key, imageDescriptor);
- }
- return imageDescriptor;
- }
-
- /**
- * @generated
- */
- public static Image getImage(ENamedElement element) {
- String key = getImageRegistryKey(element);
- Image image = getImageRegistry().get(key);
- if(image == null) {
- ImageDescriptor imageDescriptor = getProvidedImageDescriptor(element);
- if(imageDescriptor == null) {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- getImageRegistry().put(key, imageDescriptor);
- image = getImageRegistry().get(key);
- }
- return image;
- }
-
- /**
- * @generated
- */
- public static ImageDescriptor getImageDescriptor(IAdaptable hint) {
- ENamedElement element = getElement(hint);
- if(element == null) {
- return null;
- }
- return getImageDescriptor(element);
- }
-
- /**
- * @generated
- */
- public static Image getImage(IAdaptable hint) {
- ENamedElement element = getElement(hint);
- if(element == null) {
- return null;
- }
- return getImage(element);
- }
-
- /**
- * Returns 'type' of the ecore object associated with the hint.
- *
- * @generated
- */
- public static ENamedElement getElement(IAdaptable hint) {
- Object type = hint.getAdapter(IElementType.class);
- if(elements == null) {
- elements = new IdentityHashMap<IElementType, ENamedElement>();
-
- elements.put(Model_1000, UMLPackage.eINSTANCE.getModel());
-
-
- elements.put(Comment_2001, UMLPackage.eINSTANCE.getComment());
-
-
- elements.put(Constraint_2005, UMLPackage.eINSTANCE.getConstraint());
-
-
- elements.put(ExecutionEnvironment_2002, UMLPackage.eINSTANCE.getExecutionEnvironment());
-
-
- elements.put(Device_2003, UMLPackage.eINSTANCE.getDevice());
-
-
- elements.put(Artifact_2006, UMLPackage.eINSTANCE.getArtifact());
-
-
- elements.put(Node_2008, UMLPackage.eINSTANCE.getNode());
-
-
- elements.put(Node_23, UMLPackage.eINSTANCE.getNode());
-
-
- elements.put(Device_16, UMLPackage.eINSTANCE.getDevice());
-
-
- elements.put(ExecutionEnvironment_21, UMLPackage.eINSTANCE.getExecutionEnvironment());
-
-
- elements.put(Artifact_25, UMLPackage.eINSTANCE.getArtifact());
-
-
- elements.put(Artifact_28, UMLPackage.eINSTANCE.getArtifact());
-
- elements.put(CommentAnnotatedElement_4008, UMLPackage.eINSTANCE.getComment_AnnotatedElement());
-
- elements.put(ConstraintConstrainedElement_4009, UMLPackage.eINSTANCE.getConstraint_ConstrainedElement());
-
-
- elements.put(Deployment_4001, UMLPackage.eINSTANCE.getDeployment());
-
-
- elements.put(Manifestation_4002, UMLPackage.eINSTANCE.getManifestation());
-
-
- elements.put(Generalization_4003, UMLPackage.eINSTANCE.getGeneralization());
-
-
- elements.put(Dependency_4004, UMLPackage.eINSTANCE.getDependency());
- }
- return (ENamedElement)elements.get(type);
- }
-
- /**
- * @generated
- */
- private static IElementType getElementType(String id) {
- return ElementTypeRegistry.getInstance().getType(id);
- }
-
- /**
- * @generated
- */
- public static boolean isKnownElementType(IElementType elementType) {
- if(KNOWN_ELEMENT_TYPES == null) {
- KNOWN_ELEMENT_TYPES = new HashSet<IElementType>();
- KNOWN_ELEMENT_TYPES.add(Model_1000);
- KNOWN_ELEMENT_TYPES.add(Comment_2001);
- KNOWN_ELEMENT_TYPES.add(Constraint_2005);
- KNOWN_ELEMENT_TYPES.add(ExecutionEnvironment_2002);
- KNOWN_ELEMENT_TYPES.add(Device_2003);
- KNOWN_ELEMENT_TYPES.add(Artifact_2006);
- KNOWN_ELEMENT_TYPES.add(Node_2008);
- KNOWN_ELEMENT_TYPES.add(Node_23);
- KNOWN_ELEMENT_TYPES.add(Device_16);
- KNOWN_ELEMENT_TYPES.add(ExecutionEnvironment_21);
- KNOWN_ELEMENT_TYPES.add(Artifact_25);
- KNOWN_ELEMENT_TYPES.add(Artifact_28);
- KNOWN_ELEMENT_TYPES.add(Link_4005);
- KNOWN_ELEMENT_TYPES.add(CommentAnnotatedElement_4008);
- KNOWN_ELEMENT_TYPES.add(ConstraintConstrainedElement_4009);
- KNOWN_ELEMENT_TYPES.add(Deployment_4001);
- KNOWN_ELEMENT_TYPES.add(Manifestation_4002);
- KNOWN_ELEMENT_TYPES.add(Generalization_4003);
- KNOWN_ELEMENT_TYPES.add(Dependency_4004);
- }
- return KNOWN_ELEMENT_TYPES.contains(elementType);
- }
-
- /**
- * @generated
- */
- public static IElementType getElementType(int visualID) {
- switch(visualID) {
- case DeploymentDiagramEditPart.VISUAL_ID:
- return Model_1000;
- case CommentEditPart.VISUAL_ID:
- return Comment_2001;
- case ConstraintEditPart.VISUAL_ID:
- return Constraint_2005;
- case ExecutionEnvironmentEditPart.VISUAL_ID:
- return ExecutionEnvironment_2002;
- case DeviceEditPart.VISUAL_ID:
- return Device_2003;
- case ArtifactEditPart.VISUAL_ID:
- return Artifact_2006;
- case NodeEditPart.VISUAL_ID:
- return Node_2008;
- case NodeEditPartCN.VISUAL_ID:
- return Node_23;
- case DeviceEditPartCN.VISUAL_ID:
- return Device_16;
- case ExecutionEnvironmentEditPartCN.VISUAL_ID:
- return ExecutionEnvironment_21;
- case ArtifactEditPartCN.VISUAL_ID:
- return Artifact_25;
- case ArtifactEditPartACN.VISUAL_ID:
- return Artifact_28;
- case LinkDescriptorEditPart.VISUAL_ID:
- return Link_4005;
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return CommentAnnotatedElement_4008;
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return ConstraintConstrainedElement_4009;
- case DeploymentEditPart.VISUAL_ID:
- return Deployment_4001;
- case ManifestationEditPart.VISUAL_ID:
- return Manifestation_4002;
- case GeneralizationEditPart.VISUAL_ID:
- return Generalization_4003;
- case DependencyEditPart.VISUAL_ID:
- return Dependency_4004;
- }
- return null;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLIconProvider.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLIconProvider.java
deleted file mode 100644
index b46c5c71600..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLIconProvider.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.providers;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.ui.services.icon.GetIconOperation;
-import org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @generated
- */
-public class UMLIconProvider extends AbstractProvider implements IIconProvider {
-
- /**
- * @generated
- */
- public Image getIcon(IAdaptable hint, int flags) {
- return UMLElementTypes.getImage(hint);
- }
-
- /**
- * @generated
- */
- public boolean provides(IOperation operation) {
- if(operation instanceof GetIconOperation) {
- return ((GetIconOperation)operation).execute(this) != null;
- }
- return false;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLModelingAssistantProvider.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLModelingAssistantProvider.java
deleted file mode 100644
index 41d580444b9..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLModelingAssistantProvider.java
+++ /dev/null
@@ -1,393 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.providers;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.ui.services.modelingassistant.ModelingAssistantProvider;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.part.Messages;
-import org.eclipse.papyrus.diagram.deployment.part.UMLDiagramEditorPlugin;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
-/**
- * @generated
- */
-public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
-
- /**
- * @generated
- */
- public List getTypesForPopupBar(IAdaptable host) {
- IGraphicalEditPart editPart = (IGraphicalEditPart)host.getAdapter(IGraphicalEditPart.class);
- if(editPart instanceof DeploymentDiagramEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(6);
- types.add(UMLElementTypes.Comment_2001);
- types.add(UMLElementTypes.Constraint_2005);
- types.add(UMLElementTypes.ExecutionEnvironment_2002);
- types.add(UMLElementTypes.Device_2003);
- types.add(UMLElementTypes.Artifact_2006);
- types.add(UMLElementTypes.Node_2008);
- return types;
- }
- if(editPart instanceof DeviceCompositeCompartmentEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- return types;
- }
- if(editPart instanceof ExecutionEnvironmentCompositeCompartmentEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(2);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- return types;
- }
- if(editPart instanceof NodeCompositeCompartmentEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(4);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.Node_23);
- return types;
- }
- if(editPart instanceof ArtifactCompositeCompartmentEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Artifact_28);
- return types;
- }
- if(editPart instanceof DeviceCompositeCompartmentEditPartCN) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- return types;
- }
- if(editPart instanceof ExecutionEnvironmentCompositeCompartmentEditPartCN) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(2);
- types.add(UMLElementTypes.Artifact_25);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- return types;
- }
- if(editPart instanceof NodeCompositeCompartmentEditPartCN) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(4);
- types.add(UMLElementTypes.Device_16);
- types.add(UMLElementTypes.ExecutionEnvironment_21);
- types.add(UMLElementTypes.Node_23);
- types.add(UMLElementTypes.Artifact_25);
- return types;
- }
- if(editPart instanceof ArtifactCompositeCompartmentEditPartCN) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Artifact_28);
- return types;
- }
- if(editPart instanceof ArtifactCompositeCompartmentEditPartACN) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(UMLElementTypes.Artifact_28);
- return types;
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getRelTypesOnSource(IAdaptable source) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
- if(sourceEditPart instanceof CommentEditPart) {
- return ((CommentEditPart)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof ConstraintEditPart) {
- return ((ConstraintEditPart)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof ExecutionEnvironmentEditPart) {
- return ((ExecutionEnvironmentEditPart)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof DeviceEditPart) {
- return ((DeviceEditPart)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof ArtifactEditPart) {
- return ((ArtifactEditPart)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof NodeEditPart) {
- return ((NodeEditPart)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof NodeEditPartCN) {
- return ((NodeEditPartCN)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof DeviceEditPartCN) {
- return ((DeviceEditPartCN)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof ExecutionEnvironmentEditPartCN) {
- return ((ExecutionEnvironmentEditPartCN)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof ArtifactEditPartCN) {
- return ((ArtifactEditPartCN)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof ArtifactEditPartACN) {
- return ((ArtifactEditPartACN)sourceEditPart).getMARelTypesOnSource();
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getRelTypesOnTarget(IAdaptable target) {
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart)target.getAdapter(IGraphicalEditPart.class);
- if(targetEditPart instanceof CommentEditPart) {
- return ((CommentEditPart)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- return ((ConstraintEditPart)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- return ((ExecutionEnvironmentEditPart)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof DeviceEditPart) {
- return ((DeviceEditPart)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- return ((ArtifactEditPart)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof NodeEditPart) {
- return ((NodeEditPart)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- return ((NodeEditPartCN)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- return ((DeviceEditPartCN)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- return ((ExecutionEnvironmentEditPartCN)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- return ((ArtifactEditPartCN)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- return ((ArtifactEditPartACN)targetEditPart).getMARelTypesOnTarget();
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getRelTypesOnSourceAndTarget(IAdaptable source, IAdaptable target) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart)target.getAdapter(IGraphicalEditPart.class);
- if(sourceEditPart instanceof CommentEditPart) {
- return ((CommentEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof ConstraintEditPart) {
- return ((ConstraintEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof ExecutionEnvironmentEditPart) {
- return ((ExecutionEnvironmentEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof DeviceEditPart) {
- return ((DeviceEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof ArtifactEditPart) {
- return ((ArtifactEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof NodeEditPart) {
- return ((NodeEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof NodeEditPartCN) {
- return ((NodeEditPartCN)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof DeviceEditPartCN) {
- return ((DeviceEditPartCN)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof ExecutionEnvironmentEditPartCN) {
- return ((ExecutionEnvironmentEditPartCN)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof ArtifactEditPartCN) {
- return ((ArtifactEditPartCN)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof ArtifactEditPartACN) {
- return ((ArtifactEditPartACN)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getTypesForSource(IAdaptable target, IElementType relationshipType) {
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart)target.getAdapter(IGraphicalEditPart.class);
- if(targetEditPart instanceof CommentEditPart) {
- return ((CommentEditPart)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- return ((ConstraintEditPart)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPart) {
- return ((ExecutionEnvironmentEditPart)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof DeviceEditPart) {
- return ((DeviceEditPart)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof ArtifactEditPart) {
- return ((ArtifactEditPart)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof NodeEditPart) {
- return ((NodeEditPart)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof NodeEditPartCN) {
- return ((NodeEditPartCN)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof DeviceEditPartCN) {
- return ((DeviceEditPartCN)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof ExecutionEnvironmentEditPartCN) {
- return ((ExecutionEnvironmentEditPartCN)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof ArtifactEditPartCN) {
- return ((ArtifactEditPartCN)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof ArtifactEditPartACN) {
- return ((ArtifactEditPartACN)targetEditPart).getMATypesForSource(relationshipType);
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getTypesForTarget(IAdaptable source, IElementType relationshipType) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
- if(sourceEditPart instanceof CommentEditPart) {
- return ((CommentEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof ConstraintEditPart) {
- return ((ConstraintEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof ExecutionEnvironmentEditPart) {
- return ((ExecutionEnvironmentEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof DeviceEditPart) {
- return ((DeviceEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof ArtifactEditPart) {
- return ((ArtifactEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof NodeEditPart) {
- return ((NodeEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof NodeEditPartCN) {
- return ((NodeEditPartCN)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof DeviceEditPartCN) {
- return ((DeviceEditPartCN)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof ExecutionEnvironmentEditPartCN) {
- return ((ExecutionEnvironmentEditPartCN)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof ArtifactEditPartCN) {
- return ((ArtifactEditPartCN)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof ArtifactEditPartACN) {
- return ((ArtifactEditPartACN)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public EObject selectExistingElementForSource(IAdaptable target, IElementType relationshipType) {
- return selectExistingElement(target, getTypesForSource(target, relationshipType));
- }
-
- /**
- * @generated
- */
- public EObject selectExistingElementForTarget(IAdaptable source, IElementType relationshipType) {
- return selectExistingElement(source, getTypesForTarget(source, relationshipType));
- }
-
- /**
- * @generated
- */
- protected EObject selectExistingElement(IAdaptable host, Collection types) {
- if(types.isEmpty()) {
- return null;
- }
- IGraphicalEditPart editPart = (IGraphicalEditPart)host.getAdapter(IGraphicalEditPart.class);
- if(editPart == null) {
- return null;
- }
- Diagram diagram = (Diagram)editPart.getRoot().getContents().getModel();
- HashSet<EObject> elements = new HashSet<EObject>();
- for(Iterator<EObject> it = diagram.getElement().eAllContents(); it.hasNext();) {
- EObject element = it.next();
- if(isApplicableElement(element, types)) {
- elements.add(element);
- }
- }
- if(elements.isEmpty()) {
- return null;
- }
- return selectElement((EObject[])elements.toArray(new EObject[elements.size()]));
- }
-
- /**
- * @generated
- */
- protected boolean isApplicableElement(EObject element, Collection types) {
- IElementType type = ElementTypeRegistry.getInstance().getElementType(element);
- return types.contains(type);
- }
-
- /**
- * @generated
- */
- protected EObject selectElement(EObject[] elements) {
- Shell shell = Display.getCurrent().getActiveShell();
- ILabelProvider labelProvider = new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, labelProvider);
- dialog.setMessage(Messages.UMLModelingAssistantProviderMessage);
- dialog.setTitle(Messages.UMLModelingAssistantProviderTitle);
- dialog.setMultipleSelection(false);
- dialog.setElements(elements);
- EObject selected = null;
- if(dialog.open() == Window.OK) {
- selected = (EObject)dialog.getFirstResult();
- }
- return selected;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLParserProvider.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLParserProvider.java
deleted file mode 100644
index 4a1727f846a..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLParserProvider.java
+++ /dev/null
@@ -1,474 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.providers;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.ui.services.parser.GetParserOperation;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserProvider;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ParserHintAdapter;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.common.parser.CommentParser;
-import org.eclipse.papyrus.diagram.common.parser.ConstraintParser;
-import org.eclipse.papyrus.diagram.common.parser.stereotype.AppliedStereotypeParser;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactNameEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactNameEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentBodyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintSpecificationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceNameEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentNameEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeNameEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.parsers.MessageFormatParser;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class UMLParserProvider extends AbstractProvider implements IParserProvider {
-
- /**
- * @generated
- */
- private CommentParser commentBody_1Parser;
-
- /**
- * @generated
- */
- private IParser getCommentBody_1Parser() {
- if(commentBody_1Parser == null) {
- commentBody_1Parser = new CommentParser();
- }
- return commentBody_1Parser;
- }
-
- /**
- * @generated
- */
- private IParser constraintName_2Parser;
-
- /**
- * @generated
- */
- private IParser getConstraintName_2Parser() {
- if(constraintName_2Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- constraintName_2Parser = parser;
- }
- return constraintName_2Parser;
- }
-
- /**
- * @generated
- */
- private ConstraintParser constraintSpecification_3Parser;
-
- /**
- * @generated
- */
- private IParser getConstraintSpecification_3Parser() {
- if(constraintSpecification_3Parser == null) {
- constraintSpecification_3Parser = new ConstraintParser();
- }
- return constraintSpecification_3Parser;
- }
-
- /**
- * @generated
- */
- private IParser executionEnvironmentName_5Parser;
-
- /**
- * @generated
- */
- private IParser getExecutionEnvironmentName_5Parser() {
- if(executionEnvironmentName_5Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- executionEnvironmentName_5Parser = parser;
- }
- return executionEnvironmentName_5Parser;
- }
-
- /**
- * @generated
- */
- private IParser deviceName_6Parser;
-
- /**
- * @generated
- */
- private IParser getDeviceName_6Parser() {
- if(deviceName_6Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- deviceName_6Parser = parser;
- }
- return deviceName_6Parser;
- }
-
- /**
- * @generated
- */
- private IParser artifactName_8Parser;
-
- /**
- * @generated
- */
- private IParser getArtifactName_8Parser() {
- if(artifactName_8Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- artifactName_8Parser = parser;
- }
- return artifactName_8Parser;
- }
-
- /**
- * @generated
- */
- private IParser nodeName_9Parser;
-
- /**
- * @generated
- */
- private IParser getNodeName_9Parser() {
- if(nodeName_9Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- nodeName_9Parser = parser;
- }
- return nodeName_9Parser;
- }
-
-
- /**
- * @generated
- */
- private IParser nodeName_24Parser;
-
- /**
- * @generated
- */
- private IParser getNodeName_24Parser() {
- if(nodeName_24Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- nodeName_24Parser = parser;
- }
- return nodeName_24Parser;
- }
-
- /**
- * @generated
- */
- private IParser deviceName_20Parser;
-
- /**
- * @generated
- */
- private IParser getDeviceName_20Parser() {
- if(deviceName_20Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- deviceName_20Parser = parser;
- }
- return deviceName_20Parser;
- }
-
- /**
- * @generated
- */
- private IParser executionEnvironmentName_22Parser;
-
- /**
- * @generated
- */
- private IParser getExecutionEnvironmentName_22Parser() {
- if(executionEnvironmentName_22Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- executionEnvironmentName_22Parser = parser;
- }
- return executionEnvironmentName_22Parser;
- }
-
- /**
- * @generated
- */
- private IParser artifactName_27Parser;
-
- /**
- * @generated
- */
- private IParser getArtifactName_27Parser() {
- if(artifactName_27Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- artifactName_27Parser = parser;
- }
- return artifactName_27Parser;
- }
-
- /**
- * @generated
- */
- private IParser artifactName_29Parser;
-
- /**
- * @generated
- */
- private IParser getArtifactName_29Parser() {
- if(artifactName_29Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- artifactName_29Parser = parser;
- }
- return artifactName_29Parser;
- }
-
-
- /**
- * @generated
- */
- private IParser deploymentName_13Parser;
-
- /**
- * @generated
- */
- private IParser getDeploymentName_13Parser() {
- if(deploymentName_13Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- deploymentName_13Parser = parser;
- }
- return deploymentName_13Parser;
- }
-
- /**
- * @generated
- */
- private AppliedStereotypeParser deploymentName_14Parser;
-
- /**
- * @generated
- */
- private IParser getDeploymentName_14Parser() {
- if(deploymentName_14Parser == null) {
- deploymentName_14Parser = new AppliedStereotypeParser();
- }
- return deploymentName_14Parser;
- }
-
- /**
- * @generated
- */
- private IParser manifestationName_10Parser;
-
- /**
- * @generated
- */
- private IParser getManifestationName_10Parser() {
- if(manifestationName_10Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- manifestationName_10Parser = parser;
- }
- return manifestationName_10Parser;
- }
-
- /**
- * @generated
- */
- private AppliedStereotypeParser manifestationName_11Parser;
-
- /**
- * @generated
- */
- private IParser getManifestationName_11Parser() {
- if(manifestationName_11Parser == null) {
- manifestationName_11Parser = new AppliedStereotypeParser();
- }
- return manifestationName_11Parser;
- }
-
- /**
- * @generated
- */
- private AppliedStereotypeParser generalizationIsSubstitutable_4Parser;
-
- /**
- * @generated
- */
- private IParser getGeneralizationIsSubstitutable_4Parser() {
- if(generalizationIsSubstitutable_4Parser == null) {
- generalizationIsSubstitutable_4Parser = new AppliedStereotypeParser();
- }
- return generalizationIsSubstitutable_4Parser;
- }
-
- /**
- * @generated
- */
- private IParser dependencyName_12Parser;
-
- /**
- * @generated
- */
- private IParser getDependencyName_12Parser() {
- if(dependencyName_12Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- dependencyName_12Parser = parser;
- }
- return dependencyName_12Parser;
- }
-
- /**
- * @generated
- */
- private AppliedStereotypeParser dependencyName_15Parser;
-
- /**
- * @generated
- */
- private IParser getDependencyName_15Parser() {
- if(dependencyName_15Parser == null) {
- dependencyName_15Parser = new AppliedStereotypeParser();
- }
- return dependencyName_15Parser;
- }
-
-
- /**
- * @generated
- */
- protected IParser getParser(int visualID) {
- switch(visualID) {
- case CommentBodyEditPart.VISUAL_ID:
- return getCommentBody_1Parser();
- case ConstraintNameEditPart.VISUAL_ID:
- return getConstraintName_2Parser();
- case ConstraintSpecificationEditPart.VISUAL_ID:
- return getConstraintSpecification_3Parser();
- case ExecutionEnvironmentNameEditPart.VISUAL_ID:
- return getExecutionEnvironmentName_5Parser();
- case DeviceNameEditPart.VISUAL_ID:
- return getDeviceName_6Parser();
- case ArtifactNameEditPart.VISUAL_ID:
- return getArtifactName_8Parser();
- case NodeNameEditPart.VISUAL_ID:
- return getNodeName_9Parser();
- case NodeNameEditPartCN.VISUAL_ID:
- return getNodeName_24Parser();
- case DeviceNameEditPartCN.VISUAL_ID:
- return getDeviceName_20Parser();
- case ExecutionEnvironmentNameEditPartCN.VISUAL_ID:
- return getExecutionEnvironmentName_22Parser();
- case ArtifactNameEditPartCN.VISUAL_ID:
- return getArtifactName_27Parser();
- case ArtifactNameEditPartACN.VISUAL_ID:
- return getArtifactName_29Parser();
- case DeploymentNameEditPart.VISUAL_ID:
- return getDeploymentName_13Parser();
- case DeploymentAppliedStereotypeEditPart.VISUAL_ID:
- return getDeploymentName_14Parser();
- case ManifestationNameEditPart.VISUAL_ID:
- return getManifestationName_10Parser();
- case ManifestationAppliedStereotypeEditPart.VISUAL_ID:
- return getManifestationName_11Parser();
- case GeneralizationAppliedStereotypeEditPart.VISUAL_ID:
- return getGeneralizationIsSubstitutable_4Parser();
- case DependencyNameEditPart.VISUAL_ID:
- return getDependencyName_12Parser();
- case DependencyAppliedStereotypeEditPart.VISUAL_ID:
- return getDependencyName_15Parser();
- }
- return null;
- }
-
- /**
- * Utility method that consults ParserService
- * @generated
- */
- public static IParser getParser(IElementType type, EObject object, String parserHint) {
- return ParserService.getInstance().getParser(new HintAdapter(type, object, parserHint));
- }
-
- /**
- * @generated
- */
- public IParser getParser(IAdaptable hint) {
- String vid = (String)hint.getAdapter(String.class);
- if(vid != null) {
- return getParser(UMLVisualIDRegistry.getVisualID(vid));
- }
- View view = (View)hint.getAdapter(View.class);
- if(view != null) {
- return getParser(UMLVisualIDRegistry.getVisualID(view));
- }
- return null;
- }
-
- /**
- * @generated
- */
- public boolean provides(IOperation operation) {
- if(operation instanceof GetParserOperation) {
- IAdaptable hint = ((GetParserOperation)operation).getHint();
- if(UMLElementTypes.getElement(hint) == null) {
- return false;
- }
- return getParser(hint) != null;
- }
- return false;
- }
-
- /**
- * @generated
- */
- private static class HintAdapter extends ParserHintAdapter {
-
- /**
- * @generated
- */
- private final IElementType elementType;
-
- /**
- * @generated
- */
- public HintAdapter(IElementType type, EObject object, String parserHint) {
- super(object, parserHint);
- assert type != null;
- elementType = type;
- }
-
- /**
- * @generated
- */
- public Object getAdapter(Class adapter) {
- if(IElementType.class.equals(adapter)) {
- return elementType;
- }
- return super.getAdapter(adapter);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLViewProvider.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLViewProvider.java
deleted file mode 100644
index e575c4328be..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/providers/UMLViewProvider.java
+++ /dev/null
@@ -1,991 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.providers;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EcoreFactory;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.core.providers.IViewProvider;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.notation.Connector;
-import org.eclipse.gmf.runtime.notation.DecorationNode;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.FillStyle;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.Location;
-import org.eclipse.gmf.runtime.notation.MeasurementUnit;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.RelativeBendpoints;
-import org.eclipse.gmf.runtime.notation.Shape;
-import org.eclipse.gmf.runtime.notation.TitleStyle;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactNameEditPartACN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ArtifactNameEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentBodyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.CommentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ConstraintSpecificationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DependencyNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeploymentNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.DeviceNameEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ExecutionEnvironmentNameEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.GeneralizationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.LinkDescriptorEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationAppliedStereotypeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.ManifestationNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeCompositeCompartmentEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeNameEditPart;
-import org.eclipse.papyrus.diagram.deployment.edit.parts.NodeNameEditPartCN;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontData;
-
-/**
- * @generated
- */
-public class UMLViewProvider extends AbstractProvider implements IViewProvider {
-
- /**
- * @generated
- */
- public final boolean provides(IOperation operation) {
- if(operation instanceof CreateViewForKindOperation) {
- return provides((CreateViewForKindOperation)operation);
- }
- assert operation instanceof CreateViewOperation;
- if(operation instanceof CreateDiagramViewOperation) {
- return provides((CreateDiagramViewOperation)operation);
- } else if(operation instanceof CreateEdgeViewOperation) {
- return provides((CreateEdgeViewOperation)operation);
- } else if(operation instanceof CreateNodeViewOperation) {
- return provides((CreateNodeViewOperation)operation);
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateViewForKindOperation op) {
- /*
- if (op.getViewKind() == Node.class)
- return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
- if (op.getViewKind() == Edge.class)
- return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
- */
- return true;
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateDiagramViewOperation op) {
- return DeploymentDiagramEditPart.MODEL_ID.equals(op.getSemanticHint()) && UMLVisualIDRegistry.getDiagramVisualID(getSemanticElement(op.getSemanticAdapter())) != -1;
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateNodeViewOperation op) {
- if(op.getContainerView() == null) {
- return false;
- }
- IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
- EObject domainElement = getSemanticElement(op.getSemanticAdapter());
- int visualID;
- if(op.getSemanticHint() == null) {
- // Semantic hint is not specified. Can be a result of call from CanonicalEditPolicy.
- // In this situation there should be NO elementType, visualID will be determined
- // by VisualIDRegistry.getNodeVisualID() for domainElement.
- if(elementType != null || domainElement == null) {
- return false;
- }
- visualID = UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement);
- } else {
- visualID = UMLVisualIDRegistry.getVisualID(op.getSemanticHint());
- if(elementType != null) {
- if(!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
- return false; // foreign element type
- }
- String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
- if(!op.getSemanticHint().equals(elementTypeHint)) {
- return false; // if semantic hint is specified it should be the same as in element type
- }
- if(domainElement != null && visualID != UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
- return false; // visual id for node EClass should match visual id from element type
- }
- } else {
- if(!DeploymentDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(op.getContainerView()))) {
- return false; // foreign diagram
- }
- switch(visualID) {
- case CommentEditPart.VISUAL_ID:
- case ConstraintEditPart.VISUAL_ID:
- case ExecutionEnvironmentEditPart.VISUAL_ID:
- case DeviceEditPart.VISUAL_ID:
- case ArtifactEditPart.VISUAL_ID:
- case NodeEditPart.VISUAL_ID:
- case NodeEditPartCN.VISUAL_ID:
- case DeviceEditPartCN.VISUAL_ID:
- case ExecutionEnvironmentEditPartCN.VISUAL_ID:
- case ArtifactEditPartCN.VISUAL_ID:
- case ArtifactEditPartACN.VISUAL_ID:
- if(domainElement == null || visualID != UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
- return false; // visual id in semantic hint should match visual id for domain element
- }
- break;
- default:
- return false;
- }
- }
- }
- return CommentEditPart.VISUAL_ID == visualID || ConstraintEditPart.VISUAL_ID == visualID || ExecutionEnvironmentEditPart.VISUAL_ID == visualID || DeviceEditPart.VISUAL_ID == visualID || ArtifactEditPart.VISUAL_ID == visualID || NodeEditPart.VISUAL_ID == visualID || NodeEditPartCN.VISUAL_ID == visualID || DeviceEditPartCN.VISUAL_ID == visualID || ExecutionEnvironmentEditPartCN.VISUAL_ID == visualID || ArtifactEditPartCN.VISUAL_ID == visualID || ArtifactEditPartACN.VISUAL_ID == visualID;
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateEdgeViewOperation op) {
- IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
- if(!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
- return false; // foreign element type
- }
- String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
- if(elementTypeHint == null || (op.getSemanticHint() != null && !elementTypeHint.equals(op.getSemanticHint()))) {
- return false; // our hint is visual id and must be specified, and it should be the same as in element type
- }
- int visualID = UMLVisualIDRegistry.getVisualID(elementTypeHint);
- EObject domainElement = getSemanticElement(op.getSemanticAdapter());
- if(domainElement != null && visualID != UMLVisualIDRegistry.getLinkWithClassVisualID(domainElement)) {
- return false; // visual id for link EClass should match visual id from element type
- }
- return true;
- }
-
- /**
- * @generated
- */
- public Diagram createDiagram(IAdaptable semanticAdapter, String diagramKind, PreferencesHint preferencesHint) {
- Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
- diagram.getStyles().add(NotationFactory.eINSTANCE.createDiagramStyle());
- diagram.setType(DeploymentDiagramEditPart.MODEL_ID);
- diagram.setElement(getSemanticElement(semanticAdapter));
- diagram.setMeasurementUnit(MeasurementUnit.PIXEL_LITERAL);
- return diagram;
- }
-
- /**
- * @generated
- */
- public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
- final EObject domainElement = getSemanticElement(semanticAdapter);
- final int visualID;
- if(semanticHint == null) {
- visualID = UMLVisualIDRegistry.getNodeVisualID(containerView, domainElement);
- } else {
- visualID = UMLVisualIDRegistry.getVisualID(semanticHint);
- }
- switch(visualID) {
- case CommentEditPart.VISUAL_ID:
- return createComment_2001(domainElement, containerView, index, persisted, preferencesHint);
- case ConstraintEditPart.VISUAL_ID:
- return createConstraint_2005(domainElement, containerView, index, persisted, preferencesHint);
- case ExecutionEnvironmentEditPart.VISUAL_ID:
- return createExecutionEnvironment_2002(domainElement, containerView, index, persisted, preferencesHint);
- case DeviceEditPart.VISUAL_ID:
- return createDevice_2003(domainElement, containerView, index, persisted, preferencesHint);
- case ArtifactEditPart.VISUAL_ID:
- return createArtifact_2006(domainElement, containerView, index, persisted, preferencesHint);
- case NodeEditPart.VISUAL_ID:
- return createNode_2008(domainElement, containerView, index, persisted, preferencesHint);
- case NodeEditPartCN.VISUAL_ID:
- return createNode_23(domainElement, containerView, index, persisted, preferencesHint);
- case DeviceEditPartCN.VISUAL_ID:
- return createDevice_16(domainElement, containerView, index, persisted, preferencesHint);
- case ExecutionEnvironmentEditPartCN.VISUAL_ID:
- return createExecutionEnvironment_21(domainElement, containerView, index, persisted, preferencesHint);
- case ArtifactEditPartCN.VISUAL_ID:
- return createArtifact_25(domainElement, containerView, index, persisted, preferencesHint);
- case ArtifactEditPartACN.VISUAL_ID:
- return createArtifact_28(domainElement, containerView, index, persisted, preferencesHint);
- }
- // can't happen, provided #provides(CreateNodeViewOperation) is correct
- return null;
- }
-
- /**
- * @generated
- */
- public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
- IElementType elementType = getSemanticElementType(semanticAdapter);
- String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
- switch(UMLVisualIDRegistry.getVisualID(elementTypeHint)) {
- case LinkDescriptorEditPart.VISUAL_ID:
- return createLink_4005(containerView, index, persisted, preferencesHint);
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return createCommentAnnotatedElement_4008(containerView, index, persisted, preferencesHint);
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return createConstraintConstrainedElement_4009(containerView, index, persisted, preferencesHint);
- case DeploymentEditPart.VISUAL_ID:
- return createDeployment_4001(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
- case ManifestationEditPart.VISUAL_ID:
- return createManifestation_4002(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
- case GeneralizationEditPart.VISUAL_ID:
- return createGeneralization_4003(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
- case DependencyEditPart.VISUAL_ID:
- return createDependency_4004(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
- }
- // can never happen, provided #provides(CreateEdgeViewOperation) is correct
- return null;
- }
-
- /**
- * @generated
- */
- public Node createComment_2001(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(CommentEditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Comment");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Comment");
-
-
-
- PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Comment");
-
- Node label1 = createLabel(node, UMLVisualIDRegistry.getType(CommentBodyEditPart.VISUAL_ID));
-
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createConstraint_2005(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Constraint");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Constraint");
-
-
-
- PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Constraint");
-
- Node label2 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintNameEditPart.VISUAL_ID));
- Node label3 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintSpecificationEditPart.VISUAL_ID));
-
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createExecutionEnvironment_2002(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Node node = NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(ExecutionEnvironmentEditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "ExecutionEnvironment");
-
- Node label5 = createLabel(node, UMLVisualIDRegistry.getType(ExecutionEnvironmentNameEditPart.VISUAL_ID));
- createCompartment(node, UMLVisualIDRegistry.getType(ExecutionEnvironmentCompositeCompartmentEditPart.VISUAL_ID), false, false, false, false);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "ExecutionEnvironment");
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createDevice_2003(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Node node = NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(DeviceEditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Device");
-
- Node label6 = createLabel(node, UMLVisualIDRegistry.getType(DeviceNameEditPart.VISUAL_ID));
- createCompartment(node, UMLVisualIDRegistry.getType(DeviceCompositeCompartmentEditPart.VISUAL_ID), false, false, false, false);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Device");
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createArtifact_2006(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Node node = NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(ArtifactEditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Artifact");
-
- Node label8 = createLabel(node, UMLVisualIDRegistry.getType(ArtifactNameEditPart.VISUAL_ID));
- createCompartment(node, UMLVisualIDRegistry.getType(ArtifactCompositeCompartmentEditPart.VISUAL_ID), true, false, false, false);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Artifact");
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createNode_2008(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Node node = NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(NodeEditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Node");
-
- Node label9 = createLabel(node, UMLVisualIDRegistry.getType(NodeNameEditPart.VISUAL_ID));
- createCompartment(node, UMLVisualIDRegistry.getType(NodeCompositeCompartmentEditPart.VISUAL_ID), false, false, false, false);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Node");
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createNode_23(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Node node = NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(NodeEditPartCN.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Node");
-
- Node label24 = createLabel(node, UMLVisualIDRegistry.getType(NodeNameEditPartCN.VISUAL_ID));
- createCompartment(node, UMLVisualIDRegistry.getType(NodeCompositeCompartmentEditPartCN.VISUAL_ID), true, false, false, false);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Node");
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createDevice_16(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Node node = NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(DeviceEditPartCN.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Device");
-
- Node label20 = createLabel(node, UMLVisualIDRegistry.getType(DeviceNameEditPartCN.VISUAL_ID));
- createCompartment(node, UMLVisualIDRegistry.getType(DeviceCompositeCompartmentEditPartCN.VISUAL_ID), true, false, false, false);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Device");
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createExecutionEnvironment_21(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Node node = NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(ExecutionEnvironmentEditPartCN.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "ExecutionEnvironment");
-
- Node label22 = createLabel(node, UMLVisualIDRegistry.getType(ExecutionEnvironmentNameEditPartCN.VISUAL_ID));
- createCompartment(node, UMLVisualIDRegistry.getType(ExecutionEnvironmentCompositeCompartmentEditPartCN.VISUAL_ID), true, false, false, false);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "ExecutionEnvironment");
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createArtifact_25(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Node node = NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(ArtifactEditPartCN.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Artifact");
-
- Node label27 = createLabel(node, UMLVisualIDRegistry.getType(ArtifactNameEditPartCN.VISUAL_ID));
- createCompartment(node, UMLVisualIDRegistry.getType(ArtifactCompositeCompartmentEditPartCN.VISUAL_ID), true, false, false, false);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Artifact");
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createArtifact_28(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Node node = NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
- node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(ArtifactEditPartACN.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Artifact");
-
- Node label29 = createLabel(node, UMLVisualIDRegistry.getType(ArtifactNameEditPartACN.VISUAL_ID));
- createCompartment(node, UMLVisualIDRegistry.getType(ArtifactCompositeCompartmentEditPartACN.VISUAL_ID), true, false, false, false);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Artifact");
-
- return node;
- }
-
- /**
- * @generated
- */
- public Edge createLink_4005(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(LinkDescriptorEditPart.VISUAL_ID));
- edge.setElement(null);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Undefined");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Undefined");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Undefined");
-
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createCommentAnnotatedElement_4008(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(CommentAnnotatedElementEditPart.VISUAL_ID));
- edge.setElement(null);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "CommentAnnotatedElement");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "CommentAnnotatedElement");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "CommentAnnotatedElement");
-
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createConstraintConstrainedElement_4009(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
- edge.setElement(null);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "ConstraintConstrainedElement");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "ConstraintConstrainedElement");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "ConstraintConstrainedElement");
-
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createDeployment_4001(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(DeploymentEditPart.VISUAL_ID));
- edge.setElement(domainElement);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Deployment");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Deployment");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Deployment");
-
- Node label13 = createLabel(edge, UMLVisualIDRegistry.getType(DeploymentNameEditPart.VISUAL_ID));
- label13.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location13 = (Location)label13.getLayoutConstraint();
- location13.setX(0);
- location13.setY(60);
- Node label14 = createLabel(edge, UMLVisualIDRegistry.getType(DeploymentAppliedStereotypeEditPart.VISUAL_ID));
- label14.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location14 = (Location)label14.getLayoutConstraint();
- location14.setX(0);
- location14.setY(60);
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createManifestation_4002(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(ManifestationEditPart.VISUAL_ID));
- edge.setElement(domainElement);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Manifestation");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Manifestation");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Manifestation");
-
- Node label10 = createLabel(edge, UMLVisualIDRegistry.getType(ManifestationNameEditPart.VISUAL_ID));
- label10.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location10 = (Location)label10.getLayoutConstraint();
- location10.setX(0);
- location10.setY(60);
- Node label11 = createLabel(edge, UMLVisualIDRegistry.getType(ManifestationAppliedStereotypeEditPart.VISUAL_ID));
- label11.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location11 = (Location)label11.getLayoutConstraint();
- location11.setX(0);
- location11.setY(30);
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createGeneralization_4003(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID));
- edge.setElement(domainElement);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Generalization");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Generalization");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Generalization");
-
- Node label4 = createLabel(edge, UMLVisualIDRegistry.getType(GeneralizationAppliedStereotypeEditPart.VISUAL_ID));
- label4.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location4 = (Location)label4.getLayoutConstraint();
- location4.setX(0);
- location4.setY(60);
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createDependency_4004(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(DependencyEditPart.VISUAL_ID));
- edge.setElement(domainElement);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Dependency");
-
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Dependency");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Dependency");
-
- Node label12 = createLabel(edge, UMLVisualIDRegistry.getType(DependencyNameEditPart.VISUAL_ID));
- label12.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location12 = (Location)label12.getLayoutConstraint();
- location12.setX(0);
- location12.setY(60);
- Node label15 = createLabel(edge, UMLVisualIDRegistry.getType(DependencyAppliedStereotypeEditPart.VISUAL_ID));
- label15.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location15 = (Location)label15.getLayoutConstraint();
- location15.setX(0);
- location15.setY(60);
- return edge;
- }
-
-
-
- /**
- * @generated
- */
- protected void stampShortcut(View containerView, Node target) {
- if(!DeploymentDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
- EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
- shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
- shortcutAnnotation.getDetails().put("modelID", DeploymentDiagramEditPart.MODEL_ID); //$NON-NLS-1$
- target.getEAnnotations().add(shortcutAnnotation);
- }
- }
-
-
- /**
- * @generated
- */
- protected Node createLabel(View owner, String hint) {
- DecorationNode rv = NotationFactory.eINSTANCE.createDecorationNode();
- rv.setType(hint);
- ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true);
- return rv;
- }
-
-
- /**
- * @generated
- */
- protected Node createCompartment(View owner, String hint, boolean canCollapse, boolean hasTitle, boolean canSort, boolean canFilter) {
- //SemanticListCompartment rv = NotationFactory.eINSTANCE.createSemanticListCompartment();
- //rv.setShowTitle(showTitle);
- //rv.setCollapsed(isCollapsed);
- Node rv;
- if(canCollapse) {
- rv = NotationFactory.eINSTANCE.createBasicCompartment();
- } else {
- rv = NotationFactory.eINSTANCE.createDecorationNode();
- }
- rv.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
-
- if(hasTitle) {
- TitleStyle ts = NotationFactory.eINSTANCE.createTitleStyle();
- ts.setShowTitle(true);
- rv.getStyles().add(ts);
- }
- if(canSort) {
- rv.getStyles().add(NotationFactory.eINSTANCE.createSortingStyle());
- }
- if(canFilter) {
- rv.getStyles().add(NotationFactory.eINSTANCE.createFilteringStyle());
- }
- rv.setType(hint);
- ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true);
- return rv;
- }
-
- /**
- * @generated
- */
- protected EObject getSemanticElement(IAdaptable semanticAdapter) {
- if(semanticAdapter == null) {
- return null;
- }
- EObject eObject = (EObject)semanticAdapter.getAdapter(EObject.class);
- if(eObject != null) {
- return EMFCoreUtil.resolve(TransactionUtil.getEditingDomain(eObject), eObject);
- }
- return null;
- }
-
-
- /**
- * @generated
- */
- protected IElementType getSemanticElementType(IAdaptable semanticAdapter) {
- if(semanticAdapter == null) {
- return null;
- }
- return (IElementType)semanticAdapter.getAdapter(IElementType.class);
- }
-
-
- /**
- * @generated
- */
- private void initFontStyleFromPrefs(View view, final IPreferenceStore store, String elementName) {
- String fontConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.FONT);
- String fontColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FONT);
-
- FontStyle viewFontStyle = (FontStyle)view.getStyle(NotationPackage.Literals.FONT_STYLE);
- if(viewFontStyle != null) {
- FontData fontData = PreferenceConverter.getFontData(store, fontConstant);
- viewFontStyle.setFontName(fontData.getName());
- viewFontStyle.setFontHeight(fontData.getHeight());
- viewFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
- viewFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
-
- org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(store, fontColorConstant);
- viewFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
- }
- }
-
- /**
- * @generated
- */
- private void initForegroundFromPrefs(View view, final IPreferenceStore store, String elementName) {
- String lineColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_LINE);
- org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(store, lineColorConstant);
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
- }
-
- /**
- * @generated
- */
- private void initBackgroundFromPrefs(View view, final IPreferenceStore store, String elementName) {
- String fillColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FILL);
- String gradientColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_GRADIENT);
- String gradientPolicyConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.GRADIENT_POLICY);
-
-
- org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(store, fillColorConstant);
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
-
-
- FillStyle fillStyle = (FillStyle)view.getStyle(NotationPackage.Literals.FILL_STYLE);
- fillStyle.setFillColor(FigureUtilities.RGBToInteger(fillRGB).intValue());
-
- ;
- if(store.getBoolean(gradientPolicyConstant)) {
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(store.getString(gradientColorConstant));
- fillStyle.setGradient(gradientPreferenceConverter.getGradientData());
- fillStyle.setTransparency(gradientPreferenceConverter.getTransparency());
- }
- }
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/sheet/UMLPropertySection.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/sheet/UMLPropertySection.java
deleted file mode 100644
index d62171542b7..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/sheet/UMLPropertySection.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.sheet;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.provider.IItemPropertySource;
-import org.eclipse.emf.edit.ui.provider.PropertySource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.properties.sections.AdvancedPropertySection;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-
-/**
- * @generated
- */
-public class UMLPropertySection extends AdvancedPropertySection implements IPropertySourceProvider {
-
- /**
- * @generated
- */
- public IPropertySource getPropertySource(Object object) {
- if(object instanceof IPropertySource) {
- return (IPropertySource)object;
- }
- AdapterFactory af = getAdapterFactory(object);
- if(af != null) {
- IItemPropertySource ips = (IItemPropertySource)af.adapt(object, IItemPropertySource.class);
- if(ips != null) {
- return new PropertySource(object, ips);
- }
- }
- if(object instanceof IAdaptable) {
- return (IPropertySource)((IAdaptable)object).getAdapter(IPropertySource.class);
- }
- return null;
- }
-
-
-
- /**
- * @generated
- */
- protected IPropertySourceProvider getPropertySourceProvider() {
- return this;
- }
-
-
- /**
- * Modify/unwrap selection.
- * @generated
- */
- protected Object transformSelection(Object selected) {
-
- if(selected instanceof EditPart) {
- Object model = ((EditPart)selected).getModel();
- return model instanceof View ? ((View)model).getElement() : null;
- }
- if(selected instanceof View) {
- return ((View)selected).getElement();
- }
- if(selected instanceof IAdaptable) {
- View view = (View)((IAdaptable)selected).getAdapter(View.class);
- if(view != null) {
- return view.getElement();
- }
- }
- return selected;
- }
-
-
- /**
- * @generated
- */
- public void setInput(IWorkbenchPart part, ISelection selection) {
- if(selection.isEmpty() || false == selection instanceof StructuredSelection) {
- super.setInput(part, selection);
- return;
- }
- final StructuredSelection structuredSelection = ((StructuredSelection)selection);
- ArrayList transformedSelection = new ArrayList(structuredSelection.size());
- for(Iterator it = structuredSelection.iterator(); it.hasNext();) {
- Object r = transformSelection(it.next());
- if(r != null) {
- transformedSelection.add(r);
- }
- }
- super.setInput(part, new StructuredSelection(transformedSelection));
- }
-
-
- /**
- * @generated
- */
- protected AdapterFactory getAdapterFactory(Object object) {
- if(getEditingDomain() instanceof AdapterFactoryEditingDomain) {
- return ((AdapterFactoryEditingDomain)getEditingDomain()).getAdapterFactory();
- }
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(object);
- if(editingDomain != null) {
- return ((AdapterFactoryEditingDomain)editingDomain).getAdapterFactory();
- }
- return null;
- }
-
-
-
-}
diff --git a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/sheet/UMLSheetLabelProvider.java b/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/sheet/UMLSheetLabelProvider.java
deleted file mode 100644
index e2f21b9f5fc..00000000000
--- a/incoming/org.eclipse.papyrus.diagram.deployment/src/org/eclipse/papyrus/diagram/deployment/sheet/UMLSheetLabelProvider.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.eclipse.papyrus.diagram.deployment.sheet;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.diagram.deployment.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.diagram.deployment.providers.UMLElementTypes;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @generated
- */
-public class UMLSheetLabelProvider extends BaseLabelProvider implements ILabelProvider {
-
-
- /**
- * @generated
- */
- public String getText(Object element) {
- element = unwrap(element);
- IElementType etype = getElementType(getView(element));
- return etype == null ? "" : etype.getDisplayName();
- }
-
-
- /**
- * @generated
- */
- public Image getImage(Object element) {
- IElementType etype = getElementType(getView(unwrap(element)));
- return etype == null ? null : UMLElementTypes.getImage(etype);
- }
-
-
- /**
- * @generated
- */
- private Object unwrap(Object element) {
- if(element instanceof IStructuredSelection) {
- return ((IStructuredSelection)element).getFirstElement();
- }
- return element;
- }
-
- /**
- * @generated
- */
- private View getView(Object element) {
- if(element instanceof View) {
- return (View)element;
- }
- if(element instanceof IAdaptable) {
- return (View)((IAdaptable)element).getAdapter(View.class);
- }
- return null;
- }
-
- /**
- * @generated
- */
- private IElementType getElementType(View view) {
- // For intermediate views climb up the containment hierarchy to find the one associated with an element type.
- while(view != null) {
- int vid = UMLVisualIDRegistry.getVisualID(view);
- IElementType etype = UMLElementTypes.getElementType(vid);
- if(etype != null) {
- return etype;
- }
- view = view.eContainer() instanceof View ? (View)view.eContainer() : null;
- }
- return null;
- }
-
-
-
-}

Back to the top