Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaged Elaasar2015-12-10 14:26:30 -0500
committerGerrit Code Review @ Eclipse.org2016-03-22 09:45:02 -0400
commite8484696ad8258ca27ca5c622d037c975161ac6b (patch)
tree1640f5e2f80a242ecbc61b2a47fb0fc7fee8873c /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment
parentac3e24920a8de354a1668d76d59dd549fda9306e (diff)
downloadorg.eclipse.papyrus-e8484696ad8258ca27ca5c622d037c975161ac6b.tar.gz
org.eclipse.papyrus-e8484696ad8258ca27ca5c622d037c975161ac6b.tar.xz
org.eclipse.papyrus-e8484696ad8258ca27ca5c622d037c975161ac6b.zip
Bug 489116 - Unify diagram visualID of all diagrams in Papyrus
1. Changed the visual ids of the UML2 diagrams from numbers to meaningful names corresponding to notational cases. This was applied consistely across diagram such that similar cases get similar visual ids. Added diagram reconcilers for v1.2 to migrate older diagrams. 2. Amalgamated the UML2 diagram element types into a single model (umldi.elementtypesconfigurations). Some diagrams, like Sequence, Communication and Timing, still use extension-based configurations and will need to be migrated later. Change-Id: I7f47b25454dcd1ed81e8f3eeffc1a09a2584d316 Signed-off-by: Maged Elaasar <melaasar@gmail.com>
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/AssociationClassViewCreateCommand.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/BranchDependenctReorientCommand.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/DependencyDiamonViewCreateCommand.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/ElementToStereotypedShape.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/helpers/MultiDependencyHelper.java24
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/CustomDiagramDragDropEditPolicy.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/CustomGraphicalNodeEditPolicy.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/itemsemantic/CustomDependencyBranchSemanticEditPolicy.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/migration/DeploymentReconciler.java (renamed from plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/migration/DeploymentReconcilier.java)21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/migration/DeploymentReconcilerForCompartment.java53
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/migration/DeploymentReconciler_1_2_0.java286
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/model/DeploymentDiagram-notation.elementtypesconfigurations5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/model/DeploymentDiagram.elementtypesconfigurations144
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/model/DeploymentDiagram.gmfgen371
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/plugin.properties37
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/plugin.xml88
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartACN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactEditPart.java71
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactEditPartACN.java71
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactEditPartCN.java71
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactFloatingLabelEditPart.java294
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactFloatingLabelEditPartACN.java296
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactFloatingLabelEditPartCN.java294
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactNameEditPart.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactNameEditPartACN.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactNameEditPartCN.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentAnnotatedElementEditPart.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentBodyEditPart.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentBodyEditPartCN.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentEditPart.java34
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentEditPartCN.java34
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommunicationPathAppliedStereotypeEditPart.java284
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommunicationPathEditPart.java24
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommunicationPathNameEditPart.java283
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintConstrainedElementEditPart.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintEditPart.java40
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintEditPartCN.java40
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintNameEditPart.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintNameEditPartCN.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPart.java286
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPartCN.java288
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DefaultNamedElementEditPart.java37
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DefaultNamedElementNameEditPart.java296
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DependencyAppliedStereotypeEditPart.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DependencyBranchEditPart.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DependencyEditPart.java24
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DependencyNameEditPart.java282
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DependencyNodeEditPart.java27
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentAppliedStereotypeEditPart.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentDiagramEditPart.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentEditPart.java24
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentNameEditPart.java282
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentSpecAsClassifierEditPart.java54
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentSpecAsClassifierFloatingLabelEditPart.java296
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentSpecAsClassifierNameEditPart.java289
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentSpecAsNestedArtifactEditPart.java57
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentSpecAsNestedArtifactFloatingLabelEditPart.java296
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentSpecAsNestedArtifactNameEditPart.java288
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentSpecAsPackageableElEditPart.java54
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentSpecAsPackageableElFloatingLabelEditPart.java296
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentSpecAsPackageableElNameEditPart.java288
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentSpecificationEditPart.java54
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentSpecificationFloatingLabelEditPart.java296
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeploymentSpecificationNameEditPart.java289
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeviceEditPart.java51
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeviceEditPartCN.java40
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeviceNameEditPart.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeviceNameEditPartCN.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ExecutionEnvironmentEditPart.java51
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ExecutionEnvironmentEditPartCN.java40
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ExecutionEnvironmentNameEditPart.java289
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ExecutionEnvironmentNameEditPartCN.java289
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/GeneralizationAppliedStereotypeEditPart.java280
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/GeneralizationEditPart.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/LinkDescriptorEditPart.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ManifestationAppliedStereotypeEditPart.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ManifestationEditPart.java24
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ManifestationNameEditPart.java282
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ModelEditPart.java48
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ModelEditPartCN.java48
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ModelNameEditPart.java295
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ModelNameEditPartCN.java294
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ModelPackageableElementCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ModelPackageableElementCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/MultiDependencyLabelEditPart.java294
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NestedArtifactNameEditPart.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NestedArtifactNodeEditPartCN.java39
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NestedDeviceEditPartCN.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NestedDeviceNameEditPartCN.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NestedExecutionEnvironmentEditPartCN.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NestedExecutionEnvironmentNameEditPartCN.java288
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NestedNodeEditPartCN.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NestedNodeNameEditPart.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NodeCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NodeCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NodeEditPart.java51
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NodeEditPartCN.java40
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NodeNameEditPart.java286
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NodeNameEditPartCN.java285
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/PackageEditPart.java48
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/PackageEditPartCN.java48
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/PackageNameEditPart.java294
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/PackageNameEditPartCN.java294
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/PackagePackageableElementCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/PackagePackageableElementCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/UMLEditPartFactory.java113
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/policies/UMLBaseItemSemanticEditPolicy.java239
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/policies/UMLTextNonResizableEditPolicy.java51
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/policies/UMLTextSelectionEditPolicy.java49
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/expressions/UMLAbstractExpression.java39
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/expressions/UMLOCLFactory.java40
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/parsers/MessageFormatParser.java36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/DiagramEditorContextMenuProvider.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/UMLCreationWizard.java25
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/UMLCreationWizardPage.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/UMLDiagramActionBarContributor.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/UMLDiagramEditor.java90
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/UMLDiagramEditorPlugin.java17
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/UMLDiagramEditorUtil.java121
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/UMLDiagramUpdater.java2592
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/UMLDocumentProvider.java289
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/UMLInitDiagramFileAction.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/UMLLinkDescriptor.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/UMLMatchingStrategy.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/UMLNewDiagramFileWizard.java39
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/UMLPaletteFactory.java100
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/UMLVisualIDRegistry.java537
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/part/ValidateAction.java95
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/preferences/DiagramPreferenceInitializer.java1
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/providers/ElementInitializers.java402
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/providers/UMLElementTypes.java404
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/providers/UMLMarkerNavigationProvider.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/providers/UMLParserProvider.java680
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/providers/UMLValidationDecoratorProvider.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/providers/UMLValidationProvider.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/providers/UMLViewProvider.java760
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/providers/UMLVisualTypeProvider.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/sheet/UMLSheetLabelProvider.java18
144 files changed, 12894 insertions, 9661 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/AssociationClassViewCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/AssociationClassViewCreateCommand.java
index 57eaa019ed1..b17daae420c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/AssociationClassViewCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/AssociationClassViewCreateCommand.java
@@ -106,7 +106,7 @@ public class AssociationClassViewCreateCommand extends AbstractTransactionalComm
CreateElementRequestAdapter requestAdapter = createConnectionViewAndElementRequest.getConnectionViewAndElementDescriptor().getCreateElementRequestAdapter();
CreateRelationshipRequest createElementRequest = (CreateRelationshipRequest) requestAdapter.getAdapter(CreateRelationshipRequest.class);
UMLViewProvider viewProvider = new UMLViewProvider();
- node = viewProvider.createDependency_2011(createElementRequest.getNewElement(), this.containerView, -1, true, preferenceHint);
+ node = viewProvider.createDependency_Shape(createElementRequest.getNewElement(), this.containerView, -1, true, preferenceHint);
// this.node = factory.createView(new
// SemanticAdapter(createElementRequest.getNewElement()),
// this.containerView, ((IHintedType)
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/BranchDependenctReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/BranchDependenctReorientCommand.java
index f5b2526a2bb..d75eb839720 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/BranchDependenctReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/BranchDependenctReorientCommand.java
@@ -72,7 +72,7 @@ public class BranchDependenctReorientCommand extends EditElementCommand {
return false;
}
Package container = (Package) getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistDependency_4010(container, getLink(), getNewSource(), target);
+ return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistDependency_BranchEdge(container, getLink(), getNewSource(), target);
}
@@ -89,7 +89,7 @@ public class BranchDependenctReorientCommand extends EditElementCommand {
return false;
}
Package container = (Package) getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistDependency_4010(container, getLink(), source, getNewTarget());
+ return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistDependency_BranchEdge(container, getLink(), source, getNewTarget());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/DependencyDiamonViewCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/DependencyDiamonViewCreateCommand.java
index 5312d355010..054ece9cd59 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/DependencyDiamonViewCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/DependencyDiamonViewCreateCommand.java
@@ -98,7 +98,7 @@ public class DependencyDiamonViewCreateCommand extends AbstractTransactionalComm
// ((IHintedType) UMLElementTypes.Dependency_2014)
// .getSemanticHint(), -1, true, preferenceHint);
UMLViewProvider viewProvider = new UMLViewProvider();
- node = viewProvider.createDependency_2011(((EObject) semanticApdater.getAdapter(EObject.class)), this.containerView, -1, true, preferenceHint);
+ node = viewProvider.createDependency_Shape(((EObject) semanticApdater.getAdapter(EObject.class)), this.containerView, -1, true, preferenceHint);
// put to the good position
Location notationLocation = NotationFactory.eINSTANCE.createLocation();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/ElementToStereotypedShape.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/ElementToStereotypedShape.java
index efc60f18652..94c77046761 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/ElementToStereotypedShape.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/command/ElementToStereotypedShape.java
@@ -51,7 +51,7 @@ public class ElementToStereotypedShape extends RecordingCommand {
// creation of the node
UMLViewProvider umlViewProvider = new UMLViewProvider();
- Node packageview = umlViewProvider.createNamedElement_2012(elementEditPart.resolveSemanticElement(), (View) elementEditPart.getNotationView().eContainer(), -1, true, elementEditPart.getDiagramPreferencesHint());
+ Node packageview = umlViewProvider.createNamedElement_DefaultShape(elementEditPart.resolveSemanticElement(), (View) elementEditPart.getNotationView().eContainer(), -1, true, elementEditPart.getDiagramPreferencesHint());
packageview.setLayoutConstraint(((Node) elementEditPart.getNotationView()).getLayoutConstraint());
// copy of all eannotations
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/helpers/MultiDependencyHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/helpers/MultiDependencyHelper.java
index c05e595e258..33d78cb91c3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/helpers/MultiDependencyHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/helpers/MultiDependencyHelper.java
@@ -111,17 +111,17 @@ public class MultiDependencyHelper extends ElementHelper {
}
}
// descriptor for the branch
- ConnectionViewDescriptor viewBranchDescriptor = new ConnectionViewDescriptor(UMLElementTypes.Dependency_4010, ((IHintedType) UMLElementTypes.Dependency_4010).getSemanticHint(), diagramPreferencesHint);
+ ConnectionViewDescriptor viewBranchDescriptor = new ConnectionViewDescriptor(UMLElementTypes.Dependency_BranchEdge, ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), diagramPreferencesHint);
// the editpart exist -> only creation of the branch
if (sourceEditPart != null) {
CustomDeferredCreateConnectionViewCommand aBranchCommand = null;
if (constructSource) {
- aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4010).getSemanticHint(), new SemanticAdapter(null, sourceEditPart.getModel()), (IAdaptable) nodeCreation
+ aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), new SemanticAdapter(null, sourceEditPart.getModel()), (IAdaptable) nodeCreation
.getCommandResult().getReturnValue(), sourceEditPart.getViewer(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint(), viewBranchDescriptor, null);
} else {
- aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4010).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(), new SemanticAdapter(null,
+ aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(), new SemanticAdapter(null,
sourceEditPart.getModel()), sourceEditPart.getViewer(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint(), viewBranchDescriptor, null);
}
@@ -141,10 +141,10 @@ public class MultiDependencyHelper extends ElementHelper {
// Creation of the branch
CustomDeferredCreateConnectionViewCommand aBranchCommand = null;
if (constructSource) {
- aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4010).getSemanticHint(), (IAdaptable) nodeCreationCommand.getCommandResult().getReturnValue(),
+ aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), (IAdaptable) nodeCreationCommand.getCommandResult().getReturnValue(),
(IAdaptable) nodeCreation.getCommandResult().getReturnValue(), viewer, diagramPreferencesHint, viewBranchDescriptor, null);
} else {
- aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4010).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(),
+ aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(),
(IAdaptable) nodeCreationCommand.getCommandResult().getReturnValue(), viewer, diagramPreferencesHint, viewBranchDescriptor, null);
}
aBranchCommand.setElement(dependency);
@@ -202,9 +202,9 @@ public class MultiDependencyHelper extends ElementHelper {
}
// 0. add the branch graphically
- ConnectionViewDescriptor viewDescriptor = new ConnectionViewDescriptor(UMLElementTypes.Dependency_4010, ((IHintedType) UMLElementTypes.Dependency_4010).getSemanticHint(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint());
+ ConnectionViewDescriptor viewDescriptor = new ConnectionViewDescriptor(UMLElementTypes.Dependency_BranchEdge, ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint());
- CustomDeferredCreateConnectionViewCommand aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4010).getSemanticHint(), new SemanticAdapter(null, sourceEditPart.getModel()),
+ CustomDeferredCreateConnectionViewCommand aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), new SemanticAdapter(null, sourceEditPart.getModel()),
new SemanticAdapter(null, targetEditPart.getModel()), sourceEditPart.getViewer(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint(), viewDescriptor, null);
aBranchCommand.setElement(dependency);
command = new CompoundCommand();
@@ -374,16 +374,16 @@ public class MultiDependencyHelper extends ElementHelper {
// 4. reconstruction of the old link by taking in account the old
// connection
- ConnectionViewDescriptor viewDescriptor = new ConnectionViewDescriptor(UMLElementTypes.Dependency_4010, ((IHintedType) UMLElementTypes.Dependency_4010).getSemanticHint(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint());
+ ConnectionViewDescriptor viewDescriptor = new ConnectionViewDescriptor(UMLElementTypes.Dependency_BranchEdge, ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint());
// 5. reconstruction of the first branch between old source to node
- ICommand firstBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4010).getSemanticHint(), new SemanticAdapter(null, dependencyViewSource), (IAdaptable) nodeCreation
+ ICommand firstBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), new SemanticAdapter(null, dependencyViewSource), (IAdaptable) nodeCreation
.getCommandResult().getReturnValue(), sourceEditPart.getViewer(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint(), viewDescriptor, null);
((CustomDeferredCreateConnectionViewCommand) firstBranchCommand).setElement(dependency);
((CompoundCommand) command).add(new ICommandProxy(firstBranchCommand));
// 6. reconstruction of the second branch between node to old target
- ICommand secondBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4010).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(), new SemanticAdapter(
+ ICommand secondBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(), new SemanticAdapter(
null, dependencyViewTarget), sourceEditPart.getViewer(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint(), viewDescriptor, null);
((CustomDeferredCreateConnectionViewCommand) secondBranchCommand).setElement(dependency);
((CompoundCommand) command).add(new ICommandProxy(secondBranchCommand));
@@ -393,11 +393,11 @@ public class MultiDependencyHelper extends ElementHelper {
if (dependencyView.equals((sourceEditPart.getModel()))) {
// third branch node and target
- thirdBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4010).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(), new SemanticAdapter(null,
+ thirdBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(), new SemanticAdapter(null,
targetEditPart.getModel()), sourceEditPart.getViewer(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint(), viewDescriptor, null);
} else {
// // third branch source and node
- thirdBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4010).getSemanticHint(), new SemanticAdapter(null, sourceEditPart.getModel()), (IAdaptable) nodeCreation
+ thirdBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), new SemanticAdapter(null, sourceEditPart.getModel()), (IAdaptable) nodeCreation
.getCommandResult().getReturnValue(), sourceEditPart.getViewer(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint(), viewDescriptor, null);
}
((CustomDeferredCreateConnectionViewCommand) thirdBranchCommand).setElement(dependency);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/CustomDiagramDragDropEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/CustomDiagramDragDropEditPolicy.java
index f1e3f84000f..be3af457025 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/CustomDiagramDragDropEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/CustomDiagramDragDropEditPolicy.java
@@ -260,9 +260,9 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
*/
protected Command dropConstraint(DropObjectsRequest dropRequest, Element semanticLink, String nodeVISUALID) {
if(ConstraintEditPart.VISUAL_ID.equals(nodeVISUALID)) {
- return getDropConstraintCommand((Constraint)semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart)getHost()).getNotationView(), (IHintedType)UMLElementTypes.Constraint_2005, (IHintedType)UMLElementTypes.ConstraintConstrainedElement_4009);
+ return getDropConstraintCommand((Constraint)semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart)getHost()).getNotationView(), (IHintedType)UMLElementTypes.Constraint_Shape, (IHintedType)UMLElementTypes.Constraint_ConstrainedElementEdge);
} else if(ConstraintEditPartCN.VISUAL_ID.equals(nodeVISUALID)) {
- return getDropConstraintCommand((Constraint)semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart)getHost()).getNotationView(), (IHintedType)UMLElementTypes.Constraint_56, (IHintedType)UMLElementTypes.ConstraintConstrainedElement_4009);
+ return getDropConstraintCommand((Constraint)semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart)getHost()).getNotationView(), (IHintedType)UMLElementTypes.Constraint_Shape_CN, (IHintedType)UMLElementTypes.Constraint_ConstrainedElementEdge);
}
return UnexecutableCommand.INSTANCE;
}
@@ -282,9 +282,9 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
protected Command dropComment(DropObjectsRequest dropRequest, Element semanticLink, String nodeVISUALID) {
if(CommentEditPart.VISUAL_ID.equals(nodeVISUALID)) {
- return getDropCommentCommand((Comment)semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart)getHost()).getNotationView(), (IHintedType)UMLElementTypes.Comment_2001, (IHintedType)UMLElementTypes.CommentAnnotatedElement_4008);
+ return getDropCommentCommand((Comment)semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart)getHost()).getNotationView(), (IHintedType)UMLElementTypes.Comment_Shape, (IHintedType)UMLElementTypes.Comment_AnnotatedElementEdge);
} else if(CommentEditPartCN.VISUAL_ID.equals(nodeVISUALID)) {
- return getDropCommentCommand((Comment)semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart)getHost()).getNotationView(), (IHintedType)UMLElementTypes.Comment_54, (IHintedType)UMLElementTypes.CommentAnnotatedElement_4008);
+ return getDropCommentCommand((Comment)semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart)getHost()).getNotationView(), (IHintedType)UMLElementTypes.Comment_Shape_CN, (IHintedType)UMLElementTypes.Comment_AnnotatedElementEdge);
}
return UnexecutableCommand.INSTANCE;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/CustomGraphicalNodeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/CustomGraphicalNodeEditPolicy.java
index 603d0b766e0..7fbe6d12696 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/CustomGraphicalNodeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/CustomGraphicalNodeEditPolicy.java
@@ -48,7 +48,7 @@ public class CustomGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
CreateElementRequestAdapter requestAdapter = ((CreateConnectionViewAndElementRequest) request).getConnectionViewAndElementDescriptor().getCreateElementRequestAdapter();
CreateRelationshipRequest createElementRequest = (CreateRelationshipRequest) requestAdapter.getAdapter(CreateRelationshipRequest.class);
- if (UMLElementTypes.Dependency_4010.equals(createElementRequest.getElementType())) {
+ if (UMLElementTypes.Dependency_BranchEdge.equals(createElementRequest.getElementType())) {
MultiDependencyHelper multiDependencyHelper = new MultiDependencyHelper(getEditingDomain());
return multiDependencyHelper.getCommand(((CreateConnectionViewAndElementRequest) request), c);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/itemsemantic/CustomDependencyBranchSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/itemsemantic/CustomDependencyBranchSemanticEditPolicy.java
index eba8d8e123a..aaabe83fb62 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/itemsemantic/CustomDependencyBranchSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/itemsemantic/CustomDependencyBranchSemanticEditPolicy.java
@@ -31,7 +31,7 @@ public class CustomDependencyBranchSemanticEditPolicy extends DefaultSemanticEdi
protected Command getSemanticCommand(IEditCommandRequest request) {
if (request instanceof CreateRelationshipRequest) {
IElementType type = ((CreateRelationshipRequest) request).getElementType();
- if (UMLElementTypes.Dependency_4010 == type) {
+ if (UMLElementTypes.Dependency_BranchEdge == type) {
return UnexecutableCommand.INSTANCE;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/migration/DeploymentReconcilier.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/migration/DeploymentReconciler.java
index d5863c803de..0b1b8e0051f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/migration/DeploymentReconcilier.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/migration/DeploymentReconciler.java
@@ -20,17 +20,18 @@ import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.infra.gmfdiag.common.commands.InsertFloatingLabelFromMapCommand;
import org.eclipse.papyrus.infra.gmfdiag.common.reconciler.DiagramReconciler;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactEditPart;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactEditPartACN;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactEditPartCN;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactFloatingLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactFloatingLabelEditPartACN;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactFloatingLabelEditPartCN;
/**
* Deployment Diagram Reconciler from 1.0.0 to 1.1.0
*/
-public class DeploymentReconcilier extends DiagramReconciler {
+public class DeploymentReconciler extends DiagramReconciler {
+
+ private final static String ArtifactEditPart_VISUAL_ID = "2006";
+ private final static String ArtifactFloatingLabelEditPart_VISUAL_ID = "61";
+ private final static String ArtifactEditPartACN_VISUAL_ID = "28";
+ private final static String ArtifactFloatingLabelEditPartACN_VISUAL_ID = "60";
+ private final static String ArtifactEditPartCN_VISUAL_ID = "25";
+ private final static String ArtifactFloatingLabelEditPartCN_VISUAL_ID = "59";
/**
* Gets the reconcile command.
@@ -52,9 +53,9 @@ public class DeploymentReconcilier extends DiagramReconciler {
*/
private Map<String, String> getFloatingLabelMap() {
Map<String, String> map = new HashMap<String, String>();
- map.put(String.valueOf(ArtifactEditPart.VISUAL_ID), String.valueOf(ArtifactFloatingLabelEditPart.VISUAL_ID));
- map.put(String.valueOf(ArtifactEditPartACN.VISUAL_ID), String.valueOf(ArtifactFloatingLabelEditPartACN.VISUAL_ID));
- map.put(String.valueOf(ArtifactEditPartCN.VISUAL_ID), String.valueOf(ArtifactFloatingLabelEditPartCN.VISUAL_ID));
+ map.put(ArtifactEditPart_VISUAL_ID, ArtifactFloatingLabelEditPart_VISUAL_ID);
+ map.put(ArtifactEditPartACN_VISUAL_ID, ArtifactFloatingLabelEditPartACN_VISUAL_ID);
+ map.put(ArtifactEditPartCN_VISUAL_ID, ArtifactFloatingLabelEditPartCN_VISUAL_ID);
return map;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/migration/DeploymentReconcilerForCompartment.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/migration/DeploymentReconcilerForCompartment.java
index 0387a8a7dfd..56b218a0301 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/migration/DeploymentReconcilerForCompartment.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/migration/DeploymentReconcilerForCompartment.java
@@ -17,40 +17,41 @@ import java.util.Arrays;
import java.util.List;
import org.eclipse.papyrus.infra.gmfdiag.common.reconciler.ReconcilerForCompartment;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPartACN;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.DeviceCompositeCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.DeviceCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ExecutionEnvironmentCompositeCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ExecutionEnvironmentCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ModelPackageableElementCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ModelPackageableElementCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.NodeCompositeCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.NodeCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.PackagePackageableElementCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.PackagePackageableElementCompartmentEditPartCN;
/**
* Diagram Reconciler for compartment from 1.1.0 to 1.2.0
*/
public class DeploymentReconcilerForCompartment extends ReconcilerForCompartment {
+ private static final String ModelPackageableElementCompartmentEditPart_VISUAL_ID = "51";
+ private static final String PackagePackageableElementCompartmentEditPart_VISUAL_ID = "38";
+ private static final String DeviceCompositeCompartmentEditPart_VISUAL_ID = "17";
+ private static final String ExecutionEnvironmentCompositeCompartmentEditPart_VISUAL_ID = "18";
+ private static final String NodeCompositeCompartmentEditPart_VISUAL_ID = "19";
+ private static final String ArtifactCompositeCompartmentEditPart_VISUAL_ID = "26";
+ private static final String ModelPackageableElementCompartmentEditPartCN_VISUAL_ID = "52";
+ private static final String PackagePackageableElementCompartmentEditPartCN_VISUAL_ID = "39";
+ private static final String DeviceCompositeCompartmentEditPartCN_VISUAL_ID = "30";
+ private static final String ExecutionEnvironmentCompositeCompartmentEditPartCN_VISUAL_ID = "31";
+ private static final String NodeCompositeCompartmentEditPartCN_VISUAL_ID = "32";
+ private static final String ArtifactCompositeCompartmentEditPartCN_VISUAL_ID = "33";
+ private static final String ArtifactCompositeCompartmentEditPartACN_VISUAL_ID = "34";
+
/** The compartments visual id. */
private List<String> compartmentsVisualID = Arrays.asList(
- ModelPackageableElementCompartmentEditPart.VISUAL_ID,
- PackagePackageableElementCompartmentEditPart.VISUAL_ID,
- DeviceCompositeCompartmentEditPart.VISUAL_ID,
- ExecutionEnvironmentCompositeCompartmentEditPart.VISUAL_ID,
- NodeCompositeCompartmentEditPart.VISUAL_ID,
- ArtifactCompositeCompartmentEditPart.VISUAL_ID,
- ModelPackageableElementCompartmentEditPartCN.VISUAL_ID,
- PackagePackageableElementCompartmentEditPartCN.VISUAL_ID,
- DeviceCompositeCompartmentEditPartCN.VISUAL_ID,
- ExecutionEnvironmentCompositeCompartmentEditPartCN.VISUAL_ID,
- NodeCompositeCompartmentEditPartCN.VISUAL_ID,
- ArtifactCompositeCompartmentEditPartCN.VISUAL_ID,
- ArtifactCompositeCompartmentEditPartACN.VISUAL_ID);
+ ModelPackageableElementCompartmentEditPart_VISUAL_ID,
+ PackagePackageableElementCompartmentEditPart_VISUAL_ID,
+ DeviceCompositeCompartmentEditPart_VISUAL_ID,
+ ExecutionEnvironmentCompositeCompartmentEditPart_VISUAL_ID,
+ NodeCompositeCompartmentEditPart_VISUAL_ID,
+ ArtifactCompositeCompartmentEditPart_VISUAL_ID,
+ ModelPackageableElementCompartmentEditPartCN_VISUAL_ID,
+ PackagePackageableElementCompartmentEditPartCN_VISUAL_ID,
+ DeviceCompositeCompartmentEditPartCN_VISUAL_ID,
+ ExecutionEnvironmentCompositeCompartmentEditPartCN_VISUAL_ID,
+ NodeCompositeCompartmentEditPartCN_VISUAL_ID,
+ ArtifactCompositeCompartmentEditPartCN_VISUAL_ID,
+ ArtifactCompositeCompartmentEditPartACN_VISUAL_ID);
/**
* Gets the compartments visual id.
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/migration/DeploymentReconciler_1_2_0.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/migration/DeploymentReconciler_1_2_0.java
new file mode 100644
index 00000000000..cac27ff5692
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/migration/DeploymentReconciler_1_2_0.java
@@ -0,0 +1,286 @@
+/*****************************************************************************
+ * Copyright (c) 2010, 2015 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Florian Noyrit (CEA) florian.noyrit@cea.fr - Initial API and Implementation
+ * Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - reconciler to add floating label
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.deployment.custom.migration;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.AbstractCommand;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.reconciler.DiagramReconciler;
+
+/**
+ * Deployment Diagram Reconciler from 1.1.0 to 1.2.0
+ */
+public class DeploymentReconciler_1_2_0 extends DiagramReconciler {
+
+ @Override
+ public ICommand getReconcileCommand(Diagram diagram) {
+ CompositeCommand cc = new CompositeCommand("Migrate diagram from 1.1.0 to 1.2.0");
+ cc.add(new ChangeVisualIDsCommand(diagram));
+ return cc;
+ }
+
+ protected class ChangeVisualIDsCommand extends AbstractCommand {
+
+ protected final Diagram diagram;
+
+ public ChangeVisualIDsCommand(Diagram diagram) {
+ super("Change the diagram's visual ids from 1.1.0 to 1.2.0");
+ this.diagram = diagram;
+ }
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ TreeIterator<EObject> allContentIterator = diagram.eAllContents();
+
+ while (allContentIterator.hasNext()) {
+ EObject eObject = allContentIterator.next();
+ if (eObject instanceof View) {
+ View view = (View) eObject;
+ view.setType(getNewVisualID(view.getType()));
+ }
+ }
+
+ return CommandResult.newOKCommandResult();
+ }
+
+ @Override
+ public boolean canUndo() {
+ return false;
+ }
+
+ @Override
+ public boolean canRedo() {
+ return false;
+ }
+
+ @Override
+ protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ throw new ExecutionException("Should not be called, canRedo false");
+ }
+
+ @Override
+ protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ throw new ExecutionException("Should not be called, canUndo false");
+ }
+ }
+
+ public static String getNewVisualID(String oldVisualID) {
+ switch (oldVisualID) {
+ case "1000":
+ return "Package_DeploymentDiagram";
+ case "49":
+ return "Model_Shape_CN";
+ case "50":
+ return "Model_NameLabel_CN";
+ case "36":
+ return "Package_Shape_CN";
+ case "37":
+ return "Package_NameLabel_CN";
+ case "16":
+ return "Device_Shape_CCN";
+ case "20":
+ return "Device_NameLabel_CCN";
+ case "44":
+ return "Device_Shape_CN";
+ case "45":
+ return "Device_NameLabel_CN";
+ case "21":
+ return "ExecutionEnvironment_Shape_CCN";
+ case "22":
+ return "ExecutionEnvironment_NameLabel_CCN";
+ case "46":
+ return "ExecutionEnvironment_Shape_CN";
+ case "47":
+ return "ExecutionEnvironment_NameLabel_CN";
+ case "23":
+ return "Node_Shape_CCN";
+ case "24":
+ return "Node_NameLabel_CCN";
+ case "42":
+ return "Node_Shape_CN";
+ case "43":
+ return "Node_NameLabel_CN";
+ case "25":
+ return "Artifact_Shape_CCN";
+ case "27":
+ return "Artifact_NameLabel_CCN";
+ case "59":
+ return "Artifact_FloatingNameLabel_CCN";
+ case "28":
+ return "Artifact_Shape_ACN";
+ case "29":
+ return "Artifact_NameLabel_ACN";
+ case "60":
+ return "Artifact_FloatingNameLabel_ACN";
+ case "40":
+ return "Artifact_Shape_CN";
+ case "41":
+ return "Artifact_NameLabel_CN";
+ case "54":
+ return "Comment_Shape_CN";
+ case "55":
+ return "Comment_BodyLabel_CN";
+ case "56":
+ return "Constraint_Shape_CN";
+ case "57":
+ return "Constraint_NameLabel_CN";
+ case "58":
+ return "Constraint_BodyLabel_CN";
+ case "2014":
+ return "DeploymentSpecification_Shape_CCN";
+ case "64":
+ return "DeploymentSpecification_NameLabel_CCN";
+ case "65":
+ return "DeploymentSpecification_FloatingNameLabel_CCN";
+ case "2015":
+ return "DeploymentSpecification_Shape_CN";
+ case "66":
+ return "DeploymentSpecification_NameLabel_CN";
+ case "67":
+ return "DeploymentSpecification_FloatingNameLabel_CN";
+ case "2016":
+ return "DeploymentSpecification_Shape_ACN";
+ case "68":
+ return "DeploymentSpecification_NameLabel_ACN";
+ case "69":
+ return "DeploymentSpecification_FloatingNameLabel_ACN";
+ case "2011":
+ return "Dependency_Shape";
+ case "7":
+ return "Dependency_MultiNameLabel";
+ case "2010":
+ return "Model_Shape";
+ case "48":
+ return "Model_NameLabel";
+ case "2009":
+ return "Package_Shape";
+ case "35":
+ return "Package_NameLabel";
+ case "2005":
+ return "Constraint_Shape";
+ case "2":
+ return "Constraint_NameLabel";
+ case "3":
+ return "Constraint_BodyLabel";
+ case "2001":
+ return "Comment_Shape";
+ case "1":
+ return "Comment_BodyLabel";
+ case "2002":
+ return "ExecutionEnvironment_Shape";
+ case "5":
+ return "ExecutionEnvironment_NameLabel";
+ case "2003":
+ return "Device_Shape";
+ case "6":
+ return "Device_NameLabel";
+ case "2006":
+ return "Artifact_Shape";
+ case "8":
+ return "Artifact_NameLabel";
+ case "61":
+ return "Artifact_FloatingNameLabel";
+ case "2008":
+ return "Node_Shape";
+ case "9":
+ return "Node_NameLabel";
+ case "2012":
+ return "NamedElement_DefaultShape";
+ case "53":
+ return "NamedElement_NameLabel";
+ case "2013":
+ return "DeploymentSpecification_Shape";
+ case "62":
+ return "DeploymentSpecification_NameLabel";
+ case "63":
+ return "DeploymentSpecification_FloatingNameLabel";
+ case "4005":
+ return "Link_DescriptorEdge";
+ case "4008":
+ return "Comment_AnnotatedElementEdge";
+ case "4009":
+ return "Constraint_ConstrainedElementEdge";
+ case "4001":
+ return "Deployment_Edge";
+ case "13":
+ return "Deployment_NameLabel";
+ case "14":
+ return "Deployment_StereotypeLabel";
+ case "4002":
+ return "Manifestation_Edge";
+ case "10":
+ return "Manifestation_NameLabel";
+ case "11":
+ return "Manifestation_StereotypeLabel";
+ case "4003":
+ return "Generalization_Edge";
+ case "4":
+ return "Generalization_StereotypeLabel";
+ case "4004":
+ return "Dependency_Edge";
+ case "12":
+ return "Dependency_NameLabel";
+ case "15":
+ return "Dependency_StereotypeLabel";
+ case "4010":
+ return "Dependency_BranchEdge";
+ case "4011":
+ return "CommunicationPath_Edge";
+ case "6001":
+ return "CommunicationPath_NameLabel";
+ case "6002":
+ return "CommunicationPath_StereotypeLabel";
+ case "51":
+ return "Model_PackagedElementCompartment";
+ case "38":
+ return "Package_PackagedElementCompartment";
+ case "17":
+ return "Device_NestedNodeCompartment";
+ case "18":
+ return "ExecutionEnvironment_NestedNodeCompartment";
+ case "19":
+ return "Node_NestedNodeCompartment";
+ case "26":
+ return "Artifact_NestedArtifactCompartment";
+ case "52":
+ return "Model_PackagedElementCompartment_CN";
+ case "39":
+ return "Package_PackagedElementCompartment_CN";
+ case "30":
+ return "Device_NestedNodeCompartment_CN";
+ case "31":
+ return "ExecutionEnvironment_NestedNodeCompartment_CN";
+ case "32":
+ return "Node_NestedNodeCompartment_CN";
+ case "33":
+ return "Artifact_NestedArtifactCompartment_CCN";
+ case "34":
+ return "Artifact_NestedArtifactCompartment_ACN";
+ default:
+ return defaultGetNewVisualID(oldVisualID);
+ }
+ }
+
+ private static String defaultGetNewVisualID(String oldVisualID) {
+ return oldVisualID;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/model/DeploymentDiagram-notation.elementtypesconfigurations b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/model/DeploymentDiagram-notation.elementtypesconfigurations
deleted file mode 100644
index f58db1738ab..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/model/DeploymentDiagram-notation.elementtypesconfigurations
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="ASCII" standalone="no"?><elementtypesconfigurations:ElementTypeSetConfiguration xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.1" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" identifier="org.eclipse.papyrus.uml.diagram.deployment.elementTypeSetNotation" metamodelNsURI="http://www.eclipse.org/gmf/runtime/1.0.2/notation" name="elementTypeSetNotation" xmi:id="_rcmpgv_cEeS2GcUTq58BKg" xmi:version="2.0">
- <elementTypeConfigurations hint="4005" identifier="org.eclipse.papyrus.uml.diagram.deployment.Link_4005" kind="org.eclipse.gmf.runtime.diagram.ui.util.INotationType" name="Undefined" xmi:id="_rcnQkP_cEeS2GcUTq58BKg" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <specializedTypesID>org.eclipse.gmf.runtime.emf.type.core.null</specializedTypesID>
- </elementTypeConfigurations>
-</elementtypesconfigurations:ElementTypeSetConfiguration> \ No newline at end of file
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/model/DeploymentDiagram.elementtypesconfigurations b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/model/DeploymentDiagram.elementtypesconfigurations
deleted file mode 100644
index 95ed3116b1e..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/model/DeploymentDiagram.elementtypesconfigurations
+++ /dev/null
@@ -1,144 +0,0 @@
-<?xml version="1.0" encoding="ASCII" standalone="no"?><elementtypesconfigurations:ElementTypeSetConfiguration xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.1" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" identifier="org.eclipse.papyrus.uml.diagram.deployment.elementTypeSet" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML" name="PapyrusUMLDeploymentDiagram" xmi:id="_gvIwYP8PEeS2nvlxgM4H8g" xmi:version="2.0">
- <elementTypeConfigurations hint="25" identifier="org.eclipse.papyrus.uml.diagram.deployment.Artifact_25" name="Artifact" xmi:id="_gwBhMP8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Artifact.gif" xmi:id="_gwBhMf8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Artifact</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="28" identifier="org.eclipse.papyrus.uml.diagram.deployment.Artifact_28" name="Artifact" xmi:id="_gwCIQP8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Artifact.gif" xmi:id="_gwCIQf8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Artifact</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="40" identifier="org.eclipse.papyrus.uml.diagram.deployment.Artifact_40" name="Artifact" xmi:id="_gwCIQv8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Artifact.gif" xmi:id="_gwCIQ_8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Artifact</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="2006" identifier="org.eclipse.papyrus.uml.diagram.deployment.Artifact_2006" name="Artifact" xmi:id="_gwGZsv8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Artifact.gif" xmi:id="_gwGZs_8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Artifact</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="54" identifier="org.eclipse.papyrus.uml.diagram.deployment.Comment_54" name="Comment" xmi:id="_gwCvUP8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Comment.gif" xmi:id="_gwCvUf8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Comment</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="2001" identifier="org.eclipse.papyrus.uml.diagram.deployment.Comment_2001" name="Comment" xmi:id="_gwFLkv8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Comment.gif" xmi:id="_gwFLk_8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Comment</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="4008" identifier="org.eclipse.papyrus.uml.diagram.deployment.CommentAnnotatedElement_4006" name="Comment Annotated Element" xmi:id="_gwHn0P8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <specializedTypesID>org.eclipse.papyrus.uml.Comment.AnnotatedElements</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="4011" identifier="org.eclipse.papyrus.uml.diagram.deployment.CommunicationPath_4011" name="CommunicationPath" xmi:id="_8sxJcDSEEeWt899Q4ouxaA" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/CommunicationPath.gif" xmi:id="_MLL_QDSFEeWt899Q4ouxaA"/>
- <specializedTypesID>org.eclipse.papyrus.uml.CommunicationPath</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="56" identifier="org.eclipse.papyrus.uml.diagram.deployment.Constraint_56" name="Constraint" xmi:id="_gwDWYP8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Constraint.gif" xmi:id="_gwDWYf8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Constraint</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="2005" identifier="org.eclipse.papyrus.uml.diagram.deployment.Constraint_2005" name="Constraint" xmi:id="_gwFLkP8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Constraint.gif" xmi:id="_gwFLkf8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Constraint</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="4009" identifier="org.eclipse.papyrus.uml.diagram.deployment.ConstraintConstrainedElement_4007" name="Constraint Constrained Element" xmi:id="_gwHn0f8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <specializedTypesID>org.eclipse.papyrus.uml.Constraint.ConstrainedElements</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="2012" identifier="org.eclipse.papyrus.uml.diagram.deployment.NamedElement_2012" name="Default Named Element" xmi:id="_gwHAwv8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/NamedElement.gif" xmi:id="_gwHAw_8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.NamedElement</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="4010" identifier="org.eclipse.papyrus.uml.diagram.deployment.Dependency_4010" name="Dependency Branch Link" xmi:id="_gwI18v8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Dependency.gif" xmi:id="_gwI18_8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Dependency</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="4004" identifier="org.eclipse.papyrus.uml.diagram.deployment.Dependency_4004" name="Dependency Link" xmi:id="_gwI18P8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Dependency.gif" xmi:id="_gwI18f8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Dependency</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="2011" identifier="org.eclipse.papyrus.uml.diagram.deployment.Dependency_2011" name="Dependency Node" xmi:id="_gwD9cP8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Dependency.gif" xmi:id="_gwD9cf8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Dependency</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="4001" identifier="org.eclipse.papyrus.uml.diagram.deployment.Deployment_4001" name="Deployment" xmi:id="_gwHn0v8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Deployment.gif" xmi:id="_gwHn0_8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Deployment</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="2013" identifier="org.eclipse.papyrus.uml.diagram.deployment.DeploymentSpecification_2013" name="DeploymentSpecification" xmi:id="_H3PAAEvtEeWDlLIkRlZnAA" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/DeploymentSpecification.gif" xmi:id="_NrvVQEvtEeWDlLIkRlZnAA"/>
- <specializedTypesID>org.eclipse.papyrus.uml.DeploymentSpecification</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="2014" identifier="org.eclipse.papyrus.uml.diagram.deployment.DeploymentSpecification_2014" name="DeploymentSpecification" xmi:id="_CafvEEwwEeWwb_6uOhatZA" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/DeploymentSpecification.gif" xmi:id="_bp_zEEyhEeW-zLOt2X96xQ"/>
- <specializedTypesID>org.eclipse.papyrus.uml.DeploymentSpecification</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="2015" identifier="org.eclipse.papyrus.uml.diagram.deployment.DeploymentSpecification_2015" name="DeploymentSpecification" xmi:id="_dGBFIEyhEeW-zLOt2X96xQ" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/DeploymentSpecification.gif" xmi:id="_dGBFIUyhEeW-zLOt2X96xQ"/>
- <specializedTypesID>org.eclipse.papyrus.uml.DeploymentSpecification</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="2016" identifier="org.eclipse.papyrus.uml.diagram.deployment.DeploymentSpecification_2016" name="DeploymentSpecification" xmi:id="_GKvkwEy4EeWcB5wRNPiyyQ" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/DeploymentSpecification.gif" xmi:id="_GKwL0Ey4EeWcB5wRNPiyyQ"/>
- <specializedTypesID>org.eclipse.papyrus.uml.DeploymentSpecification</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="16" identifier="org.eclipse.papyrus.uml.diagram.deployment.Device_16" name="Device" xmi:id="_gv-d4P8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Device.gif" xmi:id="_gv-d4f8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.um.Device_As_UML::Node::nestedNode</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="44" identifier="org.eclipse.papyrus.uml.diagram.deployment.Device_44" name="Device" xmi:id="_gv_E8P8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Device.gif" xmi:id="_gv_E8f8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Device</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="2003" identifier="org.eclipse.papyrus.uml.diagram.deployment.Device_2003" name="Device" xmi:id="_gwGZsP8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Device.gif" xmi:id="_gwGZsf8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Device</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="21" identifier="org.eclipse.papyrus.uml.diagram.deployment.ExecutionEnvironment_21" name="Execution Environment" xmi:id="_gv_sAP8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/ExecutionEnvironment.gif" xmi:id="_gv_sAf8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.um.ExecutionEnvironment_As_UML::Node::nestedNode</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="46" identifier="org.eclipse.papyrus.uml.diagram.deployment.ExecutionEnvironment_46" name="Execution Environment" xmi:id="_gv_sAv8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/ExecutionEnvironment.gif" xmi:id="_gv_sA_8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.ExecutionEnvironment</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="2002" identifier="org.eclipse.papyrus.uml.diagram.deployment.ExecutionEnvironment_2002" name="Execution Environment" xmi:id="_gwFyoP8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/ExecutionEnvironment.gif" xmi:id="_gwFyof8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.ExecutionEnvironment</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="4003" identifier="org.eclipse.papyrus.uml.diagram.deployment.Generalization_4003" name="Generalization" xmi:id="_gwIO4P8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Generalization.gif" xmi:id="_gwIO4f8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Generalization</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="4002" identifier="org.eclipse.papyrus.uml.diagram.deployment.Manifestation_4002" name="Manifestation" xmi:id="_gwHn1P8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Manifestation.gif" xmi:id="_gwHn1f8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Manifestation</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="49" identifier="org.eclipse.papyrus.uml.diagram.deployment.Model_49" name="Model" xmi:id="_gv9PwP8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Model.gif" xmi:id="_gv9Pwf8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Model</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="2010" identifier="org.eclipse.papyrus.uml.diagram.deployment.Model_2010" name="Model" xmi:id="_gwD9cv8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Model.gif" xmi:id="_gwD9c_8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Model</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="23" identifier="org.eclipse.papyrus.uml.diagram.deployment.Node_23" name="Node" xmi:id="_gwATEP8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Node.gif" xmi:id="_gwATEf8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.um.Node_As_UML::Node::nestedNode</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="42" identifier="org.eclipse.papyrus.uml.diagram.deployment.Node_42" name="Node" xmi:id="_gwA6IP8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Node.gif" xmi:id="_gwA6If8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Node</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="2008" identifier="org.eclipse.papyrus.uml.diagram.deployment.Node_2008" name="Node" xmi:id="_gwHAwP8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Node.gif" xmi:id="_gwHAwf8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Node</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="PapyrusUMLDeploymentDiagram" identifier="org.eclipse.papyrus.uml.diagram.deployment.Package_1000" name="Package" xmi:id="_gv0s4P8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Package.gif" xmi:id="_gv0s4f8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Package</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="36" identifier="org.eclipse.papyrus.uml.diagram.deployment.Package_36" name="Package" xmi:id="_gv920P8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Package.gif" xmi:id="_gv920f8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Package</specializedTypesID>
- </elementTypeConfigurations>
- <elementTypeConfigurations hint="2009" identifier="org.eclipse.papyrus.uml.diagram.deployment.Package_2009" name="Package" xmi:id="_gwEkgP8PEeS2nvlxgM4H8g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration">
- <iconEntry bundleId="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Package.gif" xmi:id="_gwEkgf8PEeS2nvlxgM4H8g"/>
- <specializedTypesID>org.eclipse.papyrus.uml.Package</specializedTypesID>
- </elementTypeConfigurations>
-</elementtypesconfigurations:ElementTypeSetConfiguration> \ No newline at end of file
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/model/DeploymentDiagram.gmfgen b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/model/DeploymentDiagram.gmfgen
index e8af686a2ec..7747c5c0f77 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/model/DeploymentDiagram.gmfgen
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/model/DeploymentDiagram.gmfgen
@@ -4,7 +4,8 @@
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">
+ xmlns:papyrusgmfgenextension="http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension"
+ xsi:schemaLocation="http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension ../../org.eclipse.papyrus.gmfgenextension/model/papyrusGmfgenExtension.ecore">
<gmfgen:GenEditorGenerator
packageNamePrefix="org.eclipse.papyrus.uml.diagram.deployment"
modelID="PapyrusUMLDeploymentDiagram"
@@ -29,7 +30,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/>
<elementType
xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.diagram.deployment.Package_1000"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Package_DeploymentDiagram"
displayName="DeploymentDiagram"
definedExternally="true"
editHelperClassName="ModelEditHelper"/>
@@ -59,7 +60,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.uml.diagram.deployment.Model_49"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Model_Shape_CN"
displayName="Model"
definedExternally="true"/>
<viewmap
@@ -139,6 +140,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:SpecializationType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Package_Shape_CN"
definedExternally="true"/>
<viewmap
xsi:type="gmfgen:FigureViewmap"
@@ -217,7 +219,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.uml.diagram.deployment.Device_16"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Device_Shape_CCN"
displayName="Device"
definedExternally="true"
metamodelType="/0/@diagram/@topLevelNodes.6/@elementType"/>
@@ -309,7 +311,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.uml.diagram.deployment.Device_44"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Device_Shape_CN"
displayName="Device"
definedExternally="true"
metamodelType="/0/@diagram/@topLevelNodes.6/@elementType"/>
@@ -400,7 +402,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.uml.diagram.deployment.ExecutionEnvironment_21"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.ExecutionEnvironment_Shape_CCN"
displayName="ExecutionEnvironment"
definedExternally="true"/>
<viewmap
@@ -491,7 +493,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.uml.diagram.deployment.ExecutionEnvironment_46"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.ExecutionEnvironment_Shape_CN"
displayName="ExecutionEnvironment"
definedExternally="true"/>
<viewmap
@@ -581,6 +583,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:SpecializationType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Node_Shape_CCN"
displayName="Node"
definedExternally="true"/>
<viewmap
@@ -671,6 +674,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:SpecializationType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Node_Shape_CN"
displayName="Node"
definedExternally="true"/>
<viewmap
@@ -761,7 +765,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.uml.diagram.deployment.Artifact_25"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Artifact_Shape_CCN"
displayName="Artifact"
definedExternally="true"
metamodelType="/0/@diagram/@topLevelNodes.7/@elementType"/>
@@ -884,6 +888,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:SpecializationType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Artifact_Shape_ACN"
displayName="Artifact"
definedExternally="true"
metamodelType="/0/@diagram/@topLevelNodes.7/@elementType"/>
@@ -1003,6 +1008,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:SpecializationType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Artifact_Shape_CN"
displayName="Artifact"
definedExternally="true"
metamodelType="/0/@diagram/@topLevelNodes.7/@elementType"/>
@@ -1097,6 +1103,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Comment_Shape_CN"
definedExternally="true"
editHelperClassName="CommentEditHelper"/>
<viewmap
@@ -1165,6 +1172,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Constraint_Shape_CN"
definedExternally="true"
editHelperClassName="ConstraintEditHelper"/>
<viewmap
@@ -1250,6 +1258,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.DeploymentSpecification_Shape_CCN"
definedExternally="true"/>
<viewmap
xsi:type="gmfgen:FigureViewmap"
@@ -1354,6 +1363,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.DeploymentSpecification_Shape_CN"
definedExternally="true"/>
<viewmap
xsi:type="gmfgen:FigureViewmap"
@@ -1458,6 +1468,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.DeploymentSpecification_Shape_ACN"
definedExternally="true"/>
<viewmap
xsi:type="gmfgen:FigureViewmap"
@@ -1563,7 +1574,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.diagram.deployment.Dependency_2011"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Dependency_Shape"
displayName="DependencyNode"
definedExternally="true"
editHelperClassName="DependencyEditHelper"/>
@@ -1616,7 +1627,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.uml.diagram.deployment.Model_2010"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Model_Shape"
displayName="Model"
definedExternally="true"/>
<viewmap
@@ -1695,6 +1706,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:SpecializationType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Package_Shape"
definedExternally="true"/>
<viewmap
xsi:type="gmfgen:FigureViewmap"
@@ -1771,6 +1783,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Constraint_Shape"
definedExternally="true"
editHelperClassName="ConstraintEditHelper"/>
<viewmap
@@ -1859,6 +1872,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Comment_Shape"
definedExternally="true"
editHelperClassName="CommentEditHelper"/>
<viewmap
@@ -1927,6 +1941,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.ExecutionEnvironment_Shape"
definedExternally="true"
editHelperClassName="ExecutionEnvironmentEditHelper"/>
<viewmap
@@ -2016,6 +2031,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Device_Shape"
definedExternally="true"
editHelperClassName="DeviceEditHelper"/>
<viewmap
@@ -2105,6 +2121,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Artifact_Shape"
definedExternally="true"
editHelperClassName="ArtifactEditHelper"/>
<viewmap
@@ -2220,6 +2237,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Node_Shape"
definedExternally="true"
editHelperClassName="NodeEditHelper"/>
<viewmap
@@ -2309,7 +2327,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.diagram.deployment.NamedElement_2012"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.NamedElement_DefaultShape"
displayName="DefaultNamedElement"
definedExternally="true"
editHelperClassName="DefaultNamedElementEditHelper"/>
@@ -2375,6 +2393,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.DeploymentSpecification_Shape"
definedExternally="true"/>
<viewmap
xsi:type="gmfgen:FigureViewmap"
@@ -2480,6 +2499,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
<elementType
xsi:type="gmfgen:NotationType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Link_DescriptorEdge"
definedExternally="true"/>
<viewmap
xsi:type="gmfgen:FigureViewmap"
@@ -2495,7 +2515,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
<elementType
xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.uml.diagram.deployment.CommentAnnotatedElement_4006"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Comment_AnnotatedElementEdge"
displayName="CommentAnnotatedElement"
definedExternally="true"/>
<viewmap
@@ -2517,7 +2537,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
<elementType
xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.uml.diagram.deployment.ConstraintConstrainedElement_4007"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Constraint_ConstrainedElementEdge"
displayName="ConstraintConstrainedElement"
definedExternally="true"/>
<viewmap
@@ -2539,6 +2559,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Deployment_Edge"
definedExternally="true"
editHelperClassName="DeploymentEditHelper"/>
<viewmap
@@ -2630,6 +2651,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Manifestation_Edge"
definedExternally="true"
editHelperClassName="ManifestationEditHelper"/>
<viewmap
@@ -2721,6 +2743,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Generalization_Edge"
definedExternally="true"
editHelperClassName="GeneralizationEditHelper"/>
<viewmap
@@ -2783,6 +2806,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
<elementType
xsi:type="gmfgen:SpecializationType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Dependency_Edge"
displayName="DependencyLink"
definedExternally="true"
metamodelType="/0/@diagram/@topLevelNodes.0/@elementType"/>
@@ -2880,7 +2904,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
<elementType
xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.uml.diagram.deployment.Dependency_4010"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Dependency_BranchEdge"
displayName="DependencyBranchLink"
definedExternally="true"
metamodelType="/0/@diagram/@topLevelNodes.0/@elementType"/>
@@ -2920,6 +2944,7 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
<elementType
xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.CommunicationPath_Edge"
definedExternally="true"/>
<viewmap
xsi:type="gmfgen:FigureViewmap"
@@ -3718,4 +3743,322 @@
name="PackageEditPart"
superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.PackageEditPart"/>
</papyrusgmfgenextension:PapyrusExtensionRootNode>
+ <papyrusgmfgenextension:VisualIDOverride
+ genView="/0/@diagram"
+ visualID="Package_DeploymentDiagram">
+ <child
+ genView="/0/@diagram/@childNodes.0"
+ visualID="Model_Shape_CN">
+ <child
+ genView="/0/@diagram/@childNodes.0/@labels.0"
+ visualID="Model_NameLabel_CN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@childNodes.1"
+ visualID="Package_Shape_CN">
+ <child
+ genView="/0/@diagram/@childNodes.1/@labels.0"
+ visualID="Package_NameLabel_CN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@childNodes.2"
+ visualID="Device_Shape_CCN">
+ <child
+ genView="/0/@diagram/@childNodes.2/@labels.0"
+ visualID="Device_NameLabel_CCN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@childNodes.3"
+ visualID="Device_Shape_CN">
+ <child
+ genView="/0/@diagram/@childNodes.3/@labels.0"
+ visualID="Device_NameLabel_CN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@childNodes.4"
+ visualID="ExecutionEnvironment_Shape_CCN">
+ <child
+ genView="/0/@diagram/@childNodes.4/@labels.0"
+ visualID="ExecutionEnvironment_NameLabel_CCN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@childNodes.5"
+ visualID="ExecutionEnvironment_Shape_CN">
+ <child
+ genView="/0/@diagram/@childNodes.5/@labels.0"
+ visualID="ExecutionEnvironment_NameLabel_CN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@childNodes.6"
+ visualID="Node_Shape_CCN">
+ <child
+ genView="/0/@diagram/@childNodes.6/@labels.0"
+ visualID="Node_NameLabel_CCN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@childNodes.7"
+ visualID="Node_Shape_CN">
+ <child
+ genView="/0/@diagram/@childNodes.7/@labels.0"
+ visualID="Node_NameLabel_CN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@childNodes.8"
+ visualID="Artifact_Shape_CCN">
+ <child
+ genView="/0/@diagram/@childNodes.8/@labels.0"
+ visualID="Artifact_NameLabel_CCN"/>
+ <child
+ genView="/0/@diagram/@childNodes.8/@labels.1"
+ visualID="Artifact_FloatingNameLabel_CCN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@childNodes.9"
+ visualID="Artifact_Shape_ACN">
+ <child
+ genView="/0/@diagram/@childNodes.9/@labels.0"
+ visualID="Artifact_NameLabel_ACN"/>
+ <child
+ genView="/0/@diagram/@childNodes.9/@labels.1"
+ visualID="Artifact_FloatingNameLabel_ACN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@childNodes.10"
+ visualID="Artifact_Shape_CN">
+ <child
+ genView="/0/@diagram/@childNodes.10/@labels.0"
+ visualID="Artifact_NameLabel_CN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@childNodes.11"
+ visualID="Comment_Shape_CN">
+ <child
+ genView="/0/@diagram/@childNodes.11/@labels.0"
+ visualID="Comment_BodyLabel_CN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@childNodes.12"
+ visualID="Constraint_Shape_CN">
+ <child
+ genView="/0/@diagram/@childNodes.12/@labels.0"
+ visualID="Constraint_NameLabel_CN"/>
+ <child
+ genView="/0/@diagram/@childNodes.12/@labels.1"
+ visualID="Constraint_BodyLabel_CN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@childNodes.13"
+ visualID="DeploymentSpecification_Shape_CCN">
+ <child
+ genView="/0/@diagram/@childNodes.13/@labels.0"
+ visualID="DeploymentSpecification_NameLabel_CCN"/>
+ <child
+ genView="/0/@diagram/@childNodes.13/@labels.1"
+ visualID="DeploymentSpecification_FloatingNameLabel_CCN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@childNodes.14"
+ visualID="DeploymentSpecification_Shape_CN">
+ <child
+ genView="/0/@diagram/@childNodes.14/@labels.0"
+ visualID="DeploymentSpecification_NameLabel_CN"/>
+ <child
+ genView="/0/@diagram/@childNodes.14/@labels.1"
+ visualID="DeploymentSpecification_FloatingNameLabel_CN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@childNodes.15"
+ visualID="DeploymentSpecification_Shape_ACN">
+ <child
+ genView="/0/@diagram/@childNodes.15/@labels.0"
+ visualID="DeploymentSpecification_NameLabel_ACN"/>
+ <child
+ genView="/0/@diagram/@childNodes.15/@labels.1"
+ visualID="DeploymentSpecification_FloatingNameLabel_ACN"/>
+ </child>
+ <child
+ genView="/0/@diagram/@compartments.0"
+ visualID="Model_PackagedElementCompartment"/>
+ <child
+ genView="/0/@diagram/@compartments.1"
+ visualID="Package_PackagedElementCompartment"/>
+ <child
+ genView="/0/@diagram/@compartments.2"
+ visualID="Device_NestedNodeCompartment"/>
+ <child
+ genView="/0/@diagram/@compartments.3"
+ visualID="ExecutionEnvironment_NestedNodeCompartment"/>
+ <child
+ genView="/0/@diagram/@compartments.4"
+ visualID="Node_NestedNodeCompartment"/>
+ <child
+ genView="/0/@diagram/@compartments.5"
+ visualID="Artifact_NestedArtifactCompartment"/>
+ <child
+ genView="/0/@diagram/@compartments.6"
+ visualID="Model_PackagedElementCompartment_CN"/>
+ <child
+ genView="/0/@diagram/@compartments.7"
+ visualID="Package_PackagedElementCompartment_CN"/>
+ <child
+ genView="/0/@diagram/@compartments.8"
+ visualID="Device_NestedNodeCompartment_CN"/>
+ <child
+ genView="/0/@diagram/@compartments.9"
+ visualID="ExecutionEnvironment_NestedNodeCompartment_CN"/>
+ <child
+ genView="/0/@diagram/@compartments.10"
+ visualID="Node_NestedNodeCompartment_CN"/>
+ <child
+ genView="/0/@diagram/@compartments.11"
+ visualID="Artifact_NestedArtifactCompartment_CCN"/>
+ <child
+ genView="/0/@diagram/@compartments.12"
+ visualID="Artifact_NestedArtifactCompartment_ACN"/>
+ <child
+ genView="/0/@diagram/@topLevelNodes.0"
+ visualID="Dependency_Shape">
+ <child
+ genView="/0/@diagram/@topLevelNodes.0/@labels.0"
+ visualID="Dependency_MultiNameLabel"/>
+ </child>
+ <child
+ genView="/0/@diagram/@topLevelNodes.1"
+ visualID="Model_Shape">
+ <child
+ genView="/0/@diagram/@topLevelNodes.1/@labels.0"
+ visualID="Model_NameLabel"/>
+ </child>
+ <child
+ genView="/0/@diagram/@topLevelNodes.2"
+ visualID="Package_Shape">
+ <child
+ genView="/0/@diagram/@topLevelNodes.2/@labels.0"
+ visualID="Package_NameLabel"/>
+ </child>
+ <child
+ genView="/0/@diagram/@topLevelNodes.3"
+ visualID="Constraint_Shape">
+ <child
+ genView="/0/@diagram/@topLevelNodes.3/@labels.0"
+ visualID="Constraint_NameLabel"/>
+ <child
+ genView="/0/@diagram/@topLevelNodes.3/@labels.1"
+ visualID="Constraint_BodyLabel"/>
+ </child>
+ <child
+ genView="/0/@diagram/@topLevelNodes.4"
+ visualID="Comment_Shape">
+ <child
+ genView="/0/@diagram/@topLevelNodes.4/@labels.0"
+ visualID="Comment_BodyLabel"/>
+ </child>
+ <child
+ genView="/0/@diagram/@topLevelNodes.5"
+ visualID="ExecutionEnvironment_Shape">
+ <child
+ genView="/0/@diagram/@topLevelNodes.5/@labels.0"
+ visualID="ExecutionEnvironment_NameLabel"/>
+ </child>
+ <child
+ genView="/0/@diagram/@topLevelNodes.6"
+ visualID="Device_Shape">
+ <child
+ genView="/0/@diagram/@topLevelNodes.6/@labels.0"
+ visualID="Device_NameLabel"/>
+ </child>
+ <child
+ genView="/0/@diagram/@topLevelNodes.7"
+ visualID="Artifact_Shape">
+ <child
+ genView="/0/@diagram/@topLevelNodes.7/@labels.0"
+ visualID="Artifact_NameLabel"/>
+ <child
+ genView="/0/@diagram/@topLevelNodes.7/@labels.1"
+ visualID="Artifact_FloatingNameLabel"/>
+ </child>
+ <child
+ genView="/0/@diagram/@topLevelNodes.8"
+ visualID="Node_Shape">
+ <child
+ genView="/0/@diagram/@topLevelNodes.8/@labels.0"
+ visualID="Node_NameLabel"/>
+ </child>
+ <child
+ genView="/0/@diagram/@topLevelNodes.9"
+ visualID="NamedElement_DefaultShape">
+ <child
+ genView="/0/@diagram/@topLevelNodes.9/@labels.0"
+ visualID="NamedElement_NameLabel"/>
+ </child>
+ <child
+ genView="/0/@diagram/@topLevelNodes.10"
+ visualID="DeploymentSpecification_Shape">
+ <child
+ genView="/0/@diagram/@topLevelNodes.10/@labels.0"
+ visualID="DeploymentSpecification_NameLabel"/>
+ <child
+ genView="/0/@diagram/@topLevelNodes.10/@labels.1"
+ visualID="DeploymentSpecification_FloatingNameLabel"/>
+ </child>
+ <child
+ genView="/0/@diagram/@links.0"
+ visualID="Link_DescriptorEdge"/>
+ <child
+ genView="/0/@diagram/@links.1"
+ visualID="Comment_AnnotatedElementEdge"/>
+ <child
+ genView="/0/@diagram/@links.2"
+ visualID="Constraint_ConstrainedElementEdge"/>
+ <child
+ genView="/0/@diagram/@links.3"
+ visualID="Deployment_Edge">
+ <child
+ genView="/0/@diagram/@links.3/@labels.0"
+ visualID="Deployment_NameLabel"/>
+ <child
+ genView="/0/@diagram/@links.3/@labels.1"
+ visualID="Deployment_StereotypeLabel"/>
+ </child>
+ <child
+ genView="/0/@diagram/@links.4"
+ visualID="Manifestation_Edge">
+ <child
+ genView="/0/@diagram/@links.4/@labels.0"
+ visualID="Manifestation_NameLabel"/>
+ <child
+ genView="/0/@diagram/@links.4/@labels.1"
+ visualID="Manifestation_StereotypeLabel"/>
+ </child>
+ <child
+ genView="/0/@diagram/@links.5"
+ visualID="Generalization_Edge">
+ <child
+ genView="/0/@diagram/@links.5/@labels.0"
+ visualID="Generalization_StereotypeLabel"/>
+ </child>
+ <child
+ genView="/0/@diagram/@links.6"
+ visualID="Dependency_Edge">
+ <child
+ genView="/0/@diagram/@links.6/@labels.0"
+ visualID="Dependency_NameLabel"/>
+ <child
+ genView="/0/@diagram/@links.6/@labels.1"
+ visualID="Dependency_StereotypeLabel"/>
+ </child>
+ <child
+ genView="/0/@diagram/@links.7"
+ visualID="Dependency_BranchEdge"/>
+ <child
+ genView="/0/@diagram/@links.8"
+ visualID="CommunicationPath_Edge">
+ <child
+ genView="/0/@diagram/@links.8/@labels.0"
+ visualID="CommunicationPath_NameLabel"/>
+ <child
+ genView="/0/@diagram/@links.8/@labels.1"
+ visualID="CommunicationPath_StereotypeLabel"/>
+ </child>
+ </papyrusgmfgenextension:VisualIDOverride>
</xmi:XMI>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/plugin.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/plugin.properties
index 7fb05649149..fed93f41291 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/plugin.properties
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/plugin.properties
@@ -17,39 +17,6 @@ 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.Model_1000=DeploymentDiagram
-metatype.name.Comment_2001=Comment
-metatype.name.Constraint_2005=Constraint
-metatype.name.ExecutionEnvironment_2002=ExecutionEnvironment
-metatype.name.Device_2003=Device
-metatype.name.Artifact_2006=Artifact
-metatype.name.Node_2008=Node
-metatype.name.Node_23=Node
-metatype.name.Device_16=Device
-metatype.name.ExecutionEnvironment_21=ExecutionEnvironment
-metatype.name.Artifact_25=Artifact
-metatype.name.Artifact_28=Artifact
-metatype.name.Link_4005=Undefined
-metatype.name.CommentAnnotatedElement_4008=CommentAnnotatedElement
-metatype.name.ConstraintConstrainedElement_4009=ConstraintConstrainedElement
-metatype.name.Deployment_4001=Deployment
-metatype.name.Manifestation_4002=Manifestation
-metatype.name.Generalization_4003=Generalization
-metatype.name.Dependency_4004=Dependency
- cmdcategory.name=PapyrusUMLDeploymentDiagram Editor Commands
-cmdcategory.desc=PapyrusUMLDeploymentDiagram Editor Commands
-metatype.name.Package_1000=DeploymentDiagram
-metatype.name.Dependency_2011=DependencyNode
-metatype.name.Model_2010=Model
-metatype.name.Package_2009=Package
-metatype.name.NamedElement_2012=DefaultNamedElement
-metatype.name.Model_49=Model
-metatype.name.Package_36=Package
-metatype.name.Device_44=Device
-metatype.name.ExecutionEnvironment_46=ExecutionEnvironment
-metatype.name.Node_42=Node
-metatype.name.Artifact_40=Artifact
-metatype.name.Comment_54=Comment
-metatype.name.Constraint_56=Constraint
-metatype.name.Dependency_4010=DependencyBranchLink
+cmdcategory.name=PapyrusUMLDeploymentDiagram Editor Commands
+cmdcategory.desc=PapyrusUMLDeploymentDiagram Editor Commands
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/plugin.xml
index 8295be7d945..714a6b43f13 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/plugin.xml
@@ -529,8 +529,8 @@
<viewProvider class="org.eclipse.papyrus.uml.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="2011,2010,2009,2005,2001,2002,2003,2006,2008,2012,2013,49,36,16,44,21,46,23,42,25,28,40,54,56,2014,2015,2016"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4005,4008,4009,4001,4002,4003,4004,4010,4011"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="Dependency_Shape,Model_Shape,Package_Shape,Constraint_Shape,Comment_Shape,ExecutionEnvironment_Shape,Device_Shape,Artifact_Shape,Node_Shape,NamedElement_DefaultShape,DeploymentSpecification_Shape,Model_Shape_CN,Package_Shape_CN,Device_Shape_CCN,Device_Shape_CN,ExecutionEnvironment_Shape_CCN,ExecutionEnvironment_Shape_CN,Node_Shape_CCN,Node_Shape_CN,Artifact_Shape_CCN,Artifact_Shape_ACN,Artifact_Shape_CN,Comment_Shape_CN,Constraint_Shape_CN,DeploymentSpecification_Shape_CCN,DeploymentSpecification_Shape_CN,DeploymentSpecification_Shape_ACN"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="Link_DescriptorEdge,Comment_AnnotatedElementEdge,Constraint_ConstrainedElementEdge,Deployment_Edge,Manifestation_Edge,Generalization_Edge,Dependency_Edge,Dependency_BranchEdge,CommunicationPath_Edge"/>
</viewProvider>
</extension>
@@ -542,16 +542,16 @@
<method name="getType()" value="PapyrusUMLDeploymentDiagram"/>
</object>
<object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
- <method name="getType()" value="2011,2010,2009,2005,2001,2002,2003,2006,2008,2012,2013,49,36,16,44,21,46,23,42,25,28,40,54,56,2014,2015,2016"/>
+ <method name="getType()" value="Dependency_Shape,Model_Shape,Package_Shape,Constraint_Shape,Comment_Shape,ExecutionEnvironment_Shape,Device_Shape,Artifact_Shape,Node_Shape,NamedElement_DefaultShape,DeploymentSpecification_Shape,Model_Shape_CN,Package_Shape_CN,Device_Shape_CCN,Device_Shape_CN,ExecutionEnvironment_Shape_CCN,ExecutionEnvironment_Shape_CN,Node_Shape_CCN,Node_Shape_CN,Artifact_Shape_CCN,Artifact_Shape_ACN,Artifact_Shape_CN,Comment_Shape_CN,Constraint_Shape_CN,DeploymentSpecification_Shape_CCN,DeploymentSpecification_Shape_CN,DeploymentSpecification_Shape_ACN"/>
</object>
<object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
- <method name="getType()" value="4005,4008,4009,4001,4002,4003,4004,4010,4011"/>
+ <method name="getType()" value="Link_DescriptorEdge,Comment_AnnotatedElementEdge,Constraint_ConstrainedElementEdge,Deployment_Edge,Manifestation_Edge,Generalization_Edge,Dependency_Edge,Dependency_BranchEdge,CommunicationPath_Edge"/>
</object>
<object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
- <method name="getType()" value="7,48,35,2,3,1,5,6,8,61,9,53,62,63,50,37,20,45,22,47,24,43,27,59,29,60,41,55,57,58,64,65,66,67,68,69"/>
+ <method name="getType()" value="Dependency_MultiNameLabel,Model_NameLabel,Package_NameLabel,Constraint_NameLabel,Constraint_BodyLabel,Comment_BodyLabel,ExecutionEnvironment_NameLabel,Device_NameLabel,Artifact_NameLabel,Artifact_FloatingNameLabel,Node_NameLabel,NamedElement_NameLabel,DeploymentSpecification_NameLabel,DeploymentSpecification_FloatingNameLabel,Model_NameLabel_CN,Package_NameLabel_CN,Device_NameLabel_CCN,Device_NameLabel_CN,ExecutionEnvironment_NameLabel_CCN,ExecutionEnvironment_NameLabel_CN,Node_NameLabel_CCN,Node_NameLabel_CN,Artifact_NameLabel_CCN,Artifact_FloatingNameLabel_CCN,Artifact_NameLabel_ACN,Artifact_FloatingNameLabel_ACN,Artifact_NameLabel_CN,Comment_BodyLabel_CN,Constraint_NameLabel_CN,Constraint_BodyLabel_CN,DeploymentSpecification_NameLabel_CCN,DeploymentSpecification_FloatingNameLabel_CCN,DeploymentSpecification_NameLabel_CN,DeploymentSpecification_FloatingNameLabel_CN,DeploymentSpecification_NameLabel_ACN,DeploymentSpecification_FloatingNameLabel_ACN"/>
</object>
<object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
- <method name="getType()" value="51,38,17,18,19,26,52,39,30,31,32,33,34"/>
+ <method name="getType()" value="Model_PackagedElementCompartment,Package_PackagedElementCompartment,Device_NestedNodeCompartment,ExecutionEnvironment_NestedNodeCompartment,Node_NestedNodeCompartment,Artifact_NestedArtifactCompartment,Model_PackagedElementCompartment_CN,Package_PackagedElementCompartment_CN,Device_NestedNodeCompartment_CN,ExecutionEnvironment_NestedNodeCompartment_CN,Node_NestedNodeCompartment_CN,Artifact_NestedArtifactCompartment_CCN,Artifact_NestedArtifactCompartment_ACN"/>
</object>
<context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/>
</editpartProvider>
@@ -612,111 +612,111 @@
<mapping type="PapyrusUMLDeploymentDiagram" humanReadableType="DeploymentDiagram"/>
<mapping
humanReadableType="Model"
- type="51">
+ type="Model_PackagedElementCompartment">
</mapping>
<mapping
humanReadableType="PackageableElement"
- type="38">
+ type="Package_PackagedElementCompartment">
</mapping>
<mapping
humanReadableType="DeviceComposite"
- type="17">
+ type="Device_NestedNodeCompartment">
</mapping>
<mapping
humanReadableType="ExecutionEnvironmentComposite"
- type="18">
+ type="ExecutionEnvironment_NestedNodeCompartment">
</mapping>
<mapping
humanReadableType="Composite"
- type="19">
+ type="Node_NestedNodeCompartment">
</mapping>
<mapping
humanReadableType="ArtifactComposite"
- type="26">
+ type="Artifact_NestedArtifactCompartment">
</mapping>
<mapping
humanReadableType="Model"
- type="52">
+ type="Model_PackagedElementCompartment_CN">
</mapping>
<mapping
humanReadableType="PackageableElement"
- type="39">
+ type="Package_PackagedElementCompartment_CN">
</mapping>
<mapping
humanReadableType="DeviceComposite"
- type="30">
+ type="Device_NestedNodeCompartment_CN">
</mapping>
<mapping
humanReadableType="ExecutionEnvironmentComposite"
- type="31">
+ type="ExecutionEnvironment_NestedNodeCompartment_CN">
</mapping>
<mapping
humanReadableType="Composite"
- type="32">
+ type="Node_NestedNodeCompartment_CN">
</mapping>
<mapping
humanReadableType="ArtifactComposite"
- type="33">
+ type="Artifact_NestedArtifactCompartment_CCN">
</mapping>
<mapping
humanReadableType="ArtifactComposite"
- type="34">
+ type="Artifact_NestedArtifactCompartment_ACN">
</mapping>
<mapping
humanReadableType="Name"
- type="13">
+ type="Deployment_NameLabel">
</mapping>
<mapping
humanReadableType="Stereotype"
- type="14">
+ type="Deployment_StereotypeLabel">
</mapping>
<mapping
humanReadableType="Name"
- type="10">
+ type="Manifestation_NameLabel">
</mapping>
<mapping
humanReadableType="Stereotype"
- type="11">
+ type="Manifestation_StereotypeLabel">
</mapping>
<mapping
humanReadableType="Stereotype"
- type="4">
+ type="Generalization_StereotypeLabel">
</mapping>
<mapping
humanReadableType="Name"
- type="12">
+ type="Dependency_NameLabel">
</mapping>
<mapping
humanReadableType="Stereotype"
- type="15">
+ type="Dependency_StereotypeLabel">
</mapping>
<mapping
humanReadableType="Floating Label"
- type="59">
+ type="Artifact_FloatingNameLabel_CCN">
</mapping>
<mapping
humanReadableType="Floating Label"
- type="60">
+ type="Artifact_FloatingNameLabel_ACN">
</mapping>
<mapping
humanReadableType="Floating Label"
- type="65">
+ type="DeploymentSpecification_FloatingNameLabel_CCN">
</mapping>
<mapping
humanReadableType="Floating Label"
- type="67">
+ type="DeploymentSpecification_FloatingNameLabel_CN">
</mapping>
<mapping
humanReadableType="Floating Label"
- type="69">
+ type="DeploymentSpecification_FloatingNameLabel_ACN">
</mapping>
<mapping
humanReadableType="Floating Label"
- type="61">
+ type="Artifact_FloatingNameLabel">
</mapping>
<mapping
humanReadableType="Floating Label"
- type="63">
+ type="DeploymentSpecification_FloatingNameLabel">
</mapping>
</diagramMappings>
</extension>
@@ -735,7 +735,7 @@
point="org.eclipse.papyrus.infra.gmfdiag.common.diagramReconciler">
<diagramReconciler
diagramType="PapyrusUMLDeploymentDiagram"
- reconcilerClass="org.eclipse.papyrus.uml.diagram.deployment.custom.migration.DeploymentReconcilier"
+ reconcilerClass="org.eclipse.papyrus.uml.diagram.deployment.custom.migration.DeploymentReconciler"
source="undefined"
target="1.1.0">
</diagramReconciler>
@@ -745,20 +745,12 @@
source="undefined"
target="1.2.0">
</diagramReconciler>
-</extension>
-<extension
- point="org.eclipse.papyrus.infra.types.core.elementTypeSetConfiguration">
- <elementTypeSet
- clientContextID="org.eclipse.papyrus.infra.services.edit.TypeContext"
- path="model/DeploymentDiagram.elementtypesconfigurations">
- </elementTypeSet>
-</extension>
-<extension
- point="org.eclipse.papyrus.infra.types.core.elementTypeSetConfiguration">
- <elementTypeSet
- clientContextID="org.eclipse.papyrus.infra.services.edit.TypeContext"
- path="model/DeploymentDiagram-notation.elementtypesconfigurations">
- </elementTypeSet>
+ <diagramReconciler
+ diagramType="PapyrusUMLDeploymentDiagram"
+ reconcilerClass="org.eclipse.papyrus.uml.diagram.deployment.custom.migration.DeploymentReconciler_1_2_0"
+ source="1.1.0"
+ target="1.2.0">
+ </diagramReconciler>
</extension>
<extension point="org.eclipse.papyrus.infra.gmfdiag.common.visualTypeProviders">
<?gmfgen generated="true"?>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPart.java
index a6eb383c1e0..ec4d7ce047c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPart.java
@@ -42,7 +42,7 @@ public class ArtifactCompositeCompartmentEditPart extends LinkLFShapeCompartment
/**
* @generated
*/
- public static final String VISUAL_ID = "26";
+ public static final String VISUAL_ID = "Artifact_NestedArtifactCompartment";
/**
* @generated
@@ -72,6 +72,7 @@ public class ArtifactCompositeCompartmentEditPart extends LinkLFShapeCompartment
installEditPolicy(PasteEditPolicy.PASTE_ROLE, new PasteEditPolicy());
//in Papyrus diagrams are not strongly synchronised
//installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.deployment.edit.policies.ArtifactCompositeCompartmentCanonicalEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
installEditPolicy(BorderDisplayEditPolicy.BORDER_DISPLAY_EDITPOLICY, new BorderDisplayEditPolicy());
@@ -82,7 +83,7 @@ public class ArtifactCompositeCompartmentEditPart extends LinkLFShapeCompartment
*/
@Override
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -92,6 +93,7 @@ public class ArtifactCompositeCompartmentEditPart extends LinkLFShapeCompartment
*/
@Override
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -101,7 +103,10 @@ public class ArtifactCompositeCompartmentEditPart extends LinkLFShapeCompartment
@Override
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)) {
+ 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);
@@ -111,13 +116,13 @@ public class ArtifactCompositeCompartmentEditPart extends LinkLFShapeCompartment
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ 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();
+ 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));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartACN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartACN.java
index 2eabee8af09..07bca9b3c0d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartACN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartACN.java
@@ -42,7 +42,7 @@ public class ArtifactCompositeCompartmentEditPartACN extends LinkLFShapeCompartm
/**
* @generated
*/
- public static final String VISUAL_ID = "34";
+ public static final String VISUAL_ID = "Artifact_NestedArtifactCompartment_ACN";
/**
* @generated
@@ -72,6 +72,7 @@ public class ArtifactCompositeCompartmentEditPartACN extends LinkLFShapeCompartm
installEditPolicy(PasteEditPolicy.PASTE_ROLE, new PasteEditPolicy());
//in Papyrus diagrams are not strongly synchronised
//installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.deployment.edit.policies.ArtifactCompositeCompartmentCanonicalEditPolicyACN());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
installEditPolicy(BorderDisplayEditPolicy.BORDER_DISPLAY_EDITPOLICY, new BorderDisplayEditPolicy());
@@ -82,7 +83,7 @@ public class ArtifactCompositeCompartmentEditPartACN extends LinkLFShapeCompartm
*/
@Override
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -92,6 +93,7 @@ public class ArtifactCompositeCompartmentEditPartACN extends LinkLFShapeCompartm
*/
@Override
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -101,7 +103,10 @@ public class ArtifactCompositeCompartmentEditPartACN extends LinkLFShapeCompartm
@Override
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)) {
+ 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);
@@ -111,13 +116,13 @@ public class ArtifactCompositeCompartmentEditPartACN extends LinkLFShapeCompartm
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ 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();
+ 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));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartCN.java
index 928b68744ce..21713fb9fc2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactCompositeCompartmentEditPartCN.java
@@ -42,7 +42,7 @@ public class ArtifactCompositeCompartmentEditPartCN extends LinkLFShapeCompartme
/**
* @generated
*/
- public static final String VISUAL_ID = "33";
+ public static final String VISUAL_ID = "Artifact_NestedArtifactCompartment_CCN";
/**
* @generated
@@ -72,6 +72,7 @@ public class ArtifactCompositeCompartmentEditPartCN extends LinkLFShapeCompartme
installEditPolicy(PasteEditPolicy.PASTE_ROLE, new PasteEditPolicy());
//in Papyrus diagrams are not strongly synchronised
//installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.deployment.edit.policies.ArtifactCompositeCompartmentCanonicalEditPolicyCN());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
installEditPolicy(BorderDisplayEditPolicy.BORDER_DISPLAY_EDITPOLICY, new BorderDisplayEditPolicy());
@@ -82,7 +83,7 @@ public class ArtifactCompositeCompartmentEditPartCN extends LinkLFShapeCompartme
*/
@Override
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -92,6 +93,7 @@ public class ArtifactCompositeCompartmentEditPartCN extends LinkLFShapeCompartme
*/
@Override
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -101,7 +103,10 @@ public class ArtifactCompositeCompartmentEditPartCN extends LinkLFShapeCompartme
@Override
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)) {
+ 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);
@@ -111,13 +116,13 @@ public class ArtifactCompositeCompartmentEditPartCN extends LinkLFShapeCompartme
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ 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();
+ 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));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactEditPart.java
index 4e70b36101f..02c4d92b6f8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactEditPart.java
@@ -64,7 +64,7 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
/**
* @generated
*/
- public static final String VISUAL_ID = "2006";
+ public static final String VISUAL_ID = "Artifact_Shape";
/**
* @generated
@@ -90,13 +90,18 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY,
+ new AppliedStereotypeNodeLabelDisplayEditPolicy());
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(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY,
+ new ShowHideCompartmentEditPolicy());
+ installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY,
+ new ShowHideClassifierContentsEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomGraphicalNodeEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy());
@@ -112,16 +117,16 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
+ View childView = (View) child.getModel();
String vid = UMLVisualIDRegistry.getVisualID(childView);
- if(vid != null) {
- switch(vid) {
+ if (vid != null) {
+ switch (vid) {
case ArtifactFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -129,7 +134,7 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
}
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -159,16 +164,17 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
* when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart
* Registry. After that, we can't reset the visibility to true (using the Show/Hide Label Action)!
*/
- if(NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
+ if (NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
Object notifier = event.getNotifier();
- List<?> modelChildren = ((View)getModel()).getChildren();
- if(false == notifier instanceof Edge && false == notifier instanceof BasicCompartment) {
- if(modelChildren.contains(event.getNotifier())) {
+ List<?> modelChildren = ((View) getModel()).getChildren();
+ if (false == notifier instanceof Edge && false == notifier instanceof BasicCompartment) {
+ if (modelChildren.contains(event.getNotifier())) {
return;
}
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -186,23 +192,25 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
*/
@Override
public ArtifactFigure getPrimaryShape() {
- return (ArtifactFigure)primaryShape;
+ return (ArtifactFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPart) {
- ((ArtifactNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ArtifactNameEditPart) {
+ ((ArtifactNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof ArtifactCompositeCompartmentEditPart) {
+
+ 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());
+ pane.add(((ArtifactCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
+
return false;
}
@@ -210,12 +218,12 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPart) {
+ if (childEditPart instanceof ArtifactNameEditPart) {
return true;
}
- if(childEditPart instanceof ArtifactCompositeCompartmentEditPart) {
+ if (childEditPart instanceof ArtifactCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((ArtifactCompositeCompartmentEditPart)childEditPart).getFigure());
+ pane.remove(((ArtifactCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -226,7 +234,7 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
*/
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -237,7 +245,7 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
*/
@Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -248,10 +256,10 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
*/
@Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ArtifactCompositeCompartmentEditPart) {
+ if (editPart instanceof ArtifactCompositeCompartmentEditPart) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -262,7 +270,7 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
*/
@Override
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ArtifactFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof ArtifactFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -290,6 +298,7 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
@Override
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
@@ -302,7 +311,7 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
*/
@Override
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -315,7 +324,7 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
*/
@Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -326,7 +335,7 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
*/
@Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -344,8 +353,8 @@ public class ArtifactEditPart extends RoundedCompartmentEditPart {
*/
@Override
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactEditPartACN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactEditPartACN.java
index a968374e82e..b47ec0804d4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactEditPartACN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactEditPartACN.java
@@ -64,7 +64,7 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
/**
* @generated
*/
- public static final String VISUAL_ID = "28";
+ public static final String VISUAL_ID = "Artifact_Shape_ACN";
/**
* @generated
@@ -90,13 +90,18 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY,
+ new AppliedStereotypeNodeLabelDisplayEditPolicy());
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(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY,
+ new ShowHideCompartmentEditPolicy());
+ installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY,
+ new ShowHideClassifierContentsEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomGraphicalNodeEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy());
@@ -112,16 +117,16 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
+ View childView = (View) child.getModel();
String vid = UMLVisualIDRegistry.getVisualID(childView);
- if(vid != null) {
- switch(vid) {
+ if (vid != null) {
+ switch (vid) {
case ArtifactFloatingLabelEditPartACN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -129,7 +134,7 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
}
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -159,16 +164,17 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
* when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart
* Registry. After that, we can't reset the visibility to true (using the Show/Hide Label Action)!
*/
- if(NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
+ if (NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
Object notifier = event.getNotifier();
- List<?> modelChildren = ((View)getModel()).getChildren();
- if(false == notifier instanceof Edge && false == notifier instanceof BasicCompartment) {
- if(modelChildren.contains(event.getNotifier())) {
+ List<?> modelChildren = ((View) getModel()).getChildren();
+ if (false == notifier instanceof Edge && false == notifier instanceof BasicCompartment) {
+ if (modelChildren.contains(event.getNotifier())) {
return;
}
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -186,23 +192,25 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
*/
@Override
public ArtifactFigure getPrimaryShape() {
- return (ArtifactFigure)primaryShape;
+ return (ArtifactFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPartACN) {
- ((ArtifactNameEditPartACN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ArtifactNameEditPartACN) {
+ ((ArtifactNameEditPartACN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof ArtifactCompositeCompartmentEditPartACN) {
+
+ 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());
+ pane.add(((ArtifactCompositeCompartmentEditPartACN) childEditPart).getFigure());
return true;
}
+
return false;
}
@@ -210,12 +218,12 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPartACN) {
+ if (childEditPart instanceof ArtifactNameEditPartACN) {
return true;
}
- if(childEditPart instanceof ArtifactCompositeCompartmentEditPartACN) {
+ if (childEditPart instanceof ArtifactCompositeCompartmentEditPartACN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((ArtifactCompositeCompartmentEditPartACN)childEditPart).getFigure());
+ pane.remove(((ArtifactCompositeCompartmentEditPartACN) childEditPart).getFigure());
return true;
}
return false;
@@ -226,7 +234,7 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
*/
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -237,7 +245,7 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
*/
@Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -248,10 +256,10 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
*/
@Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ArtifactCompositeCompartmentEditPartACN) {
+ if (editPart instanceof ArtifactCompositeCompartmentEditPartACN) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -262,7 +270,7 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
*/
@Override
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ArtifactFloatingLabelEditPartACN) {
+ if (borderItemEditPart instanceof ArtifactFloatingLabelEditPartACN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -290,6 +298,7 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
@Override
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
@@ -302,7 +311,7 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
*/
@Override
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -315,7 +324,7 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
*/
@Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -326,7 +335,7 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
*/
@Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -344,8 +353,8 @@ public class ArtifactEditPartACN extends RoundedCompartmentEditPart {
*/
@Override
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactEditPartCN.java
index 1554df6d783..a97909526e9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactEditPartCN.java
@@ -64,7 +64,7 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
/**
* @generated
*/
- public static final String VISUAL_ID = "25";
+ public static final String VISUAL_ID = "Artifact_Shape_CCN";
/**
* @generated
@@ -90,13 +90,18 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY,
+ new AppliedStereotypeNodeLabelDisplayEditPolicy());
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(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY,
+ new ShowHideCompartmentEditPolicy());
+ installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY,
+ new ShowHideClassifierContentsEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomGraphicalNodeEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy());
@@ -112,16 +117,16 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
+ View childView = (View) child.getModel();
String vid = UMLVisualIDRegistry.getVisualID(childView);
- if(vid != null) {
- switch(vid) {
+ if (vid != null) {
+ switch (vid) {
case ArtifactFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -129,7 +134,7 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
}
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -159,16 +164,17 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
* when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart
* Registry. After that, we can't reset the visibility to true (using the Show/Hide Label Action)!
*/
- if(NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
+ if (NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
Object notifier = event.getNotifier();
- List<?> modelChildren = ((View)getModel()).getChildren();
- if(false == notifier instanceof Edge && false == notifier instanceof BasicCompartment) {
- if(modelChildren.contains(event.getNotifier())) {
+ List<?> modelChildren = ((View) getModel()).getChildren();
+ if (false == notifier instanceof Edge && false == notifier instanceof BasicCompartment) {
+ if (modelChildren.contains(event.getNotifier())) {
return;
}
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -186,23 +192,25 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
*/
@Override
public ArtifactFigure getPrimaryShape() {
- return (ArtifactFigure)primaryShape;
+ return (ArtifactFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPartCN) {
- ((ArtifactNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ArtifactNameEditPartCN) {
+ ((ArtifactNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof ArtifactCompositeCompartmentEditPartCN) {
+
+ 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());
+ pane.add(((ArtifactCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
+
return false;
}
@@ -210,12 +218,12 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPartCN) {
+ if (childEditPart instanceof ArtifactNameEditPartCN) {
return true;
}
- if(childEditPart instanceof ArtifactCompositeCompartmentEditPartCN) {
+ if (childEditPart instanceof ArtifactCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((ArtifactCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((ArtifactCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
return false;
@@ -226,7 +234,7 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
*/
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -237,7 +245,7 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
*/
@Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -248,10 +256,10 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
*/
@Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ArtifactCompositeCompartmentEditPartCN) {
+ if (editPart instanceof ArtifactCompositeCompartmentEditPartCN) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -262,7 +270,7 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
*/
@Override
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ArtifactFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof ArtifactFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -290,6 +298,7 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
@Override
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
@@ -302,7 +311,7 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
*/
@Override
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -315,7 +324,7 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
*/
@Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -326,7 +335,7 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
*/
@Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -344,8 +353,8 @@ public class ArtifactEditPartCN extends RoundedCompartmentEditPart {
*/
@Override
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactFloatingLabelEditPart.java
index 9f2d32d0c89..127ee4cbf7a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactFloatingLabelEditPart.java
@@ -63,6 +63,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimar
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editparts.FloatingLabelEditPart;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
@@ -84,12 +85,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart implements ITextAwareEditPart, IBorderItemEditPart {
+public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart
+ implements ITextAwareEditPart, IBorderItemEditPart {
/**
* @generated
*/
- public static final String VISUAL_ID = "61";
+ public static final String VISUAL_ID = "Artifact_FloatingNameLabel";
/**
* @generated
@@ -128,7 +130,10 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactFloatingLabelEditPart.VISUAL_ID), new Point(0, 0));
+ registerSnapBackPosition(
+ UMLVisualIDRegistry.getType(
+ org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactFloatingLabelEditPart.VISUAL_ID),
+ new Point(0, 0));
}
/**
@@ -155,9 +160,9 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
@Override
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -167,10 +172,10 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
@Override
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();
+ 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));
}
@@ -178,12 +183,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -191,12 +196,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -204,12 +209,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -217,12 +222,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -280,10 +285,11 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -296,12 +302,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -310,10 +316,11 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
@Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
/**
@@ -332,22 +339,26 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
+ .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(
+ parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(),
+ ArtifactFloatingLabelEditPart.this), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -359,10 +370,10 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
@Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
}
/**
@@ -378,8 +389,8 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
@Override
public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Artifact_2006, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactFloatingLabelEditPart.VISUAL_ID));
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.Artifact_Shape, getParserElement(), this, VISUAL_ID);
}
return parser;
}
@@ -388,8 +399,10 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -418,8 +431,8 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -427,8 +440,8 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -439,46 +452,58 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
@Override
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ 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) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else 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(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } 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(),
+ configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ 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());
+ configuration.postEditAction(resolveSemanticElement(),
+ ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -500,12 +525,13 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -536,20 +562,20 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -557,15 +583,15 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -574,9 +600,9 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -585,9 +611,10 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
@Override
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));
+ 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);
}
}
@@ -605,11 +632,11 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
@Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ 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$
+ 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();
@@ -621,8 +648,8 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
@Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -635,7 +662,7 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
@Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -661,13 +688,14 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -679,7 +707,7 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
@@ -701,12 +729,15 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @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(), this);
+ 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(),
+ this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
+ resolveSemanticElement(), this);
}
}
}
@@ -717,10 +748,13 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")
+ && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
+ this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -739,12 +773,15 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
@Override
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);
+ 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;
+ } else if ((theRequest instanceof DirectEditRequest)
+ && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -763,24 +800,27 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
@Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ 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)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } 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)) {
+ } 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())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactFloatingLabelEditPartACN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactFloatingLabelEditPartACN.java
index fe18c4def07..cf6681cfde9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactFloatingLabelEditPartACN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactFloatingLabelEditPartACN.java
@@ -63,6 +63,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimar
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editparts.FloatingLabelEditPart;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
@@ -84,12 +85,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart implements ITextAwareEditPart, IBorderItemEditPart {
+public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart
+ implements ITextAwareEditPart, IBorderItemEditPart {
/**
* @generated
*/
- public static final String VISUAL_ID = "60";
+ public static final String VISUAL_ID = "Artifact_FloatingNameLabel_ACN";
/**
* @generated
@@ -128,7 +130,10 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
* @generated
*/
static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactFloatingLabelEditPartACN.VISUAL_ID), new Point(0, 0));
+ registerSnapBackPosition(
+ UMLVisualIDRegistry.getType(
+ org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactFloatingLabelEditPartACN.VISUAL_ID),
+ new Point(0, 0));
}
/**
@@ -155,9 +160,9 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
@Override
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -167,10 +172,10 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
*/
@Override
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();
+ 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));
}
@@ -178,12 +183,12 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -191,12 +196,12 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -204,12 +209,12 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -217,12 +222,12 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -280,10 +285,11 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -296,12 +302,12 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -310,10 +316,11 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
*/
@Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
/**
@@ -332,22 +339,28 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
+ .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(
+ parser.isValidEditString(
+ ParserUtil.getParserAdapter(getParserElement(),
+ ArtifactFloatingLabelEditPartACN.this),
+ (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -359,10 +372,10 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
*/
@Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
}
/**
@@ -378,8 +391,8 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
*/
@Override
public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Artifact_28, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactFloatingLabelEditPartACN.VISUAL_ID));
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.Artifact_Shape_ACN, getParserElement(), this, VISUAL_ID);
}
return parser;
}
@@ -388,8 +401,10 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -418,8 +433,8 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -427,8 +442,8 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
* @generated
*/
protected void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -439,46 +454,58 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
*/
@Override
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ 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) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else 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(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } 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(),
+ configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ 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());
+ configuration.postEditAction(resolveSemanticElement(),
+ ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -500,12 +527,13 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -536,20 +564,20 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -557,15 +585,15 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -574,9 +602,9 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -585,9 +613,10 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
*/
@Override
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));
+ 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);
}
}
@@ -605,11 +634,11 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
*/
@Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ 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$
+ 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();
@@ -621,8 +650,8 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
*/
@Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -635,7 +664,7 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
*/
@Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -661,13 +690,14 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -679,7 +709,7 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
@@ -701,12 +731,15 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
* @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(), this);
+ 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(),
+ this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
+ resolveSemanticElement(), this);
}
}
}
@@ -717,10 +750,13 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")
+ && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
+ this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -739,12 +775,15 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
@Override
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);
+ 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;
+ } else if ((theRequest instanceof DirectEditRequest)
+ && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -763,24 +802,27 @@ public class ArtifactFloatingLabelEditPartACN extends FloatingLabelEditPart impl
@Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ 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)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } 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)) {
+ } 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())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactFloatingLabelEditPartCN.java
index f8ccdcfec2a..e02615c0b98 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactFloatingLabelEditPartCN.java
@@ -63,6 +63,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimar
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editparts.FloatingLabelEditPart;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
@@ -84,12 +85,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart implements ITextAwareEditPart, IBorderItemEditPart {
+public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart
+ implements ITextAwareEditPart, IBorderItemEditPart {
/**
* @generated
*/
- public static final String VISUAL_ID = "59";
+ public static final String VISUAL_ID = "Artifact_FloatingNameLabel_CCN";
/**
* @generated
@@ -128,7 +130,10 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactFloatingLabelEditPartCN.VISUAL_ID), new Point(0, 0));
+ registerSnapBackPosition(
+ UMLVisualIDRegistry.getType(
+ org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactFloatingLabelEditPartCN.VISUAL_ID),
+ new Point(0, 0));
}
/**
@@ -155,9 +160,9 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
@Override
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -167,10 +172,10 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
@Override
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();
+ 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));
}
@@ -178,12 +183,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -191,12 +196,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -204,12 +209,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -217,12 +222,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -280,10 +285,11 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -296,12 +302,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -310,10 +316,11 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
@Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
/**
@@ -332,22 +339,26 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
+ .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(
+ parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(),
+ ArtifactFloatingLabelEditPartCN.this), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -359,10 +370,10 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
@Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
}
/**
@@ -378,8 +389,8 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
@Override
public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Artifact_25, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactFloatingLabelEditPartCN.VISUAL_ID));
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.Artifact_Shape_CCN, getParserElement(), this, VISUAL_ID);
}
return parser;
}
@@ -388,8 +399,10 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -418,8 +431,8 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -427,8 +440,8 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -439,46 +452,58 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
@Override
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ 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) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else 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(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } 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(),
+ configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ 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());
+ configuration.postEditAction(resolveSemanticElement(),
+ ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -500,12 +525,13 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -536,20 +562,20 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -557,15 +583,15 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -574,9 +600,9 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -585,9 +611,10 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
@Override
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));
+ 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);
}
}
@@ -605,11 +632,11 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
@Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ 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$
+ 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();
@@ -621,8 +648,8 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
@Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -635,7 +662,7 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
@Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -661,13 +688,14 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -679,7 +707,7 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
@@ -701,12 +729,15 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @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(), this);
+ 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(),
+ this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
+ resolveSemanticElement(), this);
}
}
}
@@ -717,10 +748,13 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")
+ && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
+ this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -739,12 +773,15 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
@Override
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);
+ 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;
+ } else if ((theRequest instanceof DirectEditRequest)
+ && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -763,24 +800,27 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
@Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ 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)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } 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)) {
+ } 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())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactNameEditPart.java
index 8b473f85c1b..a3e7d62ee22 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactNameEditPart.java
@@ -61,6 +61,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirect
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
@@ -81,12 +82,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
+public class ArtifactNameEditPart extends PapyrusCompartmentEditPart
+ implements ITextAwareEditPart, IControlParserForDirectEdit {
/**
* @generated
*/
- public static final String VISUAL_ID = "8";
+ public static final String VISUAL_ID = "Artifact_NameLabel";
/**
* @generated
@@ -144,12 +146,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -157,12 +159,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -170,12 +172,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -183,12 +185,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -247,10 +249,11 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -263,12 +266,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -277,10 +280,11 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
*/
@Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
/**
@@ -299,22 +303,25 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
+ .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(ParserUtil.getParserAdapter(
+ getParserElement(), ArtifactNameEditPart.this), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -326,10 +333,10 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
*/
@Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
}
/**
@@ -345,8 +352,8 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
*/
@Override
public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Artifact_2006, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactNameEditPart.VISUAL_ID));
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.Artifact_Shape, getParserElement(), this, VISUAL_ID);
}
return parser;
}
@@ -355,8 +362,10 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -385,8 +394,8 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -394,8 +403,8 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -406,46 +415,58 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
*/
@Override
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ 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) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else 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(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } 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(),
+ configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ 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());
+ configuration.postEditAction(resolveSemanticElement(),
+ ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -467,12 +488,13 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +525,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +539,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +552,15 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +569,9 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -558,9 +580,10 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
*/
@Override
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));
+ 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);
}
}
@@ -578,11 +601,11 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
*/
@Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ 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$
+ 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();
@@ -594,8 +617,8 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
*/
@Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -608,7 +631,7 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
*/
@Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -634,13 +657,14 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -652,7 +676,7 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
@@ -674,12 +698,15 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @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(), this);
+ 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(),
+ this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
+ resolveSemanticElement(), this);
}
}
}
@@ -690,10 +717,13 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")
+ && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
+ this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -712,12 +742,15 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
@Override
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);
+ 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;
+ } else if ((theRequest instanceof DirectEditRequest)
+ && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -755,24 +788,27 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ 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)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } 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)) {
+ } 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())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -809,7 +845,8 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -819,6 +856,7 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -826,5 +864,6 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactNameEditPartACN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactNameEditPartACN.java
index 6d896e0e4f5..24a47ce8e89 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactNameEditPartACN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactNameEditPartACN.java
@@ -61,6 +61,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirect
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
@@ -81,12 +82,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
+public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart
+ implements ITextAwareEditPart, IControlParserForDirectEdit {
/**
* @generated
*/
- public static final String VISUAL_ID = "29";
+ public static final String VISUAL_ID = "Artifact_NameLabel_ACN";
/**
* @generated
@@ -144,12 +146,12 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -157,12 +159,12 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -170,12 +172,12 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -183,12 +185,12 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -247,10 +249,11 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -263,12 +266,12 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -277,10 +280,11 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
*/
@Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
/**
@@ -299,22 +303,25 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
+ .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(ParserUtil.getParserAdapter(
+ getParserElement(), ArtifactNameEditPartACN.this), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -326,10 +333,10 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
*/
@Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
}
/**
@@ -345,8 +352,8 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
*/
@Override
public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Artifact_28, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactNameEditPartACN.VISUAL_ID));
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.Artifact_Shape_ACN, getParserElement(), this, VISUAL_ID);
}
return parser;
}
@@ -355,8 +362,10 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -385,8 +394,8 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -394,8 +403,8 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -406,46 +415,58 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
*/
@Override
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ 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) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else 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(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } 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(),
+ configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ 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());
+ configuration.postEditAction(resolveSemanticElement(),
+ ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -467,12 +488,13 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +525,12 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +539,12 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +552,15 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +569,9 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -558,9 +580,10 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
*/
@Override
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));
+ 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);
}
}
@@ -578,11 +601,11 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
*/
@Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ 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$
+ 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();
@@ -594,8 +617,8 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
*/
@Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -608,7 +631,7 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
*/
@Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -634,13 +657,14 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -652,7 +676,7 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
@@ -674,12 +698,15 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
* @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(), this);
+ 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(),
+ this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
+ resolveSemanticElement(), this);
}
}
}
@@ -690,10 +717,13 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")
+ && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
+ this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -712,12 +742,15 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
@Override
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);
+ 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;
+ } else if ((theRequest instanceof DirectEditRequest)
+ && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -755,24 +788,27 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ 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)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } 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)) {
+ } 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())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -809,7 +845,8 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -819,6 +856,7 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -826,5 +864,6 @@ public class ArtifactNameEditPartACN extends PapyrusCompartmentEditPart implemen
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactNameEditPartCN.java
index d85239e2d2e..7c085e21ee9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ArtifactNameEditPartCN.java
@@ -61,6 +61,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirect
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
@@ -81,12 +82,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
+public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart
+ implements ITextAwareEditPart, IControlParserForDirectEdit {
/**
* @generated
*/
- public static final String VISUAL_ID = "27";
+ public static final String VISUAL_ID = "Artifact_NameLabel_CCN";
/**
* @generated
@@ -144,12 +146,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -157,12 +159,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -170,12 +172,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -183,12 +185,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -247,10 +249,11 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -263,12 +266,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -277,10 +280,11 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
@Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
/**
@@ -299,22 +303,25 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
+ .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(ParserUtil.getParserAdapter(
+ getParserElement(), ArtifactNameEditPartCN.this), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -326,10 +333,10 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
@Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
}
/**
@@ -345,8 +352,8 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
@Override
public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Artifact_25, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ArtifactNameEditPartCN.VISUAL_ID));
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.Artifact_Shape_CCN, getParserElement(), this, VISUAL_ID);
}
return parser;
}
@@ -355,8 +362,10 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -385,8 +394,8 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -394,8 +403,8 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -406,46 +415,58 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
@Override
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ 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) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else 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(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } 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(),
+ configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ 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());
+ configuration.postEditAction(resolveSemanticElement(),
+ ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -467,12 +488,13 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +525,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +539,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +552,15 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +569,9 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -558,9 +580,10 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
@Override
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));
+ 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);
}
}
@@ -578,11 +601,11 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
@Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ 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$
+ 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();
@@ -594,8 +617,8 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
@Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -608,7 +631,7 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
@Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -634,13 +657,14 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -652,7 +676,7 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
@@ -674,12 +698,15 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @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(), this);
+ 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(),
+ this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
+ resolveSemanticElement(), this);
}
}
}
@@ -690,10 +717,13 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")
+ && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
+ this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -712,12 +742,15 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
@Override
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);
+ 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;
+ } else if ((theRequest instanceof DirectEditRequest)
+ && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -755,24 +788,27 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ 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)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } 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)) {
+ } 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())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -809,7 +845,8 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -819,6 +856,7 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -826,5 +864,6 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentAnnotatedElementEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentAnnotatedElementEditPart.java
index 34d89446fcd..797c0bb3393 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentAnnotatedElementEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentAnnotatedElementEditPart.java
@@ -27,7 +27,7 @@ public class CommentAnnotatedElementEditPart extends UMLConnectionNodeEditPart i
/**
* @generated
*/
- public static final String VISUAL_ID = "4008";
+ public static final String VISUAL_ID = "Comment_AnnotatedElementEdge";
/**
* @generated
@@ -63,6 +63,6 @@ public class CommentAnnotatedElementEditPart extends UMLConnectionNodeEditPart i
*/
@Override
public SimpleDashedEdgeFigure getPrimaryShape() {
- return (SimpleDashedEdgeFigure)getFigure();
+ return (SimpleDashedEdgeFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentBodyEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentBodyEditPart.java
index 43ec629dde5..5bdee74088f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentBodyEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentBodyEditPart.java
@@ -61,6 +61,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirect
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
@@ -81,12 +82,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
+public class CommentBodyEditPart extends PapyrusCompartmentEditPart
+ implements ITextAwareEditPart, IControlParserForDirectEdit {
/**
* @generated
*/
- public static final String VISUAL_ID = "1";
+ public static final String VISUAL_ID = "Comment_BodyLabel";
/**
* @generated
@@ -144,12 +146,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -157,12 +159,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -170,12 +172,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -183,12 +185,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -247,10 +249,11 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -263,12 +266,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -277,10 +280,11 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
*/
@Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
/**
@@ -299,22 +303,25 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
+ .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(ParserUtil.getParserAdapter(
+ getParserElement(), CommentBodyEditPart.this), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -326,10 +333,10 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
*/
@Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
}
/**
@@ -345,8 +352,8 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
*/
@Override
public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Comment_2001, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.CommentBodyEditPart.VISUAL_ID));
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.Comment_Shape, getParserElement(), this, VISUAL_ID);
}
return parser;
}
@@ -355,8 +362,10 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -385,8 +394,8 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -394,8 +403,8 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -406,46 +415,58 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
*/
@Override
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ 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) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else 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(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } 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(),
+ configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ 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());
+ configuration.postEditAction(resolveSemanticElement(),
+ ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -467,12 +488,13 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +525,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +539,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +552,15 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +569,9 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -558,9 +580,10 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
*/
@Override
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));
+ 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);
}
}
@@ -578,11 +601,11 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
*/
@Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ 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$
+ 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();
@@ -594,8 +617,8 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
*/
@Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -608,7 +631,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
*/
@Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -634,13 +657,14 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -652,7 +676,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
@@ -674,12 +698,15 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @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(), this);
+ 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(),
+ this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
+ resolveSemanticElement(), this);
}
}
}
@@ -690,10 +717,13 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")
+ && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
+ this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -712,12 +742,15 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
@Override
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);
+ 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;
+ } else if ((theRequest instanceof DirectEditRequest)
+ && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -755,24 +788,27 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ 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)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } 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)) {
+ } 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())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -809,7 +845,8 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -819,6 +856,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -826,5 +864,6 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentBodyEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentBodyEditPartCN.java
index 9465b1939eb..8beae8a85c6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentBodyEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentBodyEditPartCN.java
@@ -61,6 +61,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirect
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
@@ -81,12 +82,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
+public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart
+ implements ITextAwareEditPart, IControlParserForDirectEdit {
/**
* @generated
*/
- public static final String VISUAL_ID = "55";
+ public static final String VISUAL_ID = "Comment_BodyLabel_CN";
/**
* @generated
@@ -144,12 +146,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -157,12 +159,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -170,12 +172,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -183,12 +185,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -247,10 +249,11 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -263,12 +266,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -277,10 +280,11 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
*/
@Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
/**
@@ -299,22 +303,25 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
+ .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(ParserUtil.getParserAdapter(
+ getParserElement(), CommentBodyEditPartCN.this), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -326,10 +333,10 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
*/
@Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
}
/**
@@ -345,8 +352,8 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
*/
@Override
public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Comment_54, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.CommentBodyEditPartCN.VISUAL_ID));
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.Comment_Shape_CN, getParserElement(), this, VISUAL_ID);
}
return parser;
}
@@ -355,8 +362,10 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -385,8 +394,8 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -394,8 +403,8 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -406,46 +415,58 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
*/
@Override
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ 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) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else 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(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } 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(),
+ configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ 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());
+ configuration.postEditAction(resolveSemanticElement(),
+ ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -467,12 +488,13 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +525,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +539,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +552,15 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +569,9 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -558,9 +580,10 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
*/
@Override
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));
+ 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);
}
}
@@ -578,11 +601,11 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
*/
@Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ 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$
+ 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();
@@ -594,8 +617,8 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
*/
@Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -608,7 +631,7 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
*/
@Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -634,13 +657,14 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -652,7 +676,7 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
@@ -674,12 +698,15 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @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(), this);
+ 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(),
+ this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
+ resolveSemanticElement(), this);
}
}
}
@@ -690,10 +717,13 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")
+ && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
+ this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -712,12 +742,15 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
@Override
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);
+ 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;
+ } else if ((theRequest instanceof DirectEditRequest)
+ && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -755,24 +788,27 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ 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)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } 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)) {
+ } 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())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -809,7 +845,8 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -819,6 +856,7 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -826,5 +864,6 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentEditPart.java
index c7b91e97c1f..83f1488e07f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentEditPart.java
@@ -48,7 +48,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
- public static final String VISUAL_ID = "2001";
+ public static final String VISUAL_ID = "Comment_Shape";
/**
* @generated
@@ -74,9 +74,12 @@ public class CommentEditPart extends AbstractCommentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY,
+ new AppliedStereotypeNodeLabelDisplayEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomGraphicalNodeEditPolicy());
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PapyrusReflowableShapeEditPolicy());
@@ -93,7 +96,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -120,6 +123,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
@Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -137,17 +141,18 @@ public class CommentEditPart extends AbstractCommentEditPart {
*/
@Override
public HTMLCornerBentFigure getPrimaryShape() {
- return (HTMLCornerBentFigure)primaryShape;
+ return (HTMLCornerBentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPart) {
- ((CommentBodyEditPart)childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
+ if (childEditPart instanceof CommentBodyEditPart) {
+ ((CommentBodyEditPart) childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
return true;
}
+
return false;
}
@@ -155,7 +160,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPart) {
+ if (childEditPart instanceof CommentBodyEditPart) {
return true;
}
return false;
@@ -166,7 +171,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
*/
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -177,7 +182,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
*/
@Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -211,6 +216,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
@Override
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
@@ -223,7 +229,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
*/
@Override
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -236,7 +242,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
*/
@Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -247,7 +253,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
*/
@Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -265,8 +271,8 @@ public class CommentEditPart extends AbstractCommentEditPart {
*/
@Override
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentEditPartCN.java
index e1f6f894528..3532668834b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommentEditPartCN.java
@@ -48,7 +48,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
/**
* @generated
*/
- public static final String VISUAL_ID = "54";
+ public static final String VISUAL_ID = "Comment_Shape_CN";
/**
* @generated
@@ -74,9 +74,12 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY,
+ new AppliedStereotypeNodeLabelDisplayEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomGraphicalNodeEditPolicy());
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PapyrusReflowableShapeEditPolicy());
@@ -93,7 +96,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -120,6 +123,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
@Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -137,17 +141,18 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
*/
@Override
public HTMLCornerBentFigure getPrimaryShape() {
- return (HTMLCornerBentFigure)primaryShape;
+ return (HTMLCornerBentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPartCN) {
- ((CommentBodyEditPartCN)childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
+ if (childEditPart instanceof CommentBodyEditPartCN) {
+ ((CommentBodyEditPartCN) childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
return true;
}
+
return false;
}
@@ -155,7 +160,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPartCN) {
+ if (childEditPart instanceof CommentBodyEditPartCN) {
return true;
}
return false;
@@ -166,7 +171,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
*/
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -177,7 +182,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
*/
@Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -211,6 +216,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
@Override
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
@@ -223,7 +229,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
*/
@Override
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -236,7 +242,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
*/
@Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -247,7 +253,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
*/
@Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -265,8 +271,8 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
*/
@Override
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommunicationPathAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommunicationPathAppliedStereotypeEditPart.java
index 6fb53dfa98b..bc8dee72b7e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommunicationPathAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommunicationPathAppliedStereotypeEditPart.java
@@ -62,6 +62,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusLinkLabelDragPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
@@ -82,12 +83,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
+public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEditPart
+ implements ITextAwareEditPart, IControlParserForDirectEdit {
/**
* @generated
*/
- public static final String VISUAL_ID = "6002";
+ public static final String VISUAL_ID = "CommunicationPath_StereotypeLabel";
/**
* @generated
@@ -124,7 +126,10 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.CommunicationPathAppliedStereotypeEditPart.VISUAL_ID), new Point(0, 60));
+ registerSnapBackPosition(
+ UMLVisualIDRegistry.getType(
+ org.eclipse.papyrus.uml.diagram.deployment.edit.parts.CommunicationPathAppliedStereotypeEditPart.VISUAL_ID),
+ new Point(0, 60));
}
/**
@@ -156,12 +161,12 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -169,12 +174,12 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -182,12 +187,12 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -195,12 +200,12 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -256,10 +261,11 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -271,12 +277,12 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -284,10 +290,11 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
/**
@@ -305,22 +312,27 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
+ .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(
+ ParserUtil.getParserAdapter(getParserElement(),
+ CommunicationPathAppliedStereotypeEditPart.this),
+ (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -331,10 +343,10 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
}
/**
@@ -348,8 +360,8 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.CommunicationPath_4011, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.CommunicationPathAppliedStereotypeEditPart.VISUAL_ID));
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.CommunicationPath_Edge, getParserElement(), this, VISUAL_ID);
}
return parser;
}
@@ -358,8 +370,10 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -388,8 +402,8 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -397,8 +411,8 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -408,46 +422,58 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ 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) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else 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(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } 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(),
+ configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ 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());
+ configuration.postEditAction(resolveSemanticElement(),
+ ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -469,12 +495,13 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -504,20 +531,20 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -525,15 +552,15 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -542,9 +569,9 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -552,9 +579,10 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @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));
+ 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);
}
}
@@ -570,11 +598,11 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ 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$
+ 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();
@@ -585,8 +613,8 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -598,7 +626,7 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -624,13 +652,14 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -642,7 +671,7 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
@@ -663,12 +692,15 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @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(), this);
+ 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(),
+ this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
+ resolveSemanticElement(), this);
}
}
}
@@ -678,10 +710,13 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")
+ && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
+ this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -698,12 +733,15 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
@Override
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);
+ 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;
+ } else if ((theRequest instanceof DirectEditRequest)
+ && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -721,30 +759,34 @@ public class CommunicationPathAppliedStereotypeEditPart extends PapyrusLabelEdit
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ 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)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } 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)) {
+ } 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())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
+
super.handleNotificationEvent(event);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommunicationPathEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommunicationPathEditPart.java
index efe01f17bf7..8c9cb191712 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommunicationPathEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommunicationPathEditPart.java
@@ -30,7 +30,7 @@ public class CommunicationPathEditPart extends UMLConnectionNodeEditPart impleme
/**
* @generated
*/
- public static final String VISUAL_ID = "4011";
+ public static final String VISUAL_ID = "CommunicationPath_Edge";
/**
* @generated
@@ -45,7 +45,8 @@ public class CommunicationPathEditPart extends UMLConnectionNodeEditPart impleme
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY,
+ new AppliedStereotypeLinkLabelDisplayEditPolicy());
installEditPolicy(ShowHideLabelEditPolicy.SHOW_HIDE_LABEL_ROLE, new ShowHideLabelEditPolicy());
}
@@ -53,11 +54,12 @@ public class CommunicationPathEditPart extends UMLConnectionNodeEditPart impleme
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommunicationPathNameEditPart) {
- ((CommunicationPathNameEditPart)childEditPart).setLabel(getPrimaryShape().getAssociationNameLabel());
+ if (childEditPart instanceof CommunicationPathNameEditPart) {
+ ((CommunicationPathNameEditPart) childEditPart).setLabel(getPrimaryShape().getAssociationNameLabel());
}
- if(childEditPart instanceof CommunicationPathAppliedStereotypeEditPart) {
- ((CommunicationPathAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof CommunicationPathAppliedStereotypeEditPart) {
+ ((CommunicationPathAppliedStereotypeEditPart) childEditPart)
+ .setLabel(getPrimaryShape().getAppliedStereotypeLabel());
}
return false;
}
@@ -66,7 +68,7 @@ public class CommunicationPathEditPart extends UMLConnectionNodeEditPart impleme
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -76,10 +78,10 @@ public class CommunicationPathEditPart extends UMLConnectionNodeEditPart impleme
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommunicationPathNameEditPart) {
+ if (childEditPart instanceof CommunicationPathNameEditPart) {
return true;
}
- if(childEditPart instanceof CommunicationPathAppliedStereotypeEditPart) {
+ if (childEditPart instanceof CommunicationPathAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -89,7 +91,7 @@ public class CommunicationPathEditPart extends UMLConnectionNodeEditPart impleme
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -111,6 +113,6 @@ public class CommunicationPathEditPart extends UMLConnectionNodeEditPart impleme
* @generated
*/
public AssociationFigure getPrimaryShape() {
- return (AssociationFigure)getFigure();
+ return (AssociationFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommunicationPathNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommunicationPathNameEditPart.java
index 31da062671c..13810a8aae2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommunicationPathNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/CommunicationPathNameEditPart.java
@@ -62,6 +62,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusLinkLabelDragPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
@@ -82,12 +83,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
+public class CommunicationPathNameEditPart extends PapyrusLabelEditPart
+ implements ITextAwareEditPart, IControlParserForDirectEdit {
/**
* @generated
*/
- public static final String VISUAL_ID = "6001";
+ public static final String VISUAL_ID = "CommunicationPath_NameLabel";
/**
* @generated
@@ -124,7 +126,10 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.CommunicationPathNameEditPart.VISUAL_ID), new Point(0, 40));
+ registerSnapBackPosition(
+ UMLVisualIDRegistry.getType(
+ org.eclipse.papyrus.uml.diagram.deployment.edit.parts.CommunicationPathNameEditPart.VISUAL_ID),
+ new Point(0, 40));
}
/**
@@ -156,12 +161,12 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -169,12 +174,12 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -182,12 +187,12 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -195,12 +200,12 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -256,10 +261,11 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -271,12 +277,12 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -284,10 +290,11 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
/**
@@ -305,22 +312,26 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
+ .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(
+ parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(),
+ CommunicationPathNameEditPart.this), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -331,10 +342,10 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
}
/**
@@ -348,8 +359,8 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.CommunicationPath_4011, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.CommunicationPathNameEditPart.VISUAL_ID));
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.CommunicationPath_Edge, getParserElement(), this, VISUAL_ID);
}
return parser;
}
@@ -358,8 +369,10 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -388,8 +401,8 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -397,8 +410,8 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
protected void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -408,46 +421,58 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ 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) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else 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(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } 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(),
+ configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ 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());
+ configuration.postEditAction(resolveSemanticElement(),
+ ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -469,12 +494,13 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -504,20 +530,20 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -525,15 +551,15 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -542,9 +568,9 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -552,9 +578,10 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @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));
+ 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);
}
}
@@ -570,11 +597,11 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ 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$
+ 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();
@@ -585,8 +612,8 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -598,7 +625,7 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -624,13 +651,14 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -642,7 +670,7 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
@@ -663,12 +691,15 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @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(), this);
+ 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(),
+ this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
+ resolveSemanticElement(), this);
}
}
}
@@ -678,10 +709,13 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")
+ && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
+ this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -698,12 +732,15 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
@Override
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);
+ 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;
+ } else if ((theRequest instanceof DirectEditRequest)
+ && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -721,30 +758,34 @@ public class CommunicationPathNameEditPart extends PapyrusLabelEditPart implemen
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ 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)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } 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)) {
+ } 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())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
+
super.handleNotificationEvent(event);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintConstrainedElementEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintConstrainedElementEditPart.java
index 43dc9039641..024a41af975 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintConstrainedElementEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintConstrainedElementEditPart.java
@@ -27,7 +27,7 @@ public class ConstraintConstrainedElementEditPart extends UMLConnectionNodeEditP
/**
* @generated
*/
- public static final String VISUAL_ID = "4009";
+ public static final String VISUAL_ID = "Constraint_ConstrainedElementEdge";
/**
* @generated
@@ -63,6 +63,6 @@ public class ConstraintConstrainedElementEditPart extends UMLConnectionNodeEditP
*/
@Override
public SimpleDashedEdgeFigure getPrimaryShape() {
- return (SimpleDashedEdgeFigure)getFigure();
+ return (SimpleDashedEdgeFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintEditPart.java
index 9876135110e..29b4f7772ba 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintEditPart.java
@@ -47,7 +47,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* @generated
*/
- public static final String VISUAL_ID = "2005";
+ public static final String VISUAL_ID = "Constraint_Shape";
/**
* @generated
@@ -73,9 +73,12 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY,
+ new AppliedStereotypeNodeLabelDisplayEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomGraphicalNodeEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
@@ -91,7 +94,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -118,6 +121,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
@Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -135,21 +139,22 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
*/
@Override
public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
+ return (ConstraintFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPart) {
- ((ConstraintNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ConstraintNameEditPart) {
+ ((ConstraintNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof ConstraintSpecificationEditPart) {
- ((ConstraintSpecificationEditPart)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
+ if (childEditPart instanceof ConstraintSpecificationEditPart) {
+ ((ConstraintSpecificationEditPart) childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
return true;
}
+
return false;
}
@@ -157,10 +162,10 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPart) {
+ if (childEditPart instanceof ConstraintNameEditPart) {
return true;
}
- if(childEditPart instanceof ConstraintSpecificationEditPart) {
+ if (childEditPart instanceof ConstraintSpecificationEditPart) {
return true;
}
return false;
@@ -171,7 +176,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
*/
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -182,7 +187,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
*/
@Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,6 +221,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
@Override
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
@@ -228,7 +234,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
*/
@Override
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -241,7 +247,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
*/
@Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -252,7 +258,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
*/
@Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -270,8 +276,8 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
*/
@Override
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintEditPartCN.java
index 35ef64380db..eb5e1d4c0e6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintEditPartCN.java
@@ -47,7 +47,7 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
/**
* @generated
*/
- public static final String VISUAL_ID = "56";
+ public static final String VISUAL_ID = "Constraint_Shape_CN";
/**
* @generated
@@ -73,9 +73,12 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY,
+ new AppliedStereotypeNodeLabelDisplayEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomGraphicalNodeEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
@@ -91,7 +94,7 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -118,6 +121,7 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
@Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -135,21 +139,22 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
*/
@Override
public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
+ return (ConstraintFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPartCN) {
- ((ConstraintNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ConstraintNameEditPartCN) {
+ ((ConstraintNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof ConstraintSpecificationEditPartCN) {
- ((ConstraintSpecificationEditPartCN)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
+ if (childEditPart instanceof ConstraintSpecificationEditPartCN) {
+ ((ConstraintSpecificationEditPartCN) childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
return true;
}
+
return false;
}
@@ -157,10 +162,10 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPartCN) {
+ if (childEditPart instanceof ConstraintNameEditPartCN) {
return true;
}
- if(childEditPart instanceof ConstraintSpecificationEditPartCN) {
+ if (childEditPart instanceof ConstraintSpecificationEditPartCN) {
return true;
}
return false;
@@ -171,7 +176,7 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
*/
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -182,7 +187,7 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
*/
@Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,6 +221,7 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
@Override
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
@@ -228,7 +234,7 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
*/
@Override
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -241,7 +247,7 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
*/
@Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -252,7 +258,7 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
*/
@Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -270,8 +276,8 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
*/
@Override
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintNameEditPart.java
index 934cb97a611..6b3d737abf5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintNameEditPart.java
@@ -61,6 +61,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirect
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
@@ -81,12 +82,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
+public class ConstraintNameEditPart extends PapyrusCompartmentEditPart
+ implements ITextAwareEditPart, IControlParserForDirectEdit {
/**
* @generated
*/
- public static final String VISUAL_ID = "2";
+ public static final String VISUAL_ID = "Constraint_NameLabel";
/**
* @generated
@@ -144,12 +146,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -157,12 +159,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -170,12 +172,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -183,12 +185,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -247,10 +249,11 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -263,12 +266,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -277,10 +280,11 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
*/
@Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
/**
@@ -299,22 +303,25 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
+ .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(ParserUtil.getParserAdapter(
+ getParserElement(), ConstraintNameEditPart.this), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -326,10 +333,10 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
*/
@Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
}
/**
@@ -345,8 +352,8 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
*/
@Override
public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_2005, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ConstraintNameEditPart.VISUAL_ID));
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.Constraint_Shape, getParserElement(), this, VISUAL_ID);
}
return parser;
}
@@ -355,8 +362,10 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -385,8 +394,8 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -394,8 +403,8 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -406,46 +415,58 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
*/
@Override
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ 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) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else 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(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } 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(),
+ configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ 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());
+ configuration.postEditAction(resolveSemanticElement(),
+ ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -467,12 +488,13 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +525,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +539,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +552,15 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +569,9 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -558,9 +580,10 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
*/
@Override
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));
+ 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);
}
}
@@ -578,11 +601,11 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
*/
@Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ 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$
+ 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();
@@ -594,8 +617,8 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
*/
@Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -608,7 +631,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
*/
@Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -634,13 +657,14 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -652,7 +676,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
@@ -674,12 +698,15 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @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(), this);
+ 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(),
+ this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
+ resolveSemanticElement(), this);
}
}
}
@@ -690,10 +717,13 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")
+ && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
+ this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -712,12 +742,15 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
@Override
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);
+ 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;
+ } else if ((theRequest instanceof DirectEditRequest)
+ && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -755,24 +788,27 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ 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)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } 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)) {
+ } 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())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -809,7 +845,8 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -819,6 +856,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -826,5 +864,6 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintNameEditPartCN.java
index 50c4f1d12ba..dd1f096cf5a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintNameEditPartCN.java
@@ -61,6 +61,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirect
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
@@ -81,12 +82,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
+public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart
+ implements ITextAwareEditPart, IControlParserForDirectEdit {
/**
* @generated
*/
- public static final String VISUAL_ID = "57";
+ public static final String VISUAL_ID = "Constraint_NameLabel_CN";
/**
* @generated
@@ -144,12 +146,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -157,12 +159,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -170,12 +172,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -183,12 +185,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -247,10 +249,11 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -263,12 +266,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -277,10 +280,11 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
*/
@Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
/**
@@ -299,22 +303,25 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
+ .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(ParserUtil.getParserAdapter(
+ getParserElement(), ConstraintNameEditPartCN.this), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -326,10 +333,10 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
*/
@Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
}
/**
@@ -345,8 +352,8 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
*/
@Override
public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_56, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ConstraintNameEditPartCN.VISUAL_ID));
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.Constraint_Shape_CN, getParserElement(), this, VISUAL_ID);
}
return parser;
}
@@ -355,8 +362,10 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -385,8 +394,8 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -394,8 +403,8 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -406,46 +415,58 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
*/
@Override
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ 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) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else 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(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } 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(),
+ configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ 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());
+ configuration.postEditAction(resolveSemanticElement(),
+ ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -467,12 +488,13 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +525,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +539,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +552,15 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +569,9 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -558,9 +580,10 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
*/
@Override
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));
+ 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);
}
}
@@ -578,11 +601,11 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
*/
@Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ 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$
+ 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();
@@ -594,8 +617,8 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
*/
@Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -608,7 +631,7 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
*/
@Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -634,13 +657,14 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -652,7 +676,7 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
@@ -674,12 +698,15 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @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(), this);
+ 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(),
+ this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
+ resolveSemanticElement(), this);
}
}
}
@@ -690,10 +717,13 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")
+ && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
+ this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -712,12 +742,15 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
@Override
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);
+ 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;
+ } else if ((theRequest instanceof DirectEditRequest)
+ && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -755,24 +788,27 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ 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)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } 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)) {
+ } 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())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -809,7 +845,8 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -819,6 +856,7 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -826,5 +864,6 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPart.java
index 2e059a1d2fd..00bae402acf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPart.java
@@ -61,6 +61,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirect
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
@@ -81,12 +82,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
+public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
+ implements ITextAwareEditPart, IControlParserForDirectEdit {
/**
* @generated
*/
- public static final String VISUAL_ID = "3";
+ public static final String VISUAL_ID = "Constraint_BodyLabel";
/**
* @generated
@@ -144,12 +146,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -157,12 +159,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -170,12 +172,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -183,12 +185,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -247,10 +249,11 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -263,12 +266,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -277,10 +280,11 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
*/
@Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
/**
@@ -299,22 +303,26 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
+ .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(
+ parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(),
+ ConstraintSpecificationEditPart.this), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -326,10 +334,10 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
*/
@Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
}
/**
@@ -345,8 +353,8 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
*/
@Override
public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_2005, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ConstraintSpecificationEditPart.VISUAL_ID));
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.Constraint_Shape, getParserElement(), this, VISUAL_ID);
}
return parser;
}
@@ -355,8 +363,10 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -385,8 +395,8 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -394,8 +404,8 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -406,46 +416,58 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
*/
@Override
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ 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) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else 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(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } 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(),
+ configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ 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());
+ configuration.postEditAction(resolveSemanticElement(),
+ ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -467,12 +489,13 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +526,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +540,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +553,15 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +570,9 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -558,9 +581,10 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
*/
@Override
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));
+ 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);
}
}
@@ -578,11 +602,11 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
*/
@Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ 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$
+ 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();
@@ -594,8 +618,8 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
*/
@Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -608,7 +632,7 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
*/
@Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -634,13 +658,14 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -652,7 +677,7 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
@@ -674,12 +699,15 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @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(), this);
+ 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(),
+ this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
+ resolveSemanticElement(), this);
}
}
}
@@ -690,10 +718,13 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")
+ && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
+ this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -712,12 +743,15 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
@Override
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);
+ 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;
+ } else if ((theRequest instanceof DirectEditRequest)
+ && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -755,24 +789,27 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ 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)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } 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)) {
+ } 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())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -809,7 +846,8 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -819,6 +857,7 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -826,5 +865,6 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPartCN.java
index 3a7004fbd1b..385c5ca592a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPartCN.java
@@ -61,6 +61,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirect
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
@@ -81,12 +82,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
+public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPart
+ implements ITextAwareEditPart, IControlParserForDirectEdit {
/**
* @generated
*/
- public static final String VISUAL_ID = "58";
+ public static final String VISUAL_ID = "Constraint_BodyLabel_CN";
/**
* @generated
@@ -144,12 +146,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -157,12 +159,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -170,12 +172,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -183,12 +185,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -247,10 +249,11 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -263,12 +266,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -277,10 +280,11 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
*/
@Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
/**
@@ -299,22 +303,28 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
+ .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(
+ parser.isValidEditString(
+ ParserUtil.getParserAdapter(getParserElement(),
+ ConstraintSpecificationEditPartCN.this),
+ (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -326,10 +336,10 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
*/
@Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
}
/**
@@ -345,8 +355,8 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
*/
@Override
public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_56, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ConstraintSpecificationEditPartCN.VISUAL_ID));
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.Constraint_Shape_CN, getParserElement(), this, VISUAL_ID);
}
return parser;
}
@@ -355,8 +365,10 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -385,8 +397,8 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -394,8 +406,8 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -406,46 +418,58 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
*/
@Override
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ 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) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else 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(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } 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(),
+ configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ 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());
+ configuration.postEditAction(resolveSemanticElement(),
+ ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -467,12 +491,13 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +528,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +542,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +555,15 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +572,9 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -558,9 +583,10 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
*/
@Override
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));
+ 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);
}
}
@@ -578,11 +604,11 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
*/
@Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ 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$
+ 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();
@@ -594,8 +620,8 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
*/
@Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -608,7 +634,7 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
*/
@Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -634,13 +660,14 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -652,7 +679,7 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
@@ -674,12 +701,15 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @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(), this);
+ 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(),
+ this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
+ resolveSemanticElement(), this);
}
}
}
@@ -690,10 +720,13 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")
+ && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
+ this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -712,12 +745,15 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
@Override
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);
+ 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;
+ } else if ((theRequest instanceof DirectEditRequest)
+ && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -755,24 +791,27 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ 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)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } 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)) {
+ } 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())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -809,7 +848,8 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -819,6 +859,7 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -826,5 +867,6 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DefaultNamedElementEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DefaultNamedElementEditPart.java
index 7e685885c30..a6272d69863 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DefaultNamedElementEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DefaultNamedElementEditPart.java
@@ -50,7 +50,7 @@ public class DefaultNamedElementEditPart extends NamedElementEditPart {
/**
* @generated
*/
- public static final String VISUAL_ID = "2012";
+ public static final String VISUAL_ID = "NamedElement_DefaultShape";
/**
* @generated
@@ -76,12 +76,16 @@ public class DefaultNamedElementEditPart extends NamedElementEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomGraphicalNodeEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY,
+ new AppliedStereotypeNodeLabelDisplayEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new DeploymentDiagramChangeStereotypedShapeEditpolicy());
+ installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY,
+ new DeploymentDiagramChangeStereotypedShapeEditpolicy());
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomDefaultNamedElementItemSemanticEditPolicy());
// 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);
@@ -96,7 +100,7 @@ public class DefaultNamedElementEditPart extends NamedElementEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -123,6 +127,7 @@ public class DefaultNamedElementEditPart extends NamedElementEditPart {
@Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -140,17 +145,18 @@ public class DefaultNamedElementEditPart extends NamedElementEditPart {
*/
@Override
public NodeNamedElementFigure getPrimaryShape() {
- return (NodeNamedElementFigure)primaryShape;
+ return (NodeNamedElementFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DefaultNamedElementNameEditPart) {
- ((DefaultNamedElementNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof DefaultNamedElementNameEditPart) {
+ ((DefaultNamedElementNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
return false;
}
@@ -158,7 +164,7 @@ public class DefaultNamedElementEditPart extends NamedElementEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DefaultNamedElementNameEditPart) {
+ if (childEditPart instanceof DefaultNamedElementNameEditPart) {
return true;
}
return false;
@@ -169,7 +175,7 @@ public class DefaultNamedElementEditPart extends NamedElementEditPart {
*/
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -180,7 +186,7 @@ public class DefaultNamedElementEditPart extends NamedElementEditPart {
*/
@Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -214,6 +220,7 @@ public class DefaultNamedElementEditPart extends NamedElementEditPart {
@Override
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
@@ -226,7 +233,7 @@ public class DefaultNamedElementEditPart extends NamedElementEditPart {
*/
@Override
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -239,7 +246,7 @@ public class DefaultNamedElementEditPart extends NamedElementEditPart {
*/
@Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -250,7 +257,7 @@ public class DefaultNamedElementEditPart extends NamedElementEditPart {
*/
@Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -268,8 +275,8 @@ public class DefaultNamedElementEditPart extends NamedElementEditPart {
*/
@Override
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DefaultNamedElementNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DefaultNamedElementNameEditPart.java
index 839daa28025..ecf378d6d6c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DefaultNamedElementNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DefaultNamedElementNameEditPart.java
@@ -64,6 +64,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirect
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
@@ -85,12 +86,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
+public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
+ implements ITextAwareEditPart, IControlParserForDirectEdit {
/**
* @generated
*/
- public static final String VISUAL_ID = "53";
+ public static final String VISUAL_ID = "NamedElement_NameLabel";
/**
* @generated
@@ -148,12 +150,12 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -161,12 +163,12 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -174,12 +176,12 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -187,12 +189,12 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -243,12 +245,12 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -261,10 +263,11 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -277,12 +280,12 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -291,10 +294,11 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
*/
@Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
}
/**
@@ -313,22 +317,26 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
+ .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(
+ parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(),
+ DefaultNamedElementNameEditPart.this), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -340,10 +348,10 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
*/
@Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
}
/**
@@ -359,8 +367,9 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
*/
@Override
public IParser getParser() {
- if(parser == null) {
- parser = UMLParserProvider.getParser(UMLElementTypes.NamedElement_2012, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.DefaultNamedElementNameEditPart.VISUAL_ID));
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.NamedElement_DefaultShape, getParserElement(), this,
+ VISUAL_ID);
}
return parser;
}
@@ -369,8 +378,10 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -399,8 +410,8 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -408,8 +419,8 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -420,46 +431,58 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
*/
@Override
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ 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) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else 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(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } 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(),
+ configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ 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());
+ configuration.postEditAction(resolveSemanticElement(),
+ ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -481,12 +504,13 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData()
+ .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -517,12 +541,12 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -531,12 +555,12 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -544,15 +568,15 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -561,9 +585,9 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -572,9 +596,10 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
*/
@Override
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));
+ 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);
}
}
@@ -592,11 +617,11 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
*/
@Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ 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$
+ 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();
@@ -608,8 +633,8 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
*/
@Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -622,7 +647,7 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
*/
@Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -648,13 +673,14 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -666,7 +692,7 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
@@ -688,12 +714,15 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
* @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(), this);
+ 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(),
+ this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
+ resolveSemanticElement(), this);
}
}
}
@@ -704,10 +733,13 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")
+ && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
+ this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -726,12 +758,15 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
@Override
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);
+ 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;
+ } else if ((theRequest instanceof DirectEditRequest)
+ && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -769,31 +804,35 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ 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)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } 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)) {
+ } 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())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON
+ .equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -826,7 +865,8 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -836,6 +876,7 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -843,5 +884,6 @@ public class DefaultNamedElementNameEditPart extends PapyrusCompartmentEditPart
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DependencyAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DependencyAppliedStereotypeEditPart.java
index 7bf37fb925e..7ea06d4a961 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DependencyAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DependencyAppliedStereotypeEditPart.java
@@ -62,6 +62,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusLinkLabelDragPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
@@ -83,12 +84,13 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart implements ITextAwareEditPart, IControlParserForDirectEdit, ILabelRoleProvider {
+public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart
+ implements ITextAwareEditPart, IControlParserForDirectEdit, ILabelRoleProvider {
/**
* @generated
*/
- public static final String VISUAL_ID = "15";
+ public static final String VISUAL_ID = "Dependency_StereotypeLabel";
/**
* @generated
@@ -127,7 +129,10 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
* @generated
*/
static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.deployment.edit.parts.DependencyAppliedStereotypeEditPart.VISUAL_ID), new Point(0, 60));
+ registerSnapBackPosition(
+ UMLVisualIDRegistry.getType(
+ org.eclipse.papyrus.uml.diagram.deployment.edit.parts.DependencyAppliedStereotypeEditPart.VISUAL_ID),
+ new Point(0, 60));
}
/**
@@ -160,12 +165,12 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -173,12 +178,12 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -186,12 +191,12 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -199,12 +204,12 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
* @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);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -263,10 +268,11 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
protected String getLabelText() {
String text = null;
EObject parserElement