Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Le Menez2018-01-09 10:09:46 +0000
committerQuentin Le Menez2018-01-09 13:18:15 +0000
commitd98116b5b376f18b6cf626ba4158a35fe9a4a64e (patch)
tree4458c9c5ada0a216b385813a56ea9a9b8c7b6509 /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus
parent453e99bc2dcbd5fabad100f9d0d5f682013c3b19 (diff)
downloadorg.eclipse.papyrus-d98116b5b376f18b6cf626ba4158a35fe9a4a64e.tar.gz
org.eclipse.papyrus-d98116b5b376f18b6cf626ba4158a35fe9a4a64e.tar.xz
org.eclipse.papyrus-d98116b5b376f18b6cf626ba4158a35fe9a4a64e.zip
Bug 515367 - [releng] Uniformization of the end of lines to Unix standard
- Format the EOL of all the files matched by: grep -rIUs . | xargs -Ifile dos2unix -k 'file' Change-Id: I5c41d540a9a67b50de9b912ab35e16cc9a912961 Signed-off-by: Quentin Le Menez <quentin.lemenez@cea.fr>
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/ActivityDiagramCreationCondition.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/ActivityDiagramEditorFactory.java60
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/AbstractContainerNodeDescriptor.java342
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/ContainerNodeDescriptorRegistry.java194
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/GroupEditPolicyProvider.java276
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/GroupRequestAdvisor.java2110
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/IContainerNodeDescriptor.java190
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/IGroupEditPolicies.java72
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/IGroupRequestAdvisor.java122
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/ActivityPartitionActivityPartitionContentCompartmentCreationEditPolicy.java68
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/GroupCreationEditPolicy.java628
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/InterruptibleActivityRegionContentCompartmentCreationEditPolicy.java60
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/ActivityGroupEditPolicy.java168
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/ActivityNodeEditPolicy.java70
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/GroupListenerEditPolicy.java490
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/GroupNotifyingInCreationEditPolicy.java304
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/GroupNotifyingOnMoveEditPolicy.java296
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/IGroupNotifier.java212
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/functions/FromIGroupNotifierToEObject.java120
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ActivityContainment.java216
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ActivityNodeContainment.java230
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ActivityPartitionContainment.java194
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ConditionalNodeContainment.java90
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ExpansionRegionContainment.java90
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/IGroupPriority.java68
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/InterruptibleActivityRegionContainment.java170
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/LoopNodeContainment.java90
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/SequenceNodeContainment.java90
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/StructuredActivityNodeContainment.java208
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/AncestorFilter.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/DescendantsFilter.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/DescendantsFilterIGroupNotifier.java110
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/SameContainerFilter.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/preferences/OpacityFactoryHelper.java164
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/preferences/OpacityGroup.java126
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/AbstractGroupRequest.java282
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/DeferredMoveRequest.java224
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/IGroupRequest.java174
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/RefreshGroupsRequest.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/SetDeferredRequest.java90
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/ui/GroupNotifierLabelProvider.java114
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/ui/IntegrateViewToConfigureComposite.java168
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/utils/DebugUtils.java148
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/utils/Utils.java572
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/ChangeParentCommand.java304
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/CreatePinToParameterLinkEAnnotation.java208
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/DeferredSetValueCommand.java82
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/RunNotificationCommand.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/CenteredColumnConstraint.java74
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/CenteredColumnLayout.java244
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/FlowLayoutAdvanced.java316
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/FlowLayoutAdvancedConstraint.java222
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/GravityConstrainedFlowLayoutConstraint.java78
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/CallBehaviorActionEditHelperAdvice.java200
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/CallOperationActionEditHelperAdvice.java176
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/CreateObjectActionEditHelperAdvice.java172
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/InputPinStartObjectBehaviorActionEditHelperAdvice.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/ReadSelfActionEditHelperAdvice.java114
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/SendSignalActionEditHelperAdvice.java176
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/StartClassifierBehaviorActionEditHelperAdvice.java120
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/StartObjectBehaviorActionEditHelperAdvice.java166
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/TestIdentityActionEditHelperAdvice.java162
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/ValueSpecificationActionEditHelperAdvice.java226
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/ActivityNodeCreateCommand.java116
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/DeferredInterruptibleEdgeCommand.java158
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/util/CreateCommandUtil.java366
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/util/PinUpdateCommand.java184
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/dialogs/ConfirmActivityParameterNodeAndParameterSyncDialog.java212
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/dialogs/ConfirmPinAndParameterSyncDialog.java218
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/dialogs/CreateActivityParameterNodeDialog.java1138
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/dialogs/CreateAttributeDialog.java872
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/dialogs/CreateCallActionDialog.java370
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/dialogs/CreateCallBehaviorActionDialog.java396
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/dialogs/CreateCallOperationActionDialog.java392
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/dialogs/CreateInvocationActionDialog.java1582
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/dialogs/CreateParameterDialog.java822
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/dialogs/CreatePinsForObjectFlowDialog.java714
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/dialogs/CreateSendSignalActionDialog.java356
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/dialogs/WarningAndCreateAttributeDialog.java364
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/dialogs/WarningAndCreateParameterDialog.java378
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/dialogs/WarningAndLinkDialog.java310
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/ActivityGroup/CustomInterruptibleActivityRegionInterruptibleActivityRegionContentCompartmentEditPart.java108
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/ActivityGroup/IGroupCompartmentEditPart.java22
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/BaseActivityContentCompartmentEditPart.java104
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomAcceptTimeEventActionAppliedStereotypeEditPart.java70
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomActivityActivityContentCompartmentEditPart.java102
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomActivityPartitionNameEditPart.java78
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomControlFlowEditPart.java118
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomControlFlowInterruptibleIconEditPart.java160
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomControlFlowNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomExceptionHandlerIconEditPart.java160
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomObjectFlowEditPart.java118
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomObjectFlowInterruptibleIconEditPart.java162
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomObjectFlowNameEditPart.java272
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomObjectFlowSelectionEditPart.java322
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomObjectFlowTransformationEditPart.java310
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/NoBorderListCompartmentEditPart.java62
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/interfaces/InterruptibleEdge.java76
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/AbstractShowHideParameterPropertyEditPolicy.java436
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/AcceptTimeEventActionStereotypeExternalNodeEditPolicy.java200
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/ActivityDiagramChangeStereotypedShapeEditpolicy.java210
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/ActivityGroupCustomDragAndDropEditPolicy.java260
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/ActivityPartitionLabelEditPolicy.java200
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/BehaviorPropertyNodeEditPolicy.java734
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/CompartmentXYLayoutEditPolicy.java200
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/CustomUMLBaseItemSemanticPolicy.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/DeleteActionViewEditPolicy.java210
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/ForkJoinResizeEditPolicy.java108
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/InterruptibleEdgeEditPolicy.java470
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/MaskManagedPinEditPolicy.java126
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/NoDeleteFromDiagramEditPolicy.java96
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/NoDirectEditFromDiagramEditPolicy.java92
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/PapyrusUnmovableShapeEditPolicy.java82
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/PinAndEdgeCreationInCompartmentEditPolicy.java104
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/PinLayoutEditPolicy.java96
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/ResizableSquareEditPolicy.java150
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/ResizeActivityEditPolicy.java102
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/utils/updater/AbstractCallActionPinUpdater.java96
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/utils/updater/AbstractInvocationActionPinUpdater.java350
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/utils/updater/IPinUpdater.java62
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/utils/updater/PinUpdaterFactory.java242
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/utils/updater/intermediateactions/CreateObjectActionPinUpdater.java100
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/utils/updater/intermediateactions/StartClassifierBehaviorActionPinUpdater.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/utils/updater/intermediateactions/ValueSpecificationActionPinUpdater.java180
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/exception/EditPolicyConfigurationException.java88
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/AbstractActionFigure.java350
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityEdgeFigure.java218
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityFigureCN.java54
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ExceptionHandlerFigure.java136
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/InputPinFigure.java44
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/LinkFigure.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/LocalPostconditionConstraintFigure.java54
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/LocalPreconditionConstraintFigure.java54
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/OutputPinFigure.java42
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ParameterExceptionFigure.java116
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/PinFigure.java82
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/SimpleLabel.java106
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/WrappedLabel.java74
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/handlers/AbstractSynchronizePinsAndParameters.java114
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/helper/ActivityFigureDrawer.java582
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/helper/ActivityLinkMappingHelper.java208
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/helper/ActivityParameterAndParameterSynchronizer.java560
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/helper/CustomAcceptEventActionEditHelper.java100
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/helper/CustomObjectFlowEditHelper.java228
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/helper/IPinToParameterLinkCommand.java74
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/helper/PinAndParameterSynchronizeValidator.java54
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/helper/PinAndParameterSynchronizer.java5936
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/helper/SafeDialogOpenerDuringValidation.java154
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/helper/UMLValidationHelper.java2208
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/helper/datastructure/ILinkPinToTarget.java80
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/helper/datastructure/LinkPinToParameter.java170
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/helper/datastructure/LinkPinToProperty.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/listeners/ExceptionHandlerListener.java148
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/listeners/InInterruptibleActivityRegionListener.java314
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/listeners/InterruptibleEdgeListener.java590
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/listeners/ObjectFlowListener.java128
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/listeners/ObjectNodeListener.java112
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/locator/ActivityParameterNodePositionLocator.java490
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/locator/ExpansionNodePositionLocator.java150
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/locator/LinkedBehaviorLocator.java200
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/locator/PinPositionLocator.java928
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/parser/custom/ActivitySingleExecutionParser.java264
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/parser/custom/DecisionInputFlowParser.java284
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/parser/custom/InputDecisionParser.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/parser/custom/JoinSpecParser.java372
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/parser/custom/ObjectFlowSelectionParser.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/parser/custom/ObjectFlowTransformationParser.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/parser/custom/ObjectNodeSelectionParser.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/parser/custom/StreamLabelParser.java130
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/parser/custom/StructuredActivityNodeKeywordParser.java348
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/part/CustomMessages.java408
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/preferences/ActivityEdgeLabelVisibilityGroup.java128
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/preferences/DiagramSpecificPreferenceInitializer.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/preferences/IActivityPreferenceConstants.java268
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/preferences/SpecificKeywordStructuredActivityNodeVisibility.java182
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/providers/ActivityDiagramContributionPolicyClass.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/providers/CustomUMLEditPartProvider.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/request/InterruptibleEdgeRequest.java90
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/tabbedproperties/appearance/SwitchSegmentDirectionSection.java516
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/tabbedproperties/appearance/SwitchSegmentDirectionSectionFilter.java64
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/testers/UMLCallActionTester.java130
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/testers/UMLPackageSelectionTester.java130
182 files changed, 24352 insertions, 24352 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/ActivityDiagramCreationCondition.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/ActivityDiagramCreationCondition.java
index ce932a50b1e..7d2cb70fbc7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/ActivityDiagramCreationCondition.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/ActivityDiagramCreationCondition.java
@@ -1,29 +1,29 @@
-/*****************************************************************************
- * Copyright (c) 2009 Atos Origin.
- *
- *
- * 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
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.ui.extension.commands.PerspectiveContextDependence;
-
-/**
- * ActivityDiagramCreationCondition class allows to check if an Activity diagram can be added to the
- * selected element.
- */
-public class ActivityDiagramCreationCondition extends PerspectiveContextDependence {
-
- /**
- * @return whether the diagram can be created.
- */
- @Override
- public boolean create(EObject selectedElement) {
- return false;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 Atos Origin.
+ *
+ *
+ * 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
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.ui.extension.commands.PerspectiveContextDependence;
+
+/**
+ * ActivityDiagramCreationCondition class allows to check if an Activity diagram can be added to the
+ * selected element.
+ */
+public class ActivityDiagramCreationCondition extends PerspectiveContextDependence {
+
+ /**
+ * @return whether the diagram can be created.
+ */
+ @Override
+ public boolean create(EObject selectedElement) {
+ return false;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/ActivityDiagramEditorFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/ActivityDiagramEditorFactory.java
index 2c394673346..1ae8f097832 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/ActivityDiagramEditorFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/ActivityDiagramEditorFactory.java
@@ -1,30 +1,30 @@
-/*****************************************************************************
- * Copyright (c) 2009 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity;
-
-import org.eclipse.papyrus.infra.gmfdiag.common.GmfEditorFactory;
-import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityDiagramEditPart;
-
-/**
- * The editor factory to launch the activity diagram.
- */
-public class ActivityDiagramEditorFactory extends GmfEditorFactory {
-
- /**
- * Instantiates a new activity diagram editor factory.
- */
- public ActivityDiagramEditorFactory() {
- super(UmlActivityDiagramForMultiEditor.class, ActivityDiagramEditPart.MODEL_ID);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity;
+
+import org.eclipse.papyrus.infra.gmfdiag.common.GmfEditorFactory;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityDiagramEditPart;
+
+/**
+ * The editor factory to launch the activity diagram.
+ */
+public class ActivityDiagramEditorFactory extends GmfEditorFactory {
+
+ /**
+ * Instantiates a new activity diagram editor factory.
+ */
+ public ActivityDiagramEditorFactory() {
+ super(UmlActivityDiagramForMultiEditor.class, ActivityDiagramEditPart.MODEL_ID);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/AbstractContainerNodeDescriptor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/AbstractContainerNodeDescriptor.java
index 88b9f6c941e..38574ab2f27 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/AbstractContainerNodeDescriptor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/AbstractContainerNodeDescriptor.java
@@ -1,171 +1,171 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-
-/**
- * This abstract class describes the required methods to register to the org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension
- * point.
- * These methods allow to recover necessary information on the container node for a given type.
- *
- * @author adaussy
- */
-public abstract class AbstractContainerNodeDescriptor implements IContainerNodeDescriptor {
-
- /**
- * Get the eclass of the model eobject represented by the node
- *
- * @return model object eclass
- */
- @Override
- public abstract EClass getContainerEClass();
-
- @Override
- public List<EClass> getPossibleGraphicalChildren() {
- List<EReference> refs = this.getChildrenReferences();
- List<EClass> result = new ArrayList<EClass>(refs.size());
- for (EReference ref : refs) {
- result.add(ref.getEReferenceType());
- }
- return result;
- }
-
- /**
- * Get the list of references linking the container to children element.
- * Note that these may not be direct containment relations in case the element is only a graphical container.
- *
- * @return the references to contained elements
- */
- @Override
- public abstract List<EReference> getChildrenReferences();
-
- /**
- * Get the list of references linking the child to its parent element.
- * Note that these may not be direct containment relations in case the element is only a graphical container.
- *
- * @return the references to contained elements
- */
- @Override
- public abstract List<EReference> getParentReferences();
-
- /**
- * Get the list of references linking the child to its parent element.
- * Note that these may not be direct containment relations in case the element is only a graphical container.
- *
- * @return the references to contained elements
- */
- @Override
- public abstract Map<EStructuralFeature, EStructuralFeature> getParentEOppositeReferences();
-
- /**
- * Get the edit part which is registered to the group framework (compartment) from a view of the corresponding node.
- *
- * @return the compartment edit part which is registered to the group framework
- */
- @Override
- public abstract IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart);
-
- /**
- * Give you the right be a graphical parent of child.
- *
- * @param childType
- * EClass of the child you want to test
- * @return
- */
- @Override
- public boolean canIBeGraphicalParentOf(EClass childType) {
- for (EReference reference : this.getChildrenReferences()) {
- if (reference.getEReferenceType().isSuperTypeOf(childType)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Give you the right to be a model parent of child
- *
- * @param childType
- * EClass of the child you want to test
- * @return
- */
- @Override
- public boolean canIBeModelParentOf(EClass childType) {
- for (EReference reference : this.getChildrenReferences()) {
- if (reference.getEReferenceType().isSuperTypeOf(childType) && reference.isContainment()) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Give the reference object which can reference the child.
- *
- * @param childType
- * EClass of the child you want to test
- * @return null if no reference is found
- */
- @Override
- public List<EReference> getReferenceFor(EClass childType) {
- List<EReference> result = new ArrayList<EReference>();
- for (EReference reference : this.getChildrenReferences()) {
- if (reference.getEReferenceType().isSuperTypeOf(childType) && !reference.isContainment()) {
- result.add(reference);
- }
- }
- return result;
- }
-
- /**
- * Give the reference object which can contain the child.
- *
- * @param childType
- * EClass of the child you want to test
- * @return null if no reference is found
- */
- @Override
- public EReference getContainmentReferenceFor(EClass childType) {
- EReference usedReference = null;
- List<EReference> result = new ArrayList<EReference>();
- for (EReference reference : this.getChildrenReferences()) {
- if (reference.getEReferenceType().isSuperTypeOf(childType) && reference.isContainment() && !reference.isDerived()) {
- result.add(reference);
- }
- }
- // Select the best containment relation
- for (EReference ref : result) {
- if (usedReference == null || ref.getEReferenceType().getEAllSuperTypes().contains(usedReference.getEReferenceType())) {
- // the ref feature is more precise than the previously selected one. Use it instead.
- usedReference = ref;
- }
- }
- return usedReference;
- }
-
- @Override
- public int compareTo(IContainerNodeDescriptor o) {
- Integer thisInt = new Integer(getGroupPriority());
- Integer otherInt = new Integer(o.getGroupPriority());
- return thisInt.compareTo(otherInt);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+
+/**
+ * This abstract class describes the required methods to register to the org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension
+ * point.
+ * These methods allow to recover necessary information on the container node for a given type.
+ *
+ * @author adaussy
+ */
+public abstract class AbstractContainerNodeDescriptor implements IContainerNodeDescriptor {
+
+ /**
+ * Get the eclass of the model eobject represented by the node
+ *
+ * @return model object eclass
+ */
+ @Override
+ public abstract EClass getContainerEClass();
+
+ @Override
+ public List<EClass> getPossibleGraphicalChildren() {
+ List<EReference> refs = this.getChildrenReferences();
+ List<EClass> result = new ArrayList<EClass>(refs.size());
+ for (EReference ref : refs) {
+ result.add(ref.getEReferenceType());
+ }
+ return result;
+ }
+
+ /**
+ * Get the list of references linking the container to children element.
+ * Note that these may not be direct containment relations in case the element is only a graphical container.
+ *
+ * @return the references to contained elements
+ */
+ @Override
+ public abstract List<EReference> getChildrenReferences();
+
+ /**
+ * Get the list of references linking the child to its parent element.
+ * Note that these may not be direct containment relations in case the element is only a graphical container.
+ *
+ * @return the references to contained elements
+ */
+ @Override
+ public abstract List<EReference> getParentReferences();
+
+ /**
+ * Get the list of references linking the child to its parent element.
+ * Note that these may not be direct containment relations in case the element is only a graphical container.
+ *
+ * @return the references to contained elements
+ */
+ @Override
+ public abstract Map<EStructuralFeature, EStructuralFeature> getParentEOppositeReferences();
+
+ /**
+ * Get the edit part which is registered to the group framework (compartment) from a view of the corresponding node.
+ *
+ * @return the compartment edit part which is registered to the group framework
+ */
+ @Override
+ public abstract IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart);
+
+ /**
+ * Give you the right be a graphical parent of child.
+ *
+ * @param childType
+ * EClass of the child you want to test
+ * @return
+ */
+ @Override
+ public boolean canIBeGraphicalParentOf(EClass childType) {
+ for (EReference reference : this.getChildrenReferences()) {
+ if (reference.getEReferenceType().isSuperTypeOf(childType)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Give you the right to be a model parent of child
+ *
+ * @param childType
+ * EClass of the child you want to test
+ * @return
+ */
+ @Override
+ public boolean canIBeModelParentOf(EClass childType) {
+ for (EReference reference : this.getChildrenReferences()) {
+ if (reference.getEReferenceType().isSuperTypeOf(childType) && reference.isContainment()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Give the reference object which can reference the child.
+ *
+ * @param childType
+ * EClass of the child you want to test
+ * @return null if no reference is found
+ */
+ @Override
+ public List<EReference> getReferenceFor(EClass childType) {
+ List<EReference> result = new ArrayList<EReference>();
+ for (EReference reference : this.getChildrenReferences()) {
+ if (reference.getEReferenceType().isSuperTypeOf(childType) && !reference.isContainment()) {
+ result.add(reference);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Give the reference object which can contain the child.
+ *
+ * @param childType
+ * EClass of the child you want to test
+ * @return null if no reference is found
+ */
+ @Override
+ public EReference getContainmentReferenceFor(EClass childType) {
+ EReference usedReference = null;
+ List<EReference> result = new ArrayList<EReference>();
+ for (EReference reference : this.getChildrenReferences()) {
+ if (reference.getEReferenceType().isSuperTypeOf(childType) && reference.isContainment() && !reference.isDerived()) {
+ result.add(reference);
+ }
+ }
+ // Select the best containment relation
+ for (EReference ref : result) {
+ if (usedReference == null || ref.getEReferenceType().getEAllSuperTypes().contains(usedReference.getEReferenceType())) {
+ // the ref feature is more precise than the previously selected one. Use it instead.
+ usedReference = ref;
+ }
+ }
+ return usedReference;
+ }
+
+ @Override
+ public int compareTo(IContainerNodeDescriptor o) {
+ Integer thisInt = new Integer(getGroupPriority());
+ Integer otherInt = new Integer(o.getGroupPriority());
+ return thisInt.compareTo(otherInt);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/ContainerNodeDescriptorRegistry.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/ContainerNodeDescriptorRegistry.java
index f428924eaba..6981f99b2b0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/ContainerNodeDescriptorRegistry.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/ContainerNodeDescriptorRegistry.java
@@ -1,97 +1,97 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.ActivityContainment;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.ActivityNodeContainment;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.ActivityPartitionContainment;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.ConditionalNodeContainment;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.ExpansionRegionContainment;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.InterruptibleActivityRegionContainment;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.LoopNodeContainment;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.SequenceNodeContainment;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.StructuredActivityNodeContainment;
-import org.eclipse.uml2.uml.UMLPackage;
-
-import com.google.common.collect.Lists;
-
-/**
- * Registry of all node and group descriptor
- */
-public final class ContainerNodeDescriptorRegistry {
-
- /**
- * Constructor
- */
- private ContainerNodeDescriptorRegistry() {
- }
-
- /**
- * Registry of all descriptor
- */
- private static Map<EClass, IContainerNodeDescriptor> registry;
- /**
- * Initialize
- * (May be in the future using extension point
- */
- static {
- registry = new HashMap<EClass, IContainerNodeDescriptor>();
- registry.put(UMLPackage.Literals.ACTIVITY_PARTITION, new ActivityPartitionContainment());
- registry.put(UMLPackage.Literals.STRUCTURED_ACTIVITY_NODE, new StructuredActivityNodeContainment());
- registry.put(UMLPackage.Literals.CONDITIONAL_NODE, new ConditionalNodeContainment());
- registry.put(UMLPackage.Literals.EXPANSION_REGION, new ExpansionRegionContainment());
- registry.put(UMLPackage.Literals.INTERRUPTIBLE_ACTIVITY_REGION, new InterruptibleActivityRegionContainment());
- registry.put(UMLPackage.Literals.LOOP_NODE, new LoopNodeContainment());
- registry.put(UMLPackage.Literals.SEQUENCE_NODE, new SequenceNodeContainment());
- registry.put(UMLPackage.Literals.ACTIVITY_NODE, new ActivityNodeContainment());
- registry.put(UMLPackage.Literals.ACTIVITY, new ActivityContainment());
- }
-
- /**
- * SingletonHolder is loaded on the first execution of Singleton.getInstance()
- * or the first access to SingletonHolder.INSTANCE, not before.
- */
- private static class SingletonHolder {
-
- public static final ContainerNodeDescriptorRegistry instance = new ContainerNodeDescriptorRegistry();
- }
-
- public IContainerNodeDescriptor getContainerNodeDescriptor(EClass eclass) {
- try {
- IContainerNodeDescriptor result = registry.get(eclass);
- if (result == null) {
- ArrayList<EClass> superTypes = Lists.newArrayList(eclass.getEAllSuperTypes());
- for (EClass aux : Lists.reverse(superTypes)) {
- result = registry.get(aux);
- if (result != null) {
- return result;
- }
- }
- }
- return result;
- } catch (Exception e) {
- throw new RuntimeException("wrong use of the ContainerNodeDescriptorRegistry");
- }
- }
-
- public static ContainerNodeDescriptorRegistry getInstance() {
- return SingletonHolder.instance;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.ActivityContainment;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.ActivityNodeContainment;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.ActivityPartitionContainment;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.ConditionalNodeContainment;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.ExpansionRegionContainment;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.InterruptibleActivityRegionContainment;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.LoopNodeContainment;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.SequenceNodeContainment;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment.StructuredActivityNodeContainment;
+import org.eclipse.uml2.uml.UMLPackage;
+
+import com.google.common.collect.Lists;
+
+/**
+ * Registry of all node and group descriptor
+ */
+public final class ContainerNodeDescriptorRegistry {
+
+ /**
+ * Constructor
+ */
+ private ContainerNodeDescriptorRegistry() {
+ }
+
+ /**
+ * Registry of all descriptor
+ */
+ private static Map<EClass, IContainerNodeDescriptor> registry;
+ /**
+ * Initialize
+ * (May be in the future using extension point
+ */
+ static {
+ registry = new HashMap<EClass, IContainerNodeDescriptor>();
+ registry.put(UMLPackage.Literals.ACTIVITY_PARTITION, new ActivityPartitionContainment());
+ registry.put(UMLPackage.Literals.STRUCTURED_ACTIVITY_NODE, new StructuredActivityNodeContainment());
+ registry.put(UMLPackage.Literals.CONDITIONAL_NODE, new ConditionalNodeContainment());
+ registry.put(UMLPackage.Literals.EXPANSION_REGION, new ExpansionRegionContainment());
+ registry.put(UMLPackage.Literals.INTERRUPTIBLE_ACTIVITY_REGION, new InterruptibleActivityRegionContainment());
+ registry.put(UMLPackage.Literals.LOOP_NODE, new LoopNodeContainment());
+ registry.put(UMLPackage.Literals.SEQUENCE_NODE, new SequenceNodeContainment());
+ registry.put(UMLPackage.Literals.ACTIVITY_NODE, new ActivityNodeContainment());
+ registry.put(UMLPackage.Literals.ACTIVITY, new ActivityContainment());
+ }
+
+ /**
+ * SingletonHolder is loaded on the first execution of Singleton.getInstance()
+ * or the first access to SingletonHolder.INSTANCE, not before.
+ */
+ private static class SingletonHolder {
+
+ public static final ContainerNodeDescriptorRegistry instance = new ContainerNodeDescriptorRegistry();
+ }
+
+ public IContainerNodeDescriptor getContainerNodeDescriptor(EClass eclass) {
+ try {
+ IContainerNodeDescriptor result = registry.get(eclass);
+ if (result == null) {
+ ArrayList<EClass> superTypes = Lists.newArrayList(eclass.getEAllSuperTypes());
+ for (EClass aux : Lists.reverse(superTypes)) {
+ result = registry.get(aux);
+ if (result != null) {
+ return result;
+ }
+ }
+ }
+ return result;
+ } catch (Exception e) {
+ throw new RuntimeException("wrong use of the ContainerNodeDescriptorRegistry");
+ }
+ }
+
+ public static ContainerNodeDescriptorRegistry getInstance() {
+ return SingletonHolder.instance;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/GroupEditPolicyProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/GroupEditPolicyProvider.java
index 685db64bb36..75d673fb555 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/GroupEditPolicyProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/GroupEditPolicyProvider.java
@@ -1,138 +1,138 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.ActivityContentCompartmentCreationEditPolicy;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.ActivityPartitionActivityPartitionContentCompartmentCreationEditPolicy;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.InterruptibleActivityRegionContentCompartmentCreationEditPolicy;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.ActivityGroupEditPolicy;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.ActivityNodeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.GroupNotifyingInCreationEditPolicy;
-import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityActivityContentCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityDiagramEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityPartitionActivityPartitionContentCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.edit.parts.InterruptibleActivityRegionInterruptibleActivityRegionContentCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.ActivityGroup;
-import org.eclipse.uml2.uml.ActivityNode;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Provider for all edit policies related to the group framework
- */
-public class GroupEditPolicyProvider implements IEditPolicyProvider {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.gmf.runtime.common.core.service.IProvider#addProviderChangeListener(org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener
- * )
- */
- @Override
- public void addProviderChangeListener(IProviderChangeListener listener) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gmf.runtime.common.core.service.IProvider#removeProviderChangeListener(org.eclipse.gmf.runtime.common.core.service.
- * IProviderChangeListener)
- */
- @Override
- public void removeProviderChangeListener(IProviderChangeListener listener) {
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- public void createEditPolicies(EditPart editPart) {
- /*
- * Installation of notiying edit polocy
- */
- if (editPart instanceof ActivityEditPart) {
- editPart.installEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY, new ActivityGroupEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(UMLPackage.Literals.ACTIVITY)));
- }
- if (editPart instanceof IGraphicalEditPart && editPart.getParent() instanceof IGraphicalEditPart) {
- IGraphicalEditPart graphEditpart = (IGraphicalEditPart) editPart;
- // is top edit part of the element
- IGraphicalEditPart parentEditPart = (IGraphicalEditPart) editPart.getParent();
- EObject resolveSemanticElement = graphEditpart.resolveSemanticElement();
- if (resolveSemanticElement != null && !resolveSemanticElement.equals(parentEditPart.resolveSemanticElement())) {
- if (resolveSemanticElement instanceof ActivityNode) {
- graphEditpart.installEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY, new ActivityNodeEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(UMLPackage.Literals.ACTIVITY_NODE)));
- }
- if (resolveSemanticElement instanceof ActivityGroup) {
- graphEditpart.installEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY, new ActivityGroupEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(resolveSemanticElement.eClass())));
- }
- /*
- * Installation of policy to handle graphicac
- */
- switch (UMLVisualIDRegistry.getVisualID(graphEditpart.getNotationView())) {
- case ActivityPartitionActivityPartitionContentCompartmentEditPart.VISUAL_ID:
- graphEditpart.installEditPolicy(EditPolicyRoles.CREATION_ROLE,
- new ActivityPartitionActivityPartitionContentCompartmentCreationEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(UMLPackage.Literals.ACTIVITY_PARTITION)));
- graphEditpart.installEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_CREATION_EDIT_POLICY,
- new GroupNotifyingInCreationEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(resolveSemanticElement.eClass())));
- break;
- case InterruptibleActivityRegionInterruptibleActivityRegionContentCompartmentEditPart.VISUAL_ID:
- graphEditpart.installEditPolicy(EditPolicyRoles.CREATION_ROLE,
- new InterruptibleActivityRegionContentCompartmentCreationEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(UMLPackage.Literals.INTERRUPTIBLE_ACTIVITY_REGION)));
- graphEditpart.installEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_CREATION_EDIT_POLICY,
- new GroupNotifyingInCreationEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(resolveSemanticElement.eClass())));
- break;
- case ActivityActivityContentCompartmentEditPart.VISUAL_ID:
- graphEditpart.installEditPolicy(EditPolicyRoles.CREATION_ROLE, new ActivityContentCompartmentCreationEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(UMLPackage.Literals.ACTIVITY)));
- graphEditpart.installEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_CREATION_EDIT_POLICY,
- new GroupNotifyingInCreationEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(resolveSemanticElement.eClass())));
- break;
- default:
- break;
- }
- }
-
- }
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- public boolean provides(IOperation operation) {
- CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation) operation;
- if (!(epOperation.getEditPart() instanceof GraphicalEditPart)) {
- return false;
- }
- GraphicalEditPart gep = (GraphicalEditPart) epOperation.getEditPart();
- String diagramType = gep.getNotationView().getDiagram().getType();
- if (ActivityDiagramEditPart.MODEL_ID.equals(diagramType)) {
- return true;
- }
- return false;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.ActivityContentCompartmentCreationEditPolicy;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.ActivityPartitionActivityPartitionContentCompartmentCreationEditPolicy;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.InterruptibleActivityRegionContentCompartmentCreationEditPolicy;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.ActivityGroupEditPolicy;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.ActivityNodeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.GroupNotifyingInCreationEditPolicy;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityActivityContentCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityDiagramEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityPartitionActivityPartitionContentCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.InterruptibleActivityRegionInterruptibleActivityRegionContentCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.uml2.uml.ActivityGroup;
+import org.eclipse.uml2.uml.ActivityNode;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Provider for all edit policies related to the group framework
+ */
+public class GroupEditPolicyProvider implements IEditPolicyProvider {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.common.core.service.IProvider#addProviderChangeListener(org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener
+ * )
+ */
+ @Override
+ public void addProviderChangeListener(IProviderChangeListener listener) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gmf.runtime.common.core.service.IProvider#removeProviderChangeListener(org.eclipse.gmf.runtime.common.core.service.
+ * IProviderChangeListener)
+ */
+ @Override
+ public void removeProviderChangeListener(IProviderChangeListener listener) {
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ public void createEditPolicies(EditPart editPart) {
+ /*
+ * Installation of notiying edit polocy
+ */
+ if (editPart instanceof ActivityEditPart) {
+ editPart.installEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY, new ActivityGroupEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(UMLPackage.Literals.ACTIVITY)));
+ }
+ if (editPart instanceof IGraphicalEditPart && editPart.getParent() instanceof IGraphicalEditPart) {
+ IGraphicalEditPart graphEditpart = (IGraphicalEditPart) editPart;
+ // is top edit part of the element
+ IGraphicalEditPart parentEditPart = (IGraphicalEditPart) editPart.getParent();
+ EObject resolveSemanticElement = graphEditpart.resolveSemanticElement();
+ if (resolveSemanticElement != null && !resolveSemanticElement.equals(parentEditPart.resolveSemanticElement())) {
+ if (resolveSemanticElement instanceof ActivityNode) {
+ graphEditpart.installEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY, new ActivityNodeEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(UMLPackage.Literals.ACTIVITY_NODE)));
+ }
+ if (resolveSemanticElement instanceof ActivityGroup) {
+ graphEditpart.installEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY, new ActivityGroupEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(resolveSemanticElement.eClass())));
+ }
+ /*
+ * Installation of policy to handle graphicac
+ */
+ switch (UMLVisualIDRegistry.getVisualID(graphEditpart.getNotationView())) {
+ case ActivityPartitionActivityPartitionContentCompartmentEditPart.VISUAL_ID:
+ graphEditpart.installEditPolicy(EditPolicyRoles.CREATION_ROLE,
+ new ActivityPartitionActivityPartitionContentCompartmentCreationEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(UMLPackage.Literals.ACTIVITY_PARTITION)));
+ graphEditpart.installEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_CREATION_EDIT_POLICY,
+ new GroupNotifyingInCreationEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(resolveSemanticElement.eClass())));
+ break;
+ case InterruptibleActivityRegionInterruptibleActivityRegionContentCompartmentEditPart.VISUAL_ID:
+ graphEditpart.installEditPolicy(EditPolicyRoles.CREATION_ROLE,
+ new InterruptibleActivityRegionContentCompartmentCreationEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(UMLPackage.Literals.INTERRUPTIBLE_ACTIVITY_REGION)));
+ graphEditpart.installEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_CREATION_EDIT_POLICY,
+ new GroupNotifyingInCreationEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(resolveSemanticElement.eClass())));
+ break;
+ case ActivityActivityContentCompartmentEditPart.VISUAL_ID:
+ graphEditpart.installEditPolicy(EditPolicyRoles.CREATION_ROLE, new ActivityContentCompartmentCreationEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(UMLPackage.Literals.ACTIVITY)));
+ graphEditpart.installEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_CREATION_EDIT_POLICY,
+ new GroupNotifyingInCreationEditPolicy(ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(resolveSemanticElement.eClass())));
+ break;
+ default:
+ break;
+ }
+ }
+
+ }
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean provides(IOperation operation) {
+ CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation) operation;
+ if (!(epOperation.getEditPart() instanceof GraphicalEditPart)) {
+ return false;
+ }
+ GraphicalEditPart gep = (GraphicalEditPart) epOperation.getEditPart();
+ String diagramType = gep.getNotationView().getDiagram().getType();
+ if (ActivityDiagramEditPart.MODEL_ID.equals(diagramType)) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/GroupRequestAdvisor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/GroupRequestAdvisor.java
index 91bbd30b6a9..9c4825926a5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/GroupRequestAdvisor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/GroupRequestAdvisor.java
@@ -1,1055 +1,1055 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import javax.naming.InitialContext;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.type.core.commands.MoveElementsCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.ICompositeCreator;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.INotification;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.NotificationRunnable;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.Type;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.IContext;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.NotificationBuilder;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.GroupNotifyingOnMoveEditPolicy;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.IGroupNotifier;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates.AncestorFilter;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates.DescendantsFilter;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates.DescendantsFilterIGroupNotifier;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates.SameContainerFilter;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.IGroupRequest;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.SetDeferredRequest;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.ui.IntegrateViewToConfigureComposite;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.DebugUtils;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.Utils;
-import org.eclipse.papyrus.uml.diagram.activity.commands.DeferredSetValueCommand;
-import org.eclipse.papyrus.uml.diagram.activity.commands.RunNotificationCommand;
-import org.eclipse.papyrus.uml.diagram.activity.edit.part.ActivityGroup.IGroupCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.diagram.common.commands.RemoveValueCommand;
-import org.eclipse.papyrus.uml.diagram.common.commands.RemoveValueRequest;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.uml2.uml.ActivityGroup;
-import org.eclipse.uml2.uml.Element;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Multimap;
-import com.google.common.collect.Sets;
-
-public class GroupRequestAdvisor implements IGroupRequestAdvisor {
-
- /**
- * Exception message
- */
- private static final String UNABLE_TO_GET_THE_INTIAL_TARGET_REQUEST_BOUNDS = "Unable to get the intial target request bounds";////$NON-NLS-1$
-
- /**
- * Debug message
- */
- private static final String CHILDREN_REFERENCES_ARE = " ---- Children references are : ---- ";
-
- /**
- * Debug message
- */
- private static final String ALL_PARENT_REFERENCES_ARE = " ---- All parent references are : ---- ";
-
- /**
- * Runnable to run command to change parent of selected element
- *
- * @author arthur daussy
- *
- */
- private final class ChangeGraphicalParentRunnable implements NotificationRunnable {
-
- /**
- * New graphical host
- */
- private final IGraphicalEditPart host;
-
- /**
- * Initial request
- */
- private final IGroupRequest request;
-
- /**
- * List of all modified view
- * Used to compute list of modfied files
- */
- private List<View> viewTomodify;
-
- /**
- * Constructor
- *
- * @param host
- * New graphical host
- * @param request
- * Initial request
- */
- private ChangeGraphicalParentRunnable(IGraphicalEditPart host, IGroupRequest request) {
- this.host = host;
- this.request = request;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.ui.toolbox.notification.NotificationRunnable#run(org.eclipse.papyrus.ui.toolbox.notification.builders.IContext)
- */
- @Override
- public void run(IContext context) {
- IntegrateViewToConfigureComposite composite = (IntegrateViewToConfigureComposite) context.get(IContext.COMPOSITE_CREATED);
- final INotification notif = (INotification) context.get(IContext.NOTIFICATION_OBJECT);
- CompositeTransactionalCommand ccMovingElement = new CompositeTransactionalCommand(request.getHostRequest().getEditingDomain(), "Move graphical elements into a new host");////$NON-NLS-1$
- /*
- * Use to calculate impacted file
- */
- viewTomodify = Lists.newArrayList();
- IGraphicalEditPart hostEditPart = request.getHostRequest();
- viewTomodify.add(host.getNotationView());
- for (IGroupNotifier notifier : composite.getSelectedNotifier()) {
- IGraphicalEditPart notifierEditPart = notifier.getHostEditPart();
- IGraphicalEditPart hostCompartmentEditPart = request.getNodeDescpitor().getCompartmentPartFromView(hostEditPart);
- /*
- * debugging label
- */
- if (DebugUtils.isDebugging()) {
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append("Move ");
- stringBuilder.append(Utils.getCorrectLabel(notifierEditPart));
- stringBuilder.append(" to ");
- stringBuilder.append(Utils.getCorrectLabel(hostEditPart));
- DebugUtils.getLog().info(stringBuilder.toString());
- }
- if (notifierEditPart != null) {
- EObject semanticElementToDrop = notifierEditPart.resolveSemanticElement();
- if (semanticElementToDrop != null && hostCompartmentEditPart != null) {
- /*
- * Request to change graphical parent
- */
- ChangeBoundsRequest chdBoundsRequest = new ChangeBoundsRequest(RequestConstants.REQ_ADD);
- chdBoundsRequest.setEditParts(notifierEditPart);
- viewTomodify.add(notifierEditPart.getNotationView());
- Command dropcommand = hostCompartmentEditPart.getCommand(chdBoundsRequest);
- if (dropcommand != null) {
- ccMovingElement.compose(new CommandProxy(dropcommand));
- }
- } else {
- // log error
- }
- } else {
- // log error
- }
- }
- /*
- * Execute resulting command
- */
- if (ccMovingElement != null && !ccMovingElement.isEmpty()) {
- host.getEditingDomain().getCommandStack().execute(new GMFtoEMFCommandWrapper(ccMovingElement));
- }
- notif.delete();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.ui.toolbox.notification.NotificationRunnable#getLabel()
- */
- @Override
- public String getLabel() {
- return "OK";
- }
-
- /**
- * @return the list of all EObject modifed
- */
- public List getModifiedObject() {
- return viewTomodify == null ? Collections.emptyList() : viewTomodify;
- }
- }
-
- /**
- * SingletonHolder is loaded on the first execution of Singleton.getInstance()
- * or the first access to SingletonHolder.INSTANCE, not before.
- */
- private static class SingletonHolder {
-
- public static final GroupRequestAdvisor instance = new GroupRequestAdvisor();
- }
-
- /**
- * Get the instance of {@link GroupRequestAdvisor}
- *
- * @return
- */
- public static GroupRequestAdvisor getInstance() {
- return SingletonHolder.instance;
- }
-
- /**
- * Store all the listener
- */
- private Multimap<EObject, IGroupNotifier> listenners;
-
- /**
- * Logger
- */
- private static LogHelper log = new LogHelper(UMLDiagramEditorPlugin.getInstance());
-
- /***
- * Private constructor
- */
- private GroupRequestAdvisor() {
- listenners = ArrayListMultimap.create();
- }
-
- /**
- * Add a {@link IGroupNotifier}
- *
- * @param editpolicy
- */
- @Override
- public void addListenner(EObject eObject, IGroupNotifier editpolicy) {
- getListenerRegistry().put(eObject, editpolicy);
- }
-
- /**
- * Remove a {@link IGroupNotifier}
- *
- * @param editpolicy
- */
- @Override
- public void removeListenner(IGroupNotifier editpolicy) {
- if (editpolicy == null) {
- return;
- }
- Iterator<Entry<EObject, IGroupNotifier>> iterator = getListenerRegistry().entries().iterator();
- while (iterator.hasNext()) {
- Entry<EObject, IGroupNotifier> entry = iterator.next();
- if (editpolicy.equals(entry.getValue())) {
- iterator.remove();
- }
- }
- }
-
- @Override
- public ICommand notifyGroupFramework(IGroupRequest request) {
- if (DebugUtils.isDebugging()) {
- log.debug("***********************BEGIN : Group Request Advisor***********************************");
- }
- /******************
- * Handling parent
- ******************/
- CompositeCommand cc = new CompositeCommand("Global command from GroupRequestAdvisor");
- Request initialRequest = request.getInitialRequest();
- if (initialRequest instanceof ChangeBoundsRequest) {
- handleMove(request, cc);
- } else if (initialRequest instanceof GroupRequest && RequestConstants.REQ_DELETE.equals(initialRequest.getType())) {
- handleDelete(request, cc);
- }
- if (cc != null && !cc.isEmpty()) {
- return cc;
- }
- return null;
- }
-
- protected void handleDelete(IGroupRequest request, CompositeCommand cc) {
- // request.getNodeDescpitor().getChildrenReferences()
- }
-
- /**
- * Handle move
- *
- * @param request
- * @param cc
- */
- protected void handleMove(IGroupRequest request, CompositeCommand cc) {
- /*
- * All parent
- */
- fillRequestWithAllPossibleParent(request);
- fillRequestWithAllPossibleChildren(request);
- Object elementAdapter = request.getTargetElement().getAdapter(EObject.class);
- if (elementAdapter instanceof EObject) {
- /*
- * Handle children
- */
- handleSemanticChildren(request, cc, (EObject) elementAdapter);
- /*
- * Semantic of all the parent
- */
- handleSemanticParents(request, cc, elementAdapter);
- }
- if (DebugUtils.isDebugging()) {
- log.debug("***********************END : Group Request Advisor***********************************");
- }
- // /*
- // * For all new child send request
- // * For all GrChild create new request from old one and use dispatcher
- // */
- // if(cc != null && !cc.isEmpty()) {
- // return cc;
- // }
- // return null;
- }
-
- /**
- * Handle all the children of the group (graphical and non graphical children)
- *
- * @param request
- * @param cc
- * @param targetElement
- */
- protected void handleSemanticChildren(final IGroupRequest request, CompositeCommand cc, EObject targetElement) {
- List<EObject> graphicalChildren = Lists.newArrayList();
- /*
- * There is graphical childrne only when the node is moving
- */
- if (request.getInitialRequest() instanceof ChangeBoundsRequest) {
- graphicalChildren = handleGraphicalChildren(request, cc);
- }
- /*
- * Unset
- */
- for (Entry<EReference, EObject> oldChildrenEntry : Utils.getOldChildren(request).entries()) {
- Multimap<EReference, EObject> allActualChildren = request.getChildrenEReferenceMap();
- EReference ref = oldChildrenEntry.getKey();
- if (ref != null) {
- if (!allActualChildren.containsEntry(oldChildrenEntry.getValue(), ref)) {
- EReference eOpposite = ref.getEOpposite();
- if (!graphicalChildren.contains(oldChildrenEntry.getValue())) {
- if (eOpposite != null && !eOpposite.isContainment() && !ref.isContainment()) {
- RemoveValueRequest rmVa = new RemoveValueRequest(targetElement, ref, Collections.singletonList(oldChildrenEntry.getValue()));
- RemoveValueCommand rmCmd = new RemoveValueCommand(rmVa);
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append("From handling parent : Remove ");////$NON-NLS-1$
- stringBuilder.append(Utils.getCorrectLabel(ref));
- stringBuilder.append(" from ");////$NON-NLS-1$
- stringBuilder.append(Utils.getCorrectLabel(targetElement));
- stringBuilder.append(" value ");////$NON-NLS-1$
- stringBuilder.append(Utils.getCorrectLabel(oldChildrenEntry.getValue()));//
- rmCmd.setLabel(stringBuilder.toString());
- if (rmCmd != null) {
- cc.compose(rmCmd);
- }
- }
- }
- }
- }
- }
- /*
- * Set semantic
- */
- Set<EObject> newChildren = Sets.newHashSet();
- for (Entry<EReference, EObject> entry : request.getChildrenEReferenceMap().entries()) {
- EReference ref = entry.getKey();
- if (ref != null) {
- EReference eOpposite = ref.getEOpposite();
- if (!graphicalChildren.contains(entry.getValue())) {
- newChildren.add(entry.getValue());
- if (eOpposite != null && !eOpposite.isContainment()) {
- SetDeferredRequest setRq = new SetDeferredRequest(request.getHostRequest().getEditingDomain(), request.getTargetElement(), ref, entry.getValue());
- DeferredSetValueCommand setCmd = new DeferredSetValueCommand(setRq);
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append("From handling parent : Set deferred");////$NON-NLS-1$
- stringBuilder.append(Utils.getCorrectLabel(entry.getValue()));
- stringBuilder.append(" from ");////$NON-NLS-1$
- stringBuilder.append(Utils.getCorrectLabel(ref));
- stringBuilder.append(" value ");////$NON-NLS-1$
- stringBuilder.append(Utils.getCorrectLabel(entry.getValue()));//
- setCmd.setLabel(stringBuilder.toString());
- if (setCmd != null) {
- cc.compose(setCmd);
- }
- }
- }
- }
- if (!newChildren.isEmpty()) {
- handleChangeParentNotificationCommand(request, cc, newChildren);
- }
- }
- }
-
- /**
- * Create a notification to user to ask him is he want to add its new children as graphical child of its parent group
- *
- * @param request
- * {@link InitialContext} {@link IGroupRequest}
- * @param cc
- * {@link CompositeCommand} to compose new commands
- * @param newChildren
- * List of all new children
- */
- protected void handleChangeParentNotificationCommand(final IGroupRequest request, CompositeCommand cc, Set<EObject> newChildren) {
- /*
- * Create dialog to suggest user to move views
- */
- final IGraphicalEditPart host = request.getHostRequest();
- /*
- * Get editpart of all children
- */
- Iterable<IGroupNotifier> listOfChidren = Iterables.transform(newChildren, new Function<EObject, IGroupNotifier>() {
-
- @Override
- public IGroupNotifier apply(EObject arg0) {
- Collection<IGroupNotifier> notifiers = getListenerRegistry().get(arg0);
- for (IGroupNotifier notifier : notifiers) {
- IGraphicalEditPart notifierEditPart = notifier.getHostEditPart();
- if (notifierEditPart != null) {
- if (EcoreUtil.isAncestor(host.getNotationView().getDiagram(), notifierEditPart.getNotationView())) {
- return notifier;
- }
- }
- }
- return null;
- }
- });
- final Iterable<IGroupNotifier> listOfFilteredChidren = Iterables.filter(listOfChidren, Predicates.notNull());
- List<IGroupNotifier> automaticChildren = Lists.newArrayList();
- List<IGroupNotifier> nonAutomaticChildren = Lists.newArrayList();
- /*
- * Dispatch children
- */
- dispatchChildren(request, host, listOfFilteredChidren, automaticChildren, nonAutomaticChildren);
- IGraphicalEditPart hostEditPart = request.getHostRequest();
- /*
- * Command to change graphical parent for element when we can guess graphical parent
- */
- for (IGroupNotifier notifier : automaticChildren) {
- IGraphicalEditPart notifierEditPart = notifier.getHostEditPart();
- IGraphicalEditPart hostCompartmentEditPart = request.getNodeDescpitor().getCompartmentPartFromView(hostEditPart);
- Request initialRequest = request.getInitialRequest();
- Rectangle hostBounds = null;
- if (initialRequest instanceof ChangeBoundsRequest) {
- hostBounds = Utils.getAbslotueRequestBounds((ChangeBoundsRequest) initialRequest, hostCompartmentEditPart);
- } else {
- hostBounds = Utils.getAbsoluteBounds(hostCompartmentEditPart);
- }
- Rectangle childBounds = Utils.getAbsoluteBounds(notifierEditPart);
- MoveElementsCommand mvCmd = new MoveElementsCommand(new MoveRequest(hostCompartmentEditPart.getNotationView(), notifierEditPart.getNotationView()));
- /*
- * Integrate view into new compartment
- */
- if (mvCmd != null && mvCmd.canExecute()) {
- cc.compose(mvCmd);
- }
- /*
- * Set view to the new location
- */
- SetBoundsCommand setBoundCommand = new SetBoundsCommand(WorkspaceEditingDomainFactory.INSTANCE.getEditingDomain(host.getNotationView().eResource().getResourceSet()), "test", new EObjectAdapter(notifierEditPart.getNotationView()),
- childBounds.translate(hostBounds.getLocation().negate()));
- if (setBoundCommand != null && setBoundCommand.canExecute()) {
- cc.compose(setBoundCommand);
- }
- }
- /*
- * Create notification for element where we can NOT guess the graphical parent
- */
- if (!nonAutomaticChildren.isEmpty()) {
- /*
- * create runnable to run the command
- */
- ChangeGraphicalParentRunnable changeGraphicalParentRunnable = new ChangeGraphicalParentRunnable(host, request);
- final NotificationBuilder notification = createChangeGraphicalParentNotification(nonAutomaticChildren, changeGraphicalParentRunnable, hostEditPart);
- RunNotificationCommand runNotifCmd = new RunNotificationCommand(request.getHostRequest().getEditingDomain(), "Notification command", getWorkspaceFiles(changeGraphicalParentRunnable.getModifiedObject()), notification);////$NON-NLS-1$
- cc.compose(runNotifCmd);
- }
- }
-
- /**
- * Dispatch all children in two category.
- * listOfFilteredChidren will contained all element to automatically add as graphical children
- * nonAutomaticChildren will contained all element to ask the user what to do with
- *
- * @param request
- * @param host
- * @param listOfFilteredChidren
- * @param automaticChildren
- * @param nonAutomaticChildren
- */
- private void dispatchChildren(final IGroupRequest request, final IGraphicalEditPart host, final Iterable<IGroupNotifier> listOfFilteredChidren, List<IGroupNotifier> automaticChildren, List<IGroupNotifier> nonAutomaticChildren) {
- for (IGroupNotifier notifier : listOfFilteredChidren) {
- IGraphicalEditPart parentEditPart = getGraphicalParent(notifier.getHostEditPart());
- if (parentEditPart != null) {
- EObject eObject = parentEditPart.resolveSemanticElement();
- if (eObject instanceof ActivityGroup) {
- ActivityGroup group = (ActivityGroup) eObject;
- Collection<IGroupNotifier> groupNotifiers = listenners.get(group);
- if (!groupNotifiers.isEmpty()) {
- IGroupNotifier myGroupNotifier = groupNotifiers.iterator().next();
- /*
- * Is the old container (an activity group) continaing the current moving element
- */
- boolean isNewContainerVisuallyIncludeInOldContainer = myGroupNotifier.includes(Utils.getAbslotueRequestBounds((ChangeBoundsRequest) request.getInitialRequest(), host));
- /*
- * Can the old container (an activity group) be a model a the current moving element
- */
- boolean canTheOldContainerBeAModelParentOfTheNewContainer = myGroupNotifier.getHostGroupDescriptor().canIBeModelParentOf(host.resolveSemanticElement().eClass());
- /*
- *
- */
- boolean canTheNewContainerBeModelParentOfTheOldContianer = request.getNodeDescpitor().canIBeModelParentOf(host.resolveSemanticElement().eClass());
- /*
- * Is the current moving element containing the old container
- */
- IGroupNotifier currentElementNotifier = getIGroupNotifier(host);
- boolean isOldContainerVisuallyIncludeInNewContainer = currentElementNotifier.includes(Utils.getAbsoluteBounds(myGroupNotifier.getHostEditPart()));
- if (canTheOldContainerBeAModelParentOfTheNewContainer && isNewContainerVisuallyIncludeInOldContainer) {
- /*
- * Is going to be a new child of the old container
- */
- automaticChildren.add(notifier);
- } else if (canTheNewContainerBeModelParentOfTheOldContianer && isOldContainerVisuallyIncludeInNewContainer) {
- /*
- * Is going to be a new container for the old container
- */
- } else {
- /*
- * There is no containing relation between the groups
- */
- if (currentElementNotifier.getHostGroupDescriptor().getContainmentReferenceFor(notifier.getHostEditPart().resolveSemanticElement().eClass()) == null) {
- nonAutomaticChildren.add(notifier);
- } else {
- // If containment link automatically add it to new group
- automaticChildren.add(notifier);
- }
- }
- } else {
- /*
- * No notifier where found
- */
- nonAutomaticChildren.add(notifier);
- }
- } else {
- /*
- * If there is no container (which is group)
- */
- if (!parentEditPart.equals(host)) {
- automaticChildren.add(notifier);
- }
- }
- } else {
- DebugUtils.getLog().error("Unable to retreive graphical parent of " + Utils.getCorrectLabel(notifier), null);
- }
- }
- }
-
- /**
- * Get the IGroupNotifier of the {@link IGraphicalEditPart} passed in argument
- *
- * @param host
- * @return
- */
- private IGroupNotifier getIGroupNotifier(final IGraphicalEditPart host) {
- EditPolicy editPolicy = host.getEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY);
- if (editPolicy instanceof IGroupNotifier) {
- return (IGroupNotifier) editPolicy;
- } else {
- editPolicy = host.getEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_CREATION_EDIT_POLICY);
- if (editPolicy instanceof IGroupNotifier) {
- return (IGroupNotifier) editPolicy;
- }
- }
- throw new RuntimeException("Unable to retreive the IGroupNofier of the current group");////$NON-NLS-1$
- }
-
- /**
- * Get the edit which represent the parent (semantically) of the edit part child passed in argument
- *
- * @param child
- * @return
- */
- private IGraphicalEditPart getGraphicalParent(IGraphicalEditPart child) {
- IGraphicalEditPart result = child;
- EObject childElement = child.resolveSemanticElement();
- if (child != null) {
- while (childElement == result.resolveSemanticElement()) {
- try {
- result = (IGraphicalEditPart) result.getParent();
- } catch (ClassCastException e) {
- return result;
- }
- }
- }
- return result;
- }
-
- /**
- * Create a notification to ask user if he want to change the graphical parent of some elements
- *
- * @param listOfFilteredChidren
- * @param changeGraphicalParentRunnable
- * @return
- */
- private NotificationBuilder createChangeGraphicalParentNotification(final Iterable<IGroupNotifier> listOfFilteredChidren, ChangeGraphicalParentRunnable changeGraphicalParentRunnable, final IGraphicalEditPart host) {
- return new NotificationBuilder().setType(Type.INFO).setAsynchronous(true).setTemporary(true).setDelay(3000).setTitle("Papyrus graphical modification").setComposite(new ICompositeCreator() {
-
- @Override
- public Composite createComposite(Composite parent, FormToolkit toolkit) {
- return new IntegrateViewToConfigureComposite(parent, SWT.NONE, Lists.newArrayList(Lists.newArrayList(listOfFilteredChidren)), "New elements are visually contained in the current group (" + Utils.getCorrectLabel(host)
- + ").\n Please select the elements you want to integrate into this group figure.");
- }
- }).addAction(changeGraphicalParentRunnable);
- }
-
- /**
- * Handle graphical children
- *
- * @param request
- * {@link IGroupRequest}
- * @param cc
- * {@link CompositeCommand} to compose new commands
- * @return The list of all graphical children already handled
- */
- protected List<EObject> handleGraphicalChildren(IGroupRequest request, CompositeCommand cc) {
- /*
- * List of all the graphical children
- */
- List<EObject> graphicalChildren = new ArrayList<EObject>();
- /*
- * Handle graphical children
- */
- // Get graphical children
- Object targetEditPart = request.getTargetElement().getAdapter(IGraphicalEditPart.class);
- IGraphicalEditPart compartementEditPart = null;
- if (targetEditPart instanceof IGroupCompartmentEditPart) {
- compartementEditPart = ((IGraphicalEditPart) targetEditPart);
- } else if (targetEditPart instanceof IGraphicalEditPart) {
- IContainerNodeDescriptor nodeDescpitor = request.getNodeDescpitor();
- if (nodeDescpitor != null) {
- compartementEditPart = nodeDescpitor.getCompartmentPartFromView((IGraphicalEditPart) targetEditPart);
- }
- }
- if (compartementEditPart != null) {
- /*
- * Transform an IGraphicalEditPart to the related GroupNotifyingEditPolicy
- */
- @SuppressWarnings("unchecked")
- Iterable<GroupNotifyingOnMoveEditPolicy> policies = Iterables.transform(compartementEditPart.getChildren(), new Function<IGraphicalEditPart, GroupNotifyingOnMoveEditPolicy>() {
-
- @Override
- public GroupNotifyingOnMoveEditPolicy apply(IGraphicalEditPart from) {
- EditPolicy editPolicy = from.getEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY);
- if (editPolicy instanceof GroupNotifyingOnMoveEditPolicy) {
- return (GroupNotifyingOnMoveEditPolicy) editPolicy;
- }
- return null;
- }
- });
- for (final GroupNotifyingOnMoveEditPolicy p : policies) {
- if (p != null) {
- if (DebugUtils.isDebugging()) {
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append("+++ Work for child ");
- stringBuilder.append(Utils.getCorrectLabel(p.getEObject()));
- stringBuilder.append(" +++");
- DebugUtils.getLog().debug(stringBuilder.toString());
- }
- Request initialRequest = request.getInitialRequest();
- Request auxChReq = null;
- if (initialRequest instanceof ChangeBoundsRequest) {
- auxChReq = Utils.getChangeBoundsRequestCopy((ChangeBoundsRequest) initialRequest, p.getHostEditPart());
- } else {
- auxChReq = initialRequest;
- }
- /*
- * Save graphical parent
- */
- // auxChReq.getExtendedData().put(GROUP_FRAMEWORK_GRAPHICAL_PARENT, compartementEditPart.resolveSemanticElement());
- graphicalChildren.add(p.getEObject());
- Command childCommand = p.getCommand(auxChReq);
- if (childCommand != null && childCommand.canExecute()) {
- cc.compose(new CommandProxy(childCommand));
- }
- }
- }
- }
- return graphicalChildren;
- }
-
- /**
- * Set and Unset semantic relation with parents
- *
- * @param request
- * {@link IGroupRequest}
- * @param cc
- * {@link CompositeCommand} to compose command
- * @param elementAdapter
- */
- protected void handleSemanticParents(IGroupRequest request, CompositeCommand cc, Object elementAdapter) {
- EObject targetElement = (EObject) elementAdapter;
- Multimap<EReference, EObject> allActualParent = request.getParentEReferenceMap();
- for (Entry<EReference, EObject> entry : Utils.getOldParents(request).entries()) {
- EReference ref = entry.getKey();
- if (ref != null) {
- if (!allActualParent.containsEntry(ref, entry.getValue())) {
- EReference eOpposite = ref.getEOpposite();
- if (eOpposite != null && !eOpposite.isContainment() && !eOpposite.isDerived()) {
- RemoveValueRequest rmVa = new RemoveValueRequest(targetElement, ref, Collections.singletonList(entry.getValue()));
- RemoveValueCommand rmCmd = new RemoveValueCommand(rmVa);
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append("From handling parent : Remove ");////$NON-NLS-1$
- stringBuilder.append(Utils.getCorrectLabel(entry.getValue()));
- stringBuilder.append(" from ");////$NON-NLS-1$
- stringBuilder.append(Utils.getCorrectLabel(targetElement));
- stringBuilder.append(" value ");////$NON-NLS-1$
- stringBuilder.append(Utils.getCorrectLabel(entry.getValue()));//
- rmCmd.setLabel(stringBuilder.toString());
- if (rmCmd != null) {
- cc.compose(rmCmd);
- }
- }
- // }
- }
- }
- }
- /*
- * Set semantic
- * If the EObject has not been already handle as graphical children
- */
- for (Entry<EReference, EObject> entry : request.getParentEReferenceMap().entries()) {
- EReference ref = entry.getKey();
- if (ref != null) {
- EReference eOpposite = ref.getEOpposite();
- if (eOpposite != null && !eOpposite.isContainment() && !ref.isContainment()) {
- SetDeferredRequest setRq = new SetDeferredRequest(request.getHostRequest().getEditingDomain(), request.getTargetElement(), ref, entry.getValue());
- DeferredSetValueCommand setCmd = new DeferredSetValueCommand(setRq);
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append("From handling parent : Set deferred ");////$NON-NLS-1$
- stringBuilder.append(Utils.getCorrectLabel(ref));
- stringBuilder.append(" from ");////$NON-NLS-1$
- stringBuilder.append(Utils.getCorrectLabel(request.getTargetElement()));
- stringBuilder.append(" value ");////$NON-NLS-1$
- stringBuilder.append(Utils.getCorrectLabel(entry.getValue()));//
- setCmd.setLabel(stringBuilder.toString());
- if (setCmd != null) {
- cc.compose(setCmd);
- }
- }
- }
- }
- }
-
- /**
- * Return a list of all IGroupRequestListenner which can be children of the target of the request
- *
- * @param request
- * @return
- */
- protected Multimap<EReference, IGroupNotifier> fillRequestWithAllPossibleChildren(IGroupRequest request) {
- final Multimap<EReference, IGroupNotifier> result = fillReqestWithReferendedElement(request, false, false);
- /**
- * TODO filter graphical parent which currently moving
- * I1 in ActPart1
- * ActPart1 move into ActPart2
- * I1 should only reference ActPart1
- */
- /*
- * Debug
- */
- DebugUtils.displayMultipmapDebug(CHILDREN_REFERENCES_ARE, request.getChildrenEReferenceMap());
- return result;
- }
-
- public EObject getPossibleModelParent(IGroupRequest request) {
- Multimap<EReference, IGroupNotifier> parentsMap = fillReqestWithReferendedElement(request, true, true);
- List<IGroupNotifier> parents = Lists.newArrayList(parentsMap.values());
- Collections.sort(parents);
- if (!parents.isEmpty()) {
- return parents.get(0).getEObject();
- }
- return request.getHostRequest().resolveSemanticElement();
- }
-
- /**
- * Return only current displayed listener
- *
- * @author adaussy
- *
- */
- private static class ActiveListener implements Predicate<IGroupNotifier> {
-
- private Diagram currentDiagramDisplayed;
-
- public ActiveListener(Diagram currentDiagramDisplayed) {
- super();
- this.currentDiagramDisplayed = currentDiagramDisplayed;
- Assert.isNotNull(currentDiagramDisplayed);
- }
-
- @Override
- public boolean apply(IGroupNotifier input) {
- IGraphicalEditPart host = input.getHostEditPart();
- if (host != null) {
- View primaryView = host.getPrimaryView();
- if (primaryView != null) {
- return currentDiagramDisplayed.equals(primaryView.getDiagram());
- }
- }
- return false;
- }
- }
-
- /**
- * Get all the element in references which are included or include (depending of the parameter include)
- *
- * @param request
- * {@link IGroupRequest}
- * @param newBounds
- * New bounds of the elements
- * @param references
- * All references to take into account
- * @param eReferenceMapToFillInRequest
- * Map in the request to fill
- * @param result
- * {@link Map} which link a {@link EReference} to a {@link IGroupNotifier}
- * @param containementOnly
- * true if we are looking for containing references only
- */
- protected void getReferenceElements(IGroupRequest request, final Rectangle newBounds, final List<EReference> references, Multimap<EReference, Element> eReferenceMapToFillInRequest, Multimap<EReference, IGroupNotifier> result, boolean include,
- boolean containementOnly, Map<EStructuralFeature, EStructuralFeature> parentOpositeFeature) {
- Iterable<IGroupNotifier> activeListeners = Iterables.filter(getListenerRegistry().values(), new ActiveListener(getCurrentlyDisplayedDiagram(request)));
- for (IGroupNotifier input : activeListeners) {
- EObject inputEObject = input.getEObject();
- if (inputEObject == null || !(inputEObject instanceof Element)) {
- continue;
- }
- Object adapter = request.getTargetElement().getAdapter(EObject.class);
- // EObject targetElement = null;
- // if(adapter instanceof EObject) {
- // targetElement = (EObject)adapter;
- // }
- if (inputEObject.equals(adapter)) {
- continue;
- }
- EReference refenceFounded = null;
- for (EReference ref : references) {
- EClass refType = ref.getEReferenceType();
- EClass eoBjectType = inputEObject.eClass();
- if (refType.isSuperTypeOf(eoBjectType)) {
- refenceFounded = ref;
- break;
- }
- }
- if (refenceFounded != null) {
- if ((include && input.includes(newBounds)) || (!include && input.isIncludedIn(newBounds))) {
- if (containementOnly && parentOpositeFeature.get(refenceFounded) instanceof EReference && !((EReference) parentOpositeFeature.get(refenceFounded)).isContainment()) {
- continue;
- }
- eReferenceMapToFillInRequest.put(refenceFounded, (Element) inputEObject);
- result.put(refenceFounded, input);
- }
- }
- }
- }
-
- /**
- * Return the currently displayed diagram
- *
- * @param request
- * @return
- */
- protected Diagram getCurrentlyDisplayedDiagram(IGroupRequest request) {
- IGraphicalEditPart graph = request.getHostRequest();
- if (graph != null) {
- Object m = graph.getModel();
- if (m instanceof View) {
- View v = (View) m;
- return v.getDiagram();
- }
- }
- throw new RuntimeException("Unable to get the current diagram displayed");////$NON-NLS-1$
- }
-
- /**
- * Return the list of all {@link IGroupNotifier} which can be parent of the target of the request
- *
- * @param request
- * @return
- */
- protected Multimap<EReference, IGroupNotifier> fillRequestWithAllPossibleParent(IGroupRequest request) {
- final Multimap<EReference, IGroupNotifier> result = fillReqestWithReferendedElement(request, true, false);
- /*
- * Debug
- */
- DebugUtils.displayMultipmapDebug(ALL_PARENT_REFERENCES_ARE, request.getParentEReferenceMap());
- return result;
- }
-
- protected Multimap<EReference, IGroupNotifier> fillReqestWithReferendedElement(IGroupRequest request, boolean lookingForParent, boolean onlyContainment) {
- final Rectangle newBounds = getInitalTargetRequestNewBounds(request);
- final Multimap<EReference, IGroupNotifier> result = ArrayListMultimap.create();
- if (request.getNodeDescpitor() == null) {
- return result;
- }
- List<EReference> references = null;
- if (lookingForParent) {
- references = request.getNodeDescpitor().getParentReferences();
- } else {
- references = request.getNodeDescpitor().getChildrenReferences();
- }
- final Multimap<EReference, IGroupNotifier> auxResult = ArrayListMultimap.create();
- final Multimap<EReference, Element> eReferenceLookedForMap = ArrayListMultimap.create();
- getReferenceElements(request, newBounds, references, eReferenceLookedForMap, auxResult, lookingForParent, onlyContainment, lookingForParent ? request.getNodeDescpitor().getParentEOppositeReferences() : null);
- /*
- * Filter ancestors
- */
- for (EReference ref : eReferenceLookedForMap.keySet()) {
- /*
- * Filter descendant
- * Example :
- * 1 - ActPart1 include in Act1 then Act1 disappear
- * 2 - ActPart1 include in ActPart2 then ActPart1 disappear
- */
- Object adapter = request.getTargetElement().getAdapter(EObject.class);
- if (adapter instanceof Element) {
- Element element = (Element) adapter;
- Predicate<Element> composedPredicate = Predicates.and(new SameContainerFilter(element), lookingForParent ? new DescendantsFilter(eReferenceLookedForMap.values()) : new AncestorFilter(eReferenceLookedForMap.values()));
- Collection<Element> filteredCollection = Collections2.filter(eReferenceLookedForMap.get(ref), composedPredicate);
- if (lookingForParent) {
- request.getParentEReferenceMap().putAll(ref, filteredCollection);
- } else {
- request.getChildrenEReferenceMap().putAll(ref, filteredCollection);
- }
- }
- }
- for (EReference ref : auxResult.keySet()) {
- /*
- * Filter descendant
- * Example :
- * 1 - ActPart1 include in Act1 then Act1 disappear
- * 2 - ActPart1 include in ActPart2 then ActPart1 disappear
- */
- Iterable<IGroupNotifier> resultCollection = Iterables.filter(auxResult.get(ref), new DescendantsFilterIGroupNotifier(auxResult.values()));
- result.putAll(ref, resultCollection);
- }
- return result;
- }
-
- /**
- * Get the absolute bounds of the target of the request
- *
- * @param request
- * @return
- */
- public static Rectangle getInitalTargetRequestNewBounds(final IGroupRequest request) {
- Request initialRequest = request.getInitialRequest();
- if (initialRequest instanceof ChangeBoundsRequest) {
- return Utils.getAbslotueRequestBounds((ChangeBoundsRequest) initialRequest, request.getHostRequest());
- } else if (initialRequest instanceof CreateViewRequest) {
- return Utils.getAbslotueRequestBounds((CreateViewRequest) initialRequest);
- }
- throw new RuntimeException(UNABLE_TO_GET_THE_INTIAL_TARGET_REQUEST_BOUNDS);
- }
-
- /**
- * Convenience method to get a list of workspaces files associated with <code>eObject</code>.
- *
- * @param eObject
- * the model object, may be <code>null</code>
- * @return the list of {@link IFile}s
- */
- protected static List getWorkspaceFiles(EObject eObject) {
- List result = new ArrayList();
- if (eObject != null) {
- Resource resource = eObject.eResource();
- if (resource != null) {
- IFile file = WorkspaceSynchronizer.getFile(resource);
- if (file != null) {
- result.add(file);
- }
- }
- }
- return result;
- }
-
- /**
- * Convenience method to get a list of workspaces files associated with {@link EObject}s in <code>eObject</code>.
- *
- * @param eObjects
- * the list of model object
- * @return the list of {@link IFile}s
- */
- protected static List getWorkspaceFiles(List eObjects) {
- List result = new ArrayList();
- for (Iterator i = eObjects.iterator(); i.hasNext();) {
- Object next = i.next();
- if (next instanceof EObject) {
- Resource resource = ((EObject) next).eResource();
- if (resource != null) {
- IFile file = WorkspaceSynchronizer.getFile(resource);
- if (file != null) {
- result.add(file);
- }
- }
- }
- }
- return result;
- }
-
- /**
- * @return the listenners
- */
- @Override
- public Multimap<EObject, IGroupNotifier> getListenerRegistry() {
- return listenners;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import javax.naming.InitialContext;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gef.requests.GroupRequest;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.type.core.commands.MoveElementsCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.widgets.toolbox.notification.ICompositeCreator;
+import org.eclipse.papyrus.infra.widgets.toolbox.notification.INotification;
+import org.eclipse.papyrus.infra.widgets.toolbox.notification.NotificationRunnable;
+import org.eclipse.papyrus.infra.widgets.toolbox.notification.Type;
+import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.IContext;
+import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.NotificationBuilder;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.GroupNotifyingOnMoveEditPolicy;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.IGroupNotifier;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates.AncestorFilter;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates.DescendantsFilter;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates.DescendantsFilterIGroupNotifier;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates.SameContainerFilter;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.IGroupRequest;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.SetDeferredRequest;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.ui.IntegrateViewToConfigureComposite;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.DebugUtils;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.Utils;
+import org.eclipse.papyrus.uml.diagram.activity.commands.DeferredSetValueCommand;
+import org.eclipse.papyrus.uml.diagram.activity.commands.RunNotificationCommand;
+import org.eclipse.papyrus.uml.diagram.activity.edit.part.ActivityGroup.IGroupCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.uml.diagram.common.commands.RemoveValueCommand;
+import org.eclipse.papyrus.uml.diagram.common.commands.RemoveValueRequest;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.uml2.uml.ActivityGroup;
+import org.eclipse.uml2.uml.Element;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Multimap;
+import com.google.common.collect.Sets;
+
+public class GroupRequestAdvisor implements IGroupRequestAdvisor {
+
+ /**
+ * Exception message
+ */
+ private static final String UNABLE_TO_GET_THE_INTIAL_TARGET_REQUEST_BOUNDS = "Unable to get the intial target request bounds";////$NON-NLS-1$
+
+ /**
+ * Debug message
+ */
+ private static final String CHILDREN_REFERENCES_ARE = " ---- Children references are : ---- ";
+
+ /**
+ * Debug message
+ */
+ private static final String ALL_PARENT_REFERENCES_ARE = " ---- All parent references are : ---- ";
+
+ /**
+ * Runnable to run command to change parent of selected element
+ *
+ * @author arthur daussy
+ *
+ */
+ private final class ChangeGraphicalParentRunnable implements NotificationRunnable {
+
+ /**
+ * New graphical host
+ */
+ private final IGraphicalEditPart host;
+
+ /**
+ * Initial request
+ */
+ private final IGroupRequest request;
+
+ /**
+ * List of all modified view
+ * Used to compute list of modfied files
+ */
+ private List<View> viewTomodify;
+
+ /**
+ * Constructor
+ *
+ * @param host
+ * New graphical host
+ * @param request
+ * Initial request
+ */
+ private ChangeGraphicalParentRunnable(IGraphicalEditPart host, IGroupRequest request) {
+ this.host = host;
+ this.request = request;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.ui.toolbox.notification.NotificationRunnable#run(org.eclipse.papyrus.ui.toolbox.notification.builders.IContext)
+ */
+ @Override
+ public void run(IContext context) {
+ IntegrateViewToConfigureComposite composite = (IntegrateViewToConfigureComposite) context.get(IContext.COMPOSITE_CREATED);
+ final INotification notif = (INotification) context.get(IContext.NOTIFICATION_OBJECT);
+ CompositeTransactionalCommand ccMovingElement = new CompositeTransactionalCommand(request.getHostRequest().getEditingDomain(), "Move graphical elements into a new host");////$NON-NLS-1$
+ /*
+ * Use to calculate impacted file
+ */
+ viewTomodify = Lists.newArrayList();
+ IGraphicalEditPart hostEditPart = request.getHostRequest();
+ viewTomodify.add(host.getNotationView());
+ for (IGroupNotifier notifier : composite.getSelectedNotifier()) {
+ IGraphicalEditPart notifierEditPart = notifier.getHostEditPart();
+ IGraphicalEditPart hostCompartmentEditPart = request.getNodeDescpitor().getCompartmentPartFromView(hostEditPart);
+ /*
+ * debugging label
+ */
+ if (DebugUtils.isDebugging()) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("Move ");
+ stringBuilder.append(Utils.getCorrectLabel(notifierEditPart));
+ stringBuilder.append(" to ");
+ stringBuilder.append(Utils.getCorrectLabel(hostEditPart));
+ DebugUtils.getLog().info(stringBuilder.toString());
+ }
+ if (notifierEditPart != null) {
+ EObject semanticElementToDrop = notifierEditPart.resolveSemanticElement();
+ if (semanticElementToDrop != null && hostCompartmentEditPart != null) {
+ /*
+ * Request to change graphical parent
+ */
+ ChangeBoundsRequest chdBoundsRequest = new ChangeBoundsRequest(RequestConstants.REQ_ADD);
+ chdBoundsRequest.setEditParts(notifierEditPart);
+ viewTomodify.add(notifierEditPart.getNotationView());
+ Command dropcommand = hostCompartmentEditPart.getCommand(chdBoundsRequest);
+ if (dropcommand != null) {
+ ccMovingElement.compose(new CommandProxy(dropcommand));
+ }
+ } else {
+ // log error
+ }
+ } else {
+ // log error
+ }
+ }
+ /*
+ * Execute resulting command
+ */
+ if (ccMovingElement != null && !ccMovingElement.isEmpty()) {
+ host.getEditingDomain().getCommandStack().execute(new GMFtoEMFCommandWrapper(ccMovingElement));
+ }
+ notif.delete();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.ui.toolbox.notification.NotificationRunnable#getLabel()
+ */
+ @Override
+ public String getLabel() {
+ return "OK";
+ }
+
+ /**
+ * @return the list of all EObject modifed
+ */
+ public List getModifiedObject() {
+ return viewTomodify == null ? Collections.emptyList() : viewTomodify;
+ }
+ }
+
+ /**
+ * SingletonHolder is loaded on the first execution of Singleton.getInstance()
+ * or the first access to SingletonHolder.INSTANCE, not before.
+ */
+ private static class SingletonHolder {
+
+ public static final GroupRequestAdvisor instance = new GroupRequestAdvisor();
+ }
+
+ /**
+ * Get the instance of {@link GroupRequestAdvisor}
+ *
+ * @return
+ */
+ public static GroupRequestAdvisor getInstance() {
+ return SingletonHolder.instance;
+ }
+
+ /**
+ * Store all the listener
+ */
+ private Multimap<EObject, IGroupNotifier> listenners;
+
+ /**
+ * Logger
+ */
+ private static LogHelper log = new LogHelper(UMLDiagramEditorPlugin.getInstance());
+
+ /***
+ * Private constructor
+ */
+ private GroupRequestAdvisor() {
+ listenners = ArrayListMultimap.create();
+ }
+
+ /**
+ * Add a {@link IGroupNotifier}
+ *
+ * @param editpolicy
+ */
+ @Override
+ public void addListenner(EObject eObject, IGroupNotifier editpolicy) {
+ getListenerRegistry().put(eObject, editpolicy);
+ }
+
+ /**
+ * Remove a {@link IGroupNotifier}
+ *
+ * @param editpolicy
+ */
+ @Override
+ public void removeListenner(IGroupNotifier editpolicy) {
+ if (editpolicy == null) {
+ return;
+ }
+ Iterator<Entry<EObject, IGroupNotifier>> iterator = getListenerRegistry().entries().iterator();
+ while (iterator.hasNext()) {
+ Entry<EObject, IGroupNotifier> entry = iterator.next();
+ if (editpolicy.equals(entry.getValue())) {
+ iterator.remove();
+ }
+ }
+ }
+
+ @Override
+ public ICommand notifyGroupFramework(IGroupRequest request) {
+ if (DebugUtils.isDebugging()) {
+ log.debug("***********************BEGIN : Group Request Advisor***********************************");
+ }
+ /******************
+ * Handling parent
+ ******************/
+ CompositeCommand cc = new CompositeCommand("Global command from GroupRequestAdvisor");
+ Request initialRequest = request.getInitialRequest();
+ if (initialRequest instanceof ChangeBoundsRequest) {
+ handleMove(request, cc);
+ } else if (initialRequest instanceof GroupRequest && RequestConstants.REQ_DELETE.equals(initialRequest.getType())) {
+ handleDelete(request, cc);
+ }
+ if (cc != null && !cc.isEmpty()) {
+ return cc;
+ }
+ return null;
+ }
+
+ protected void handleDelete(IGroupRequest request, CompositeCommand cc) {
+ // request.getNodeDescpitor().getChildrenReferences()
+ }
+
+ /**
+ * Handle move
+ *
+ * @param request
+ * @param cc
+ */
+ protected void handleMove(IGroupRequest request, CompositeCommand cc) {
+ /*
+ * All parent
+ */
+ fillRequestWithAllPossibleParent(request);
+ fillRequestWithAllPossibleChildren(request);
+ Object elementAdapter = request.getTargetElement().getAdapter(EObject.class);
+ if (elementAdapter instanceof EObject) {
+ /*
+ * Handle children
+ */
+ handleSemanticChildren(request, cc, (EObject) elementAdapter);
+ /*
+ * Semantic of all the parent
+ */
+ handleSemanticParents(request, cc, elementAdapter);
+ }
+ if (DebugUtils.isDebugging()) {
+ log.debug("***********************END : Group Request Advisor***********************************");
+ }
+ // /*
+ // * For all new child send request
+ // * For all GrChild create new request from old one and use dispatcher
+ // */
+ // if(cc != null && !cc.isEmpty()) {
+ // return cc;
+ // }
+ // return null;
+ }
+
+ /**
+ * Handle all the children of the group (graphical and non graphical children)
+ *
+ * @param request
+ * @param cc
+ * @param targetElement
+ */
+ protected void handleSemanticChildren(final IGroupRequest request, CompositeCommand cc, EObject targetElement) {
+ List<EObject> graphicalChildren = Lists.newArrayList();
+ /*
+ * There is graphical childrne only when the node is moving
+ */
+ if (request.getInitialRequest() instanceof ChangeBoundsRequest) {
+ graphicalChildren = handleGraphicalChildren(request, cc);
+ }
+ /*
+ * Unset
+ */
+ for (Entry<EReference, EObject> oldChildrenEntry : Utils.getOldChildren(request).entries()) {
+ Multimap<EReference, EObject> allActualChildren = request.getChildrenEReferenceMap();
+ EReference ref = oldChildrenEntry.getKey();
+ if (ref != null) {
+ if (!allActualChildren.containsEntry(oldChildrenEntry.getValue(), ref)) {
+ EReference eOpposite = ref.getEOpposite();
+ if (!graphicalChildren.contains(oldChildrenEntry.getValue())) {
+ if (eOpposite != null && !eOpposite.isContainment() && !ref.isContainment()) {
+ RemoveValueRequest rmVa = new RemoveValueRequest(targetElement, ref, Collections.singletonList(oldChildrenEntry.getValue()));
+ RemoveValueCommand rmCmd = new RemoveValueCommand(rmVa);
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("From handling parent : Remove ");////$NON-NLS-1$
+ stringBuilder.append(Utils.getCorrectLabel(ref));
+ stringBuilder.append(" from ");////$NON-NLS-1$
+ stringBuilder.append(Utils.getCorrectLabel(targetElement));
+ stringBuilder.append(" value ");////$NON-NLS-1$
+ stringBuilder.append(Utils.getCorrectLabel(oldChildrenEntry.getValue()));//
+ rmCmd.setLabel(stringBuilder.toString());
+ if (rmCmd != null) {
+ cc.compose(rmCmd);
+ }
+ }
+ }
+ }
+ }
+ }
+ /*
+ * Set semantic
+ */
+ Set<EObject> newChildren = Sets.newHashSet();
+ for (Entry<EReference, EObject> entry : request.getChildrenEReferenceMap().entries()) {
+ EReference ref = entry.getKey();
+ if (ref != null) {
+ EReference eOpposite = ref.getEOpposite();
+ if (!graphicalChildren.contains(entry.getValue())) {
+ newChildren.add(entry.getValue());
+ if (eOpposite != null && !eOpposite.isContainment()) {
+ SetDeferredRequest setRq = new SetDeferredRequest(request.getHostRequest().getEditingDomain(), request.getTargetElement(), ref, entry.getValue());
+ DeferredSetValueCommand setCmd = new DeferredSetValueCommand(setRq);
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("From handling parent : Set deferred");////$NON-NLS-1$
+ stringBuilder.append(Utils.getCorrectLabel(entry.getValue()));
+ stringBuilder.append(" from ");////$NON-NLS-1$
+ stringBuilder.append(Utils.getCorrectLabel(ref));
+ stringBuilder.append(" value ");////$NON-NLS-1$
+ stringBuilder.append(Utils.getCorrectLabel(entry.getValue()));//
+ setCmd.setLabel(stringBuilder.toString());
+ if (setCmd != null) {
+ cc.compose(setCmd);
+ }
+ }
+ }
+ }
+ if (!newChildren.isEmpty()) {
+ handleChangeParentNotificationCommand(request, cc, newChildren);
+ }
+ }
+ }
+
+ /**
+ * Create a notification to user to ask him is he want to add its new children as graphical child of its parent group
+ *
+ * @param request
+ * {@link InitialContext} {@link IGroupRequest}
+ * @param cc
+ * {@link CompositeCommand} to compose new commands
+ * @param newChildren
+ * List of all new children
+ */
+ protected void handleChangeParentNotificationCommand(final IGroupRequest request, CompositeCommand cc, Set<EObject> newChildren) {
+ /*
+ * Create dialog to suggest user to move views
+ */
+ final IGraphicalEditPart host = request.getHostRequest();
+ /*
+ * Get editpart of all children
+ */
+ Iterable<IGroupNotifier> listOfChidren = Iterables.transform(newChildren, new Function<EObject, IGroupNotifier>() {
+
+ @Override
+ public IGroupNotifier apply(EObject arg0) {
+ Collection<IGroupNotifier> notifiers = getListenerRegistry().get(arg0);
+ for (IGroupNotifier notifier : notifiers) {
+ IGraphicalEditPart notifierEditPart = notifier.getHostEditPart();
+ if (notifierEditPart != null) {
+ if (EcoreUtil.isAncestor(host.getNotationView().getDiagram(), notifierEditPart.getNotationView())) {
+ return notifier;
+ }
+ }
+ }
+ return null;
+ }
+ });
+ final Iterable<IGroupNotifier> listOfFilteredChidren = Iterables.filter(listOfChidren, Predicates.notNull());
+ List<IGroupNotifier> automaticChildren = Lists.newArrayList();
+ List<IGroupNotifier> nonAutomaticChildren = Lists.newArrayList();
+ /*
+ * Dispatch children
+ */
+ dispatchChildren(request, host, listOfFilteredChidren, automaticChildren, nonAutomaticChildren);
+ IGraphicalEditPart hostEditPart = request.getHostRequest();
+ /*
+ * Command to change graphical parent for element when we can guess graphical parent
+ */
+ for (IGroupNotifier notifier : automaticChildren) {
+ IGraphicalEditPart notifierEditPart = notifier.getHostEditPart();
+ IGraphicalEditPart hostCompartmentEditPart = request.getNodeDescpitor().getCompartmentPartFromView(hostEditPart);
+ Request initialRequest = request.getInitialRequest();
+ Rectangle hostBounds = null;
+ if (initialRequest instanceof ChangeBoundsRequest) {
+ hostBounds = Utils.getAbslotueRequestBounds((ChangeBoundsRequest) initialRequest, hostCompartmentEditPart);
+ } else {
+ hostBounds = Utils.getAbsoluteBounds(hostCompartmentEditPart);
+ }
+ Rectangle childBounds = Utils.getAbsoluteBounds(notifierEditPart);
+ MoveElementsCommand mvCmd = new MoveElementsCommand(new MoveRequest(hostCompartmentEditPart.getNotationView(), notifierEditPart.getNotationView()));
+ /*
+ * Integrate view into new compartment
+ */
+ if (mvCmd != null && mvCmd.canExecute()) {
+ cc.compose(mvCmd);
+ }
+ /*
+ * Set view to the new location
+ */
+ SetBoundsCommand setBoundCommand = new SetBoundsCommand(WorkspaceEditingDomainFactory.INSTANCE.getEditingDomain(host.getNotationView().eResource().getResourceSet()), "test", new EObjectAdapter(notifierEditPart.getNotationView()),
+ childBounds.translate(hostBounds.getLocation().negate()));
+ if (setBoundCommand != null && setBoundCommand.canExecute()) {
+ cc.compose(setBoundCommand);
+ }
+ }
+ /*
+ * Create notification for element where we can NOT guess the graphical parent
+ */
+ if (!nonAutomaticChildren.isEmpty()) {
+ /*
+ * create runnable to run the command
+ */
+ ChangeGraphicalParentRunnable changeGraphicalParentRunnable = new ChangeGraphicalParentRunnable(host, request);
+ final NotificationBuilder notification = createChangeGraphicalParentNotification(nonAutomaticChildren, changeGraphicalParentRunnable, hostEditPart);
+ RunNotificationCommand runNotifCmd = new RunNotificationCommand(request.getHostRequest().getEditingDomain(), "Notification command", getWorkspaceFiles(changeGraphicalParentRunnable.getModifiedObject()), notification);////$NON-NLS-1$
+ cc.compose(runNotifCmd);
+ }
+ }
+
+ /**
+ * Dispatch all children in two category.
+ * listOfFilteredChidren will contained all element to automatically add as graphical children
+ * nonAutomaticChildren will contained all element to ask the user what to do with
+ *
+ * @param request
+ * @param host
+ * @param listOfFilteredChidren
+ * @param automaticChildren
+ * @param nonAutomaticChildren
+ */
+ private void dispatchChildren(final IGroupRequest request, final IGraphicalEditPart host, final Iterable<IGroupNotifier> listOfFilteredChidren, List<IGroupNotifier> automaticChildren, List<IGroupNotifier> nonAutomaticChildren) {
+ for (IGroupNotifier notifier : listOfFilteredChidren) {
+ IGraphicalEditPart parentEditPart = getGraphicalParent(notifier.getHostEditPart());
+ if (parentEditPart != null) {
+ EObject eObject = parentEditPart.resolveSemanticElement();
+ if (eObject instanceof ActivityGroup) {
+ ActivityGroup group = (ActivityGroup) eObject;
+ Collection<IGroupNotifier> groupNotifiers = listenners.get(group);
+ if (!groupNotifiers.isEmpty()) {
+ IGroupNotifier myGroupNotifier = groupNotifiers.iterator().next();
+ /*
+ * Is the old container (an activity group) continaing the current moving element
+ */
+ boolean isNewContainerVisuallyIncludeInOldContainer = myGroupNotifier.includes(Utils.getAbslotueRequestBounds((ChangeBoundsRequest) request.getInitialRequest(), host));
+ /*
+ * Can the old container (an activity group) be a model a the current moving element
+ */
+ boolean canTheOldContainerBeAModelParentOfTheNewContainer = myGroupNotifier.getHostGroupDescriptor().canIBeModelParentOf(host.resolveSemanticElement().eClass());
+ /*
+ *
+ */
+ boolean canTheNewContainerBeModelParentOfTheOldContianer = request.getNodeDescpitor().canIBeModelParentOf(host.resolveSemanticElement().eClass());
+ /*
+ * Is the current moving element containing the old container
+ */
+ IGroupNotifier currentElementNotifier = getIGroupNotifier(host);
+ boolean isOldContainerVisuallyIncludeInNewContainer = currentElementNotifier.includes(Utils.getAbsoluteBounds(myGroupNotifier.getHostEditPart()));
+ if (canTheOldContainerBeAModelParentOfTheNewContainer && isNewContainerVisuallyIncludeInOldContainer) {
+ /*
+ * Is going to be a new child of the old container
+ */
+ automaticChildren.add(notifier);
+ } else if (canTheNewContainerBeModelParentOfTheOldContianer && isOldContainerVisuallyIncludeInNewContainer) {
+ /*
+ * Is going to be a new container for the old container
+ */
+ } else {
+ /*
+ * There is no containing relation between the groups
+ */
+ if (currentElementNotifier.getHostGroupDescriptor().getContainmentReferenceFor(notifier.getHostEditPart().resolveSemanticElement().eClass()) == null) {
+ nonAutomaticChildren.add(notifier);
+ } else {
+ // If containment link automatically add it to new group
+ automaticChildren.add(notifier);
+ }
+ }
+ } else {
+ /*
+ * No notifier where found
+ */
+ nonAutomaticChildren.add(notifier);
+ }
+ } else {
+ /*
+ * If there is no container (which is group)
+ */
+ if (!parentEditPart.equals(host)) {
+ automaticChildren.add(notifier);
+ }
+ }
+ } else {
+ DebugUtils.getLog().error("Unable to retreive graphical parent of " + Utils.getCorrectLabel(notifier), null);
+ }
+ }
+ }
+
+ /**
+ * Get the IGroupNotifier of the {@link IGraphicalEditPart} passed in argument
+ *
+ * @param host
+ * @return
+ */
+ private IGroupNotifier getIGroupNotifier(final IGraphicalEditPart host) {
+ EditPolicy editPolicy = host.getEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY);
+ if (editPolicy instanceof IGroupNotifier) {
+ return (IGroupNotifier) editPolicy;
+ } else {
+ editPolicy = host.getEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_CREATION_EDIT_POLICY);
+ if (editPolicy instanceof IGroupNotifier) {
+ return (IGroupNotifier) editPolicy;
+ }
+ }
+ throw new RuntimeException("Unable to retreive the IGroupNofier of the current group");////$NON-NLS-1$
+ }
+
+ /**
+ * Get the edit which represent the parent (semantically) of the edit part child passed in argument
+ *
+ * @param child
+ * @return
+ */
+ private IGraphicalEditPart getGraphicalParent(IGraphicalEditPart child) {
+ IGraphicalEditPart result = child;
+ EObject childElement = child.resolveSemanticElement();
+ if (child != null) {
+ while (childElement == result.resolveSemanticElement()) {
+ try {
+ result = (IGraphicalEditPart) result.getParent();
+ } catch (ClassCastException e) {
+ return result;
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Create a notification to ask user if he want to change the graphical parent of some elements
+ *
+ * @param listOfFilteredChidren
+ * @param changeGraphicalParentRunnable
+ * @return
+ */
+ private NotificationBuilder createChangeGraphicalParentNotification(final Iterable<IGroupNotifier> listOfFilteredChidren, ChangeGraphicalParentRunnable changeGraphicalParentRunnable, final IGraphicalEditPart host) {
+ return new NotificationBuilder().setType(Type.INFO).setAsynchronous(true).setTemporary(true).setDelay(3000).setTitle("Papyrus graphical modification").setComposite(new ICompositeCreator() {
+
+ @Override
+ public Composite createComposite(Composite parent, FormToolkit toolkit) {
+ return new IntegrateViewToConfigureComposite(parent, SWT.NONE, Lists.newArrayList(Lists.newArrayList(listOfFilteredChidren)), "New elements are visually contained in the current group (" + Utils.getCorrectLabel(host)
+ + ").\n Please select the elements you want to integrate into this group figure.");
+ }
+ }).addAction(changeGraphicalParentRunnable);
+ }
+
+ /**
+ * Handle graphical children
+ *
+ * @param request
+ * {@link IGroupRequest}
+ * @param cc
+ * {@link CompositeCommand} to compose new commands
+ * @return The list of all graphical children already handled
+ */
+ protected List<EObject> handleGraphicalChildren(IGroupRequest request, CompositeCommand cc) {
+ /*
+ * List of all the graphical children
+ */
+ List<EObject> graphicalChildren = new ArrayList<EObject>();
+ /*
+ * Handle graphical children
+ */
+ // Get graphical children
+ Object targetEditPart = request.getTargetElement().getAdapter(IGraphicalEditPart.class);
+ IGraphicalEditPart compartementEditPart = null;
+ if (targetEditPart instanceof IGroupCompartmentEditPart) {
+ compartementEditPart = ((IGraphicalEditPart) targetEditPart);
+ } else if (targetEditPart instanceof IGraphicalEditPart) {
+ IContainerNodeDescriptor nodeDescpitor = request.getNodeDescpitor();
+ if (nodeDescpitor != null) {
+ compartementEditPart = nodeDescpitor.getCompartmentPartFromView((IGraphicalEditPart) targetEditPart);
+ }
+ }
+ if (compartementEditPart != null) {
+ /*
+ * Transform an IGraphicalEditPart to the related GroupNotifyingEditPolicy
+ */
+ @SuppressWarnings("unchecked")
+ Iterable<GroupNotifyingOnMoveEditPolicy> policies = Iterables.transform(compartementEditPart.getChildren(), new Function<IGraphicalEditPart, GroupNotifyingOnMoveEditPolicy>() {
+
+ @Override
+ public GroupNotifyingOnMoveEditPolicy apply(IGraphicalEditPart from) {
+ EditPolicy editPolicy = from.getEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY);
+ if (editPolicy instanceof GroupNotifyingOnMoveEditPolicy) {
+ return (GroupNotifyingOnMoveEditPolicy) editPolicy;
+ }
+ return null;
+ }
+ });
+ for (final GroupNotifyingOnMoveEditPolicy p : policies) {
+ if (p != null) {
+ if (DebugUtils.isDebugging()) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("+++ Work for child ");
+ stringBuilder.append(Utils.getCorrectLabel(p.getEObject()));
+ stringBuilder.append(" +++");
+ DebugUtils.getLog().debug(stringBuilder.toString());
+ }
+ Request initialRequest = request.getInitialRequest();
+ Request auxChReq = null;
+ if (initialRequest instanceof ChangeBoundsRequest) {
+ auxChReq = Utils.getChangeBoundsRequestCopy((ChangeBoundsRequest) initialRequest, p.getHostEditPart());
+ } else {
+ auxChReq = initialRequest;
+ }
+ /*
+ * Save graphical parent
+ */
+ // auxChReq.getExtendedData().put(GROUP_FRAMEWORK_GRAPHICAL_PARENT, compartementEditPart.resolveSemanticElement());
+ graphicalChildren.add(p.getEObject());
+ Command childCommand = p.getCommand(auxChReq);
+ if (childCommand != null && childCommand.canExecute()) {
+ cc.compose(new CommandProxy(childCommand));
+ }
+ }
+ }
+ }
+ return graphicalChildren;
+ }
+
+ /**
+ * Set and Unset semantic relation with parents
+ *
+ * @param request
+ * {@link IGroupRequest}
+ * @param cc
+ * {@link CompositeCommand} to compose command
+ * @param elementAdapter
+ */
+ protected void handleSemanticParents(IGroupRequest request, CompositeCommand cc, Object elementAdapter) {
+ EObject targetElement = (EObject) elementAdapter;
+ Multimap<EReference, EObject> allActualParent = request.getParentEReferenceMap();
+ for (Entry<EReference, EObject> entry : Utils.getOldParents(request).entries()) {
+ EReference ref = entry.getKey();
+ if (ref != null) {
+ if (!allActualParent.containsEntry(ref, entry.getValue())) {
+ EReference eOpposite = ref.getEOpposite();
+ if (eOpposite != null && !eOpposite.isContainment() && !eOpposite.isDerived()) {
+ RemoveValueRequest rmVa = new RemoveValueRequest(targetElement, ref, Collections.singletonList(entry.getValue()));
+ RemoveValueCommand rmCmd = new RemoveValueCommand(rmVa);
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("From handling parent : Remove ");////$NON-NLS-1$
+ stringBuilder.append(Utils.getCorrectLabel(entry.getValue()));
+ stringBuilder.append(" from ");////$NON-NLS-1$
+ stringBuilder.append(Utils.getCorrectLabel(targetElement));
+ stringBuilder.append(" value ");////$NON-NLS-1$
+ stringBuilder.append(Utils.getCorrectLabel(entry.getValue()));//
+ rmCmd.setLabel(stringBuilder.toString());
+ if (rmCmd != null) {
+ cc.compose(rmCmd);
+ }
+ }
+ // }
+ }
+ }
+ }
+ /*
+ * Set semantic
+ * If the EObject has not been already handle as graphical children
+ */
+ for (Entry<EReference, EObject> entry : request.getParentEReferenceMap().entries()) {
+ EReference ref = entry.getKey();
+ if (ref != null) {
+ EReference eOpposite = ref.getEOpposite();
+ if (eOpposite != null && !eOpposite.isContainment() && !ref.isContainment()) {
+ SetDeferredRequest setRq = new SetDeferredRequest(request.getHostRequest().getEditingDomain(), request.getTargetElement(), ref, entry.getValue());
+ DeferredSetValueCommand setCmd = new DeferredSetValueCommand(setRq);
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("From handling parent : Set deferred ");////$NON-NLS-1$
+ stringBuilder.append(Utils.getCorrectLabel(ref));
+ stringBuilder.append(" from ");////$NON-NLS-1$
+ stringBuilder.append(Utils.getCorrectLabel(request.getTargetElement()));
+ stringBuilder.append(" value ");////$NON-NLS-1$
+ stringBuilder.append(Utils.getCorrectLabel(entry.getValue()));//
+ setCmd.setLabel(stringBuilder.toString());
+ if (setCmd != null) {
+ cc.compose(setCmd);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Return a list of all IGroupRequestListenner which can be children of the target of the request
+ *
+ * @param request
+ * @return
+ */
+ protected Multimap<EReference, IGroupNotifier> fillRequestWithAllPossibleChildren(IGroupRequest request) {
+ final Multimap<EReference, IGroupNotifier> result = fillReqestWithReferendedElement(request, false, false);
+ /**
+ * TODO filter graphical parent which currently moving
+ * I1 in ActPart1
+ * ActPart1 move into ActPart2
+ * I1 should only reference ActPart1
+ */
+ /*
+ * Debug
+ */
+ DebugUtils.displayMultipmapDebug(CHILDREN_REFERENCES_ARE, request.getChildrenEReferenceMap());
+ return result;
+ }
+
+ public EObject getPossibleModelParent(IGroupRequest request) {
+ Multimap<EReference, IGroupNotifier> parentsMap = fillReqestWithReferendedElement(request, true, true);
+ List<IGroupNotifier> parents = Lists.newArrayList(parentsMap.values());
+ Collections.sort(parents);
+ if (!parents.isEmpty()) {
+ return parents.get(0).getEObject();
+ }
+ return request.getHostRequest().resolveSemanticElement();
+ }
+
+ /**
+ * Return only current displayed listener
+ *
+ * @author adaussy
+ *
+ */
+ private static class ActiveListener implements Predicate<IGroupNotifier> {
+
+ private Diagram currentDiagramDisplayed;
+
+ public ActiveListener(Diagram currentDiagramDisplayed) {
+ super();
+ this.currentDiagramDisplayed = currentDiagramDisplayed;
+ Assert.isNotNull(currentDiagramDisplayed);
+ }
+
+ @Override
+ public boolean apply(IGroupNotifier input) {
+ IGraphicalEditPart host = input.getHostEditPart();
+ if (host != null) {
+ View primaryView = host.getPrimaryView();
+ if (primaryView != null) {
+ return currentDiagramDisplayed.equals(primaryView.getDiagram());
+ }
+ }
+ return false;
+ }
+ }
+
+ /**
+ * Get all the element in references which are included or include (depending of the parameter include)
+ *
+ * @param request
+ * {@link IGroupRequest}
+ * @param newBounds
+ * New bounds of the elements
+ * @param references
+ * All references to take into account
+ * @param eReferenceMapToFillInRequest
+ * Map in the request to fill
+ * @param result
+ * {@link Map} which link a {@link EReference} to a {@link IGroupNotifier}
+ * @param containementOnly
+ * true if we are looking for containing references only
+ */
+ protected void getReferenceElements(IGroupRequest request, final Rectangle newBounds, final List<EReference> references, Multimap<EReference, Element> eReferenceMapToFillInRequest, Multimap<EReference, IGroupNotifier> result, boolean include,
+ boolean containementOnly, Map<EStructuralFeature, EStructuralFeature> parentOpositeFeature) {
+ Iterable<IGroupNotifier> activeListeners = Iterables.filter(getListenerRegistry().values(), new ActiveListener(getCurrentlyDisplayedDiagram(request)));
+ for (IGroupNotifier input : activeListeners) {
+ EObject inputEObject = input.getEObject();
+ if (inputEObject == null || !(inputEObject instanceof Element)) {
+ continue;
+ }
+ Object adapter = request.getTargetElement().getAdapter(EObject.class);
+ // EObject targetElement = null;
+ // if(adapter instanceof EObject) {
+ // targetElement = (EObject)adapter;
+ // }
+ if (inputEObject.equals(adapter)) {
+ continue;
+ }
+ EReference refenceFounded = null;
+ for (EReference ref : references) {
+ EClass refType = ref.getEReferenceType();
+ EClass eoBjectType = inputEObject.eClass();
+ if (refType.isSuperTypeOf(eoBjectType)) {
+ refenceFounded = ref;
+ break;
+ }
+ }
+ if (refenceFounded != null) {
+ if ((include && input.includes(newBounds)) || (!include && input.isIncludedIn(newBounds))) {
+ if (containementOnly && parentOpositeFeature.get(refenceFounded) instanceof EReference && !((EReference) parentOpositeFeature.get(refenceFounded)).isContainment()) {
+ continue;
+ }
+ eReferenceMapToFillInRequest.put(refenceFounded, (Element) inputEObject);
+ result.put(refenceFounded, input);
+ }
+ }
+ }
+ }
+
+ /**
+ * Return the currently displayed diagram
+ *
+ * @param request
+ * @return
+ */
+ protected Diagram getCurrentlyDisplayedDiagram(IGroupRequest request) {
+ IGraphicalEditPart graph = request.getHostRequest();
+ if (graph != null) {
+ Object m = graph.getModel();
+ if (m instanceof View) {
+ View v = (View) m;
+ return v.getDiagram();
+ }
+ }
+ throw new RuntimeException("Unable to get the current diagram displayed");////$NON-NLS-1$
+ }
+
+ /**
+ * Return the list of all {@link IGroupNotifier} which can be parent of the target of the request
+ *
+ * @param request
+ * @return
+ */
+ protected Multimap<EReference, IGroupNotifier> fillRequestWithAllPossibleParent(IGroupRequest request) {
+ final Multimap<EReference, IGroupNotifier> result = fillReqestWithReferendedElement(request, true, false);
+ /*
+ * Debug
+ */
+ DebugUtils.displayMultipmapDebug(ALL_PARENT_REFERENCES_ARE, request.getParentEReferenceMap());
+ return result;
+ }
+
+ protected Multimap<EReference, IGroupNotifier> fillReqestWithReferendedElement(IGroupRequest request, boolean lookingForParent, boolean onlyContainment) {
+ final Rectangle newBounds = getInitalTargetRequestNewBounds(request);
+ final Multimap<EReference, IGroupNotifier> result = ArrayListMultimap.create();
+ if (request.getNodeDescpitor() == null) {
+ return result;
+ }
+ List<EReference> references = null;
+ if (lookingForParent) {
+ references = request.getNodeDescpitor().getParentReferences();
+ } else {
+ references = request.getNodeDescpitor().getChildrenReferences();
+ }
+ final Multimap<EReference, IGroupNotifier> auxResult = ArrayListMultimap.create();
+ final Multimap<EReference, Element> eReferenceLookedForMap = ArrayListMultimap.create();
+ getReferenceElements(request, newBounds, references, eReferenceLookedForMap, auxResult, lookingForParent, onlyContainment, lookingForParent ? request.getNodeDescpitor().getParentEOppositeReferences() : null);
+ /*
+ * Filter ancestors
+ */
+ for (EReference ref : eReferenceLookedForMap.keySet()) {
+ /*
+ * Filter descendant
+ * Example :
+ * 1 - ActPart1 include in Act1 then Act1 disappear
+ * 2 - ActPart1 include in ActPart2 then ActPart1 disappear
+ */
+ Object adapter = request.getTargetElement().getAdapter(EObject.class);
+ if (adapter instanceof Element) {
+ Element element = (Element) adapter;
+ Predicate<Element> composedPredicate = Predicates.and(new SameContainerFilter(element), lookingForParent ? new DescendantsFilter(eReferenceLookedForMap.values()) : new AncestorFilter(eReferenceLookedForMap.values()));
+ Collection<Element> filteredCollection = Collections2.filter(eReferenceLookedForMap.get(ref), composedPredicate);
+ if (lookingForParent) {
+ request.getParentEReferenceMap().putAll(ref, filteredCollection);
+ } else {
+ request.getChildrenEReferenceMap().putAll(ref, filteredCollection);
+ }
+ }
+ }
+ for (EReference ref : auxResult.keySet()) {
+ /*
+ * Filter descendant
+ * Example :
+ * 1 - ActPart1 include in Act1 then Act1 disappear
+ * 2 - ActPart1 include in ActPart2 then ActPart1 disappear
+ */
+ Iterable<IGroupNotifier> resultCollection = Iterables.filter(auxResult.get(ref), new DescendantsFilterIGroupNotifier(auxResult.values()));
+ result.putAll(ref, resultCollection);
+ }
+ return result;
+ }
+
+ /**
+ * Get the absolute bounds of the target of the request
+ *
+ * @param request
+ * @return
+ */
+ public static Rectangle getInitalTargetRequestNewBounds(final IGroupRequest request) {
+ Request initialRequest = request.getInitialRequest();
+ if (initialRequest instanceof ChangeBoundsRequest) {
+ return Utils.getAbslotueRequestBounds((ChangeBoundsRequest) initialRequest, request.getHostRequest());
+ } else if (initialRequest instanceof CreateViewRequest) {
+ return Utils.getAbslotueRequestBounds((CreateViewRequest) initialRequest);
+ }
+ throw new RuntimeException(UNABLE_TO_GET_THE_INTIAL_TARGET_REQUEST_BOUNDS);
+ }
+
+ /**
+ * Convenience method to get a list of workspaces files associated with <code>eObject</code>.
+ *
+ * @param eObject
+ * the model object, may be <code>null</code>
+ * @return the list of {@link IFile}s
+ */
+ protected static List getWorkspaceFiles(EObject eObject) {
+ List result = new ArrayList();
+ if (eObject != null) {
+ Resource resource = eObject.eResource();
+ if (resource != null) {
+ IFile file = WorkspaceSynchronizer.getFile(resource);
+ if (file != null) {
+ result.add(file);
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Convenience method to get a list of workspaces files associated with {@link EObject}s in <code>eObject</code>.
+ *
+ * @param eObjects
+ * the list of model object
+ * @return the list of {@link IFile}s
+ */
+ protected static List getWorkspaceFiles(List eObjects) {
+ List result = new ArrayList();
+ for (Iterator i = eObjects.iterator(); i.hasNext();) {
+ Object next = i.next();
+ if (next instanceof EObject) {
+ Resource resource = ((EObject) next).eResource();
+ if (resource != null) {
+ IFile file = WorkspaceSynchronizer.getFile(resource);
+ if (file != null) {
+ result.add(file);
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @return the listenners
+ */
+ @Override
+ public Multimap<EObject, IGroupNotifier> getListenerRegistry() {
+ return listenners;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/IContainerNodeDescriptor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/IContainerNodeDescriptor.java
index 72f77c3f4ca..52adc476963 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/IContainerNodeDescriptor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/IContainerNodeDescriptor.java
@@ -1,95 +1,95 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup;
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-
-/**
- * Interface used to descripbe a node
- *
- * @author adaussy
- *
- */
-public interface IContainerNodeDescriptor extends Comparable<IContainerNodeDescriptor> {
-
- /**
- * Get the EReference used to contained a child of a specified eClass
- *
- * @param childType
- * @return
- */
- public EReference getContainmentReferenceFor(EClass childType);
-
- /**
- * Get all references that can used to reference an child of a specified eClass
- *
- * @param childType
- * @return
- */
- public List<EReference> getReferenceFor(EClass childType);
-
- /**
- * Can the node point by this node descriptor can be a an a parent of a child describe by the eClass childType
- *
- * @param childType
- * @return
- */
- public boolean canIBeModelParentOf(EClass childType);
-
- /**
- * Return true if the node can be a graphical parent of the child specified by its eClass
- *
- * @param childType
- * @return
- */
- public boolean canIBeGraphicalParentOf(EClass childType);
-
- /**
- * Get the corrent compartment form an edit part
- * (This is a limit the handle node can have only one compartment)
- *
- * @param editpart
- * @return
- */
- public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart);
-
- /**
- * Get all the references of the child
- *
- * @return
- */
- public List<EReference> getChildrenReferences();
-
- public List<EClass> getPossibleGraphicalChildren();
-
- public EClass getContainerEClass();
-
- public List<EReference> getParentReferences();
-
- public Map<EStructuralFeature, EStructuralFeature> getParentEOppositeReferences();
-
- /**
- * Return an int which define for a same child the priority of this parent to be its graphical father
- *
- * @return
- */
- public int getGroupPriority();
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup;
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+
+/**
+ * Interface used to descripbe a node
+ *
+ * @author adaussy
+ *
+ */
+public interface IContainerNodeDescriptor extends Comparable<IContainerNodeDescriptor> {
+
+ /**
+ * Get the EReference used to contained a child of a specified eClass
+ *
+ * @param childType
+ * @return
+ */
+ public EReference getContainmentReferenceFor(EClass childType);
+
+ /**
+ * Get all references that can used to reference an child of a specified eClass
+ *
+ * @param childType
+ * @return
+ */
+ public List<EReference> getReferenceFor(EClass childType);
+
+ /**
+ * Can the node point by this node descriptor can be a an a parent of a child describe by the eClass childType
+ *
+ * @param childType
+ * @return
+ */
+ public boolean canIBeModelParentOf(EClass childType);
+
+ /**
+ * Return true if the node can be a graphical parent of the child specified by its eClass
+ *
+ * @param childType
+ * @return
+ */
+ public boolean canIBeGraphicalParentOf(EClass childType);
+
+ /**
+ * Get the corrent compartment form an edit part
+ * (This is a limit the handle node can have only one compartment)
+ *
+ * @param editpart
+ * @return
+ */
+ public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart);
+
+ /**
+ * Get all the references of the child
+ *
+ * @return
+ */
+ public List<EReference> getChildrenReferences();
+
+ public List<EClass> getPossibleGraphicalChildren();
+
+ public EClass getContainerEClass();
+
+ public List<EReference> getParentReferences();
+
+ public Map<EStructuralFeature, EStructuralFeature> getParentEOppositeReferences();
+
+ /**
+ * Return an int which define for a same child the priority of this parent to be its graphical father
+ *
+ * @return
+ */
+ public int getGroupPriority();
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/IGroupEditPolicies.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/IGroupEditPolicies.java
index 8a26e2822f9..08f407df115 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/IGroupEditPolicies.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/IGroupEditPolicies.java
@@ -1,36 +1,36 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup;
-
-/**
- * @author arthur daussy
- */
-public interface IGroupEditPolicies {
-
- /**
- * Role for Edit Policy which notify event to the group framework
- */
- public static String GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY = "GroupFramework_NotifyingOnMoveEditPolicy";
-
- /**
- * Role for Edit Policy which notify event to the group framework
- */
- public static String GROUP_FRAMEWORK_NOTIFYING_ON_CREATION_EDIT_POLICY = "GroupFramework_NotifyingOnCreationEditPolicy";
-
- /**
- * Role for Edit Policy which handle group framework notification
- */
- public static String GROUP_FRAMEWORK_HANDLING_EDIT_POLICY = "GroupFramework_HandlingEditPolicy";
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup;
+
+/**
+ * @author arthur daussy
+ */
+public interface IGroupEditPolicies {
+
+ /**
+ * Role for Edit Policy which notify event to the group framework
+ */
+ public static String GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY = "GroupFramework_NotifyingOnMoveEditPolicy";
+
+ /**
+ * Role for Edit Policy which notify event to the group framework
+ */
+ public static String GROUP_FRAMEWORK_NOTIFYING_ON_CREATION_EDIT_POLICY = "GroupFramework_NotifyingOnCreationEditPolicy";
+
+ /**
+ * Role for Edit Policy which handle group framework notification
+ */
+ public static String GROUP_FRAMEWORK_HANDLING_EDIT_POLICY = "GroupFramework_HandlingEditPolicy";
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/IGroupRequestAdvisor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/IGroupRequestAdvisor.java
index dad7dec3e65..e91648208e3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/IGroupRequestAdvisor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/IGroupRequestAdvisor.java
@@ -1,61 +1,61 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.IGroupNotifier;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.IGroupRequest;
-
-import com.google.common.collect.Multimap;
-
-/**
- * Represent an advisor of Group Request. Should be able to handle group request
- *
- * @author arthur daussy
- *
- */
-public interface IGroupRequestAdvisor {
-
- /**
- * Remove the listener from the Group framework
- *
- * @param editpolicy
- */
- public void removeListenner(IGroupNotifier editpolicy);
-
- /**
- * Register into the group framework
- *
- * @param eObject
- * @param editpolicy
- */
- public void addListenner(EObject eObject, IGroupNotifier editpolicy);
-
- /**
- * Notify to the group framework a change (come from a Notifing Edit policy)
- *
- * @param request
- * @return
- */
- public ICommand notifyGroupFramework(IGroupRequest request);
-
- /**
- * Return all register edit policy
- *
- * @return
- */
- public Multimap<EObject, IGroupNotifier> getListenerRegistry();
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.IGroupNotifier;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.IGroupRequest;
+
+import com.google.common.collect.Multimap;
+
+/**
+ * Represent an advisor of Group Request. Should be able to handle group request
+ *
+ * @author arthur daussy
+ *
+ */
+public interface IGroupRequestAdvisor {
+
+ /**
+ * Remove the listener from the Group framework
+ *
+ * @param editpolicy
+ */
+ public void removeListenner(IGroupNotifier editpolicy);
+
+ /**
+ * Register into the group framework
+ *
+ * @param eObject
+ * @param editpolicy
+ */
+ public void addListenner(EObject eObject, IGroupNotifier editpolicy);
+
+ /**
+ * Notify to the group framework a change (come from a Notifing Edit policy)
+ *
+ * @param request
+ * @return
+ */
+ public ICommand notifyGroupFramework(IGroupRequest request);
+
+ /**
+ * Return all register edit policy
+ *
+ * @return
+ */
+ public Multimap<EObject, IGroupNotifier> getListenerRegistry();
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/ActivityPartitionActivityPartitionContentCompartmentCreationEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/ActivityPartitionActivityPartitionContentCompartmentCreationEditPolicy.java
index 15cc8bd1c40..8861ada17fc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/ActivityPartitionActivityPartitionContentCompartmentCreationEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/ActivityPartitionActivityPartitionContentCompartmentCreationEditPolicy.java
@@ -1,34 +1,34 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy;
-
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
-
-/**
- * Creation edit policy for Activiyt partition
- *
- * @author adaussy
- *
- */
-public class ActivityPartitionActivityPartitionContentCompartmentCreationEditPolicy extends GroupCreationEditPolicy {
-
- /**
- * Elements graphically shown inside partitions are semantically owned by the activity.
- * So default reparenting check (of different semantic containers) should be skipped for partition contents.
- */
- public ActivityPartitionActivityPartitionContentCompartmentCreationEditPolicy(IContainerNodeDescriptor groupDescriptor) {
- super(groupDescriptor);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy;
+
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
+
+/**
+ * Creation edit policy for Activiyt partition
+ *
+ * @author adaussy
+ *
+ */
+public class ActivityPartitionActivityPartitionContentCompartmentCreationEditPolicy extends GroupCreationEditPolicy {
+
+ /**
+ * Elements graphically shown inside partitions are semantically owned by the activity.
+ * So default reparenting check (of different semantic containers) should be skipped for partition contents.
+ */
+ public ActivityPartitionActivityPartitionContentCompartmentCreationEditPolicy(IContainerNodeDescriptor groupDescriptor) {
+ super(groupDescriptor);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/GroupCreationEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/GroupCreationEditPolicy.java
index 4d6d1563899..9118eaeb20c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/GroupCreationEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/GroupCreationEditPolicy.java
@@ -1,314 +1,314 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SemanticCreateCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GroupEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RefreshConnectionsRequest;
-import org.eclipse.gmf.runtime.emf.core.util.PackageUtil;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.ContainerNodeDescriptorRegistry;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.GroupRequestAdvisor;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.AbstractGroupRequest;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.IGroupRequest;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.Utils;
-
-public class GroupCreationEditPolicy extends CreationEditPolicy {
-
- /**
- * Node descriptor
- */
- private IContainerNodeDescriptor groupDescriptor;
-
- /**
- * @param groupDescriptor
- */
- public GroupCreationEditPolicy(IContainerNodeDescriptor groupDescriptor) {
- super();
- this.groupDescriptor = groupDescriptor;
- }
-
- /**
- * Return the {@link IContainerNodeDescriptor} of the group owning this edit policy
- *
- * @return
- */
- protected IContainerNodeDescriptor getGroupDescriptor() {
- return groupDescriptor;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy#getReparentCommand(org.eclipse.gef.requests.ChangeBoundsRequest)
- */
- @Override
- protected Command getReparentCommand(ChangeBoundsRequest request) {
- Iterator editParts = request.getEditParts().iterator();
- View container = (View) getHost().getAdapter(View.class);
- EObject context = container == null ? null : ViewUtil.resolveSemanticElement(container);
- CompositeCommand cc = new CompositeCommand(DiagramUIMessages.AddCommand_Label);
- while (editParts.hasNext()) {
- EditPart ep = (EditPart) editParts.next();
- if (ep instanceof LabelEditPart) {
- continue;
- }
- if (ep instanceof GroupEditPart) {
- cc.compose(getReparentGroupCommand((GroupEditPart) ep));
- }
- View view = (View) ep.getAdapter(View.class);
- if (view == null) {
- continue;
- }
- EObject semantic = ViewUtil.resolveSemanticElement(view);
- if (semantic == null) {
- cc.compose(getReparentViewCommand((IGraphicalEditPart) ep));
- } else if (context != null) {
- if (shouldReparentModel(semantic, context)) {
- cc.compose(getReparentCommand((IGraphicalEditPart) ep));
- } else if (shouldGraphicalyReparent(semantic, context)) {
- cc.compose(getReparentViewCommand((IGraphicalEditPart) ep));
- }
- }
- }
- return cc.isEmpty() ? null : new ICommandProxy(cc.reduce());
- }
-
- /**
- * Return true if the node is visually contained into the host
- *
- * @param ep
- * @return
- */
- protected boolean isVisuallyContained(IGraphicalEditPart ep, ChangeBoundsRequest request) {
- Rectangle hostBounds = Utils.getAbsoluteBounds((IGraphicalEditPart) getHost());
- Rectangle ndeBounds = Utils.getAbslotueRequestBounds(request, ep);
- return hostBounds.contains(ndeBounds);
- }
-
- /**
- * Return true if this element should be a model child of this element
- *
- * @param semantic
- * @param context
- * @return
- */
- protected boolean shouldReparentModel(EObject element, EObject newContext) {
- EReference feature = PackageUtil.findFeature(newContext.eClass(), element.eClass());
- return feature != null && feature.isContainment() && shouldReparent(element, newContext) && !isSameContainer(element, newContext);
- }
-
- /**
- * Return true if the element should be a graphical child to this element
- *
- * @param semantic
- * @param context
- * @return
- */
- protected boolean shouldGraphicalyReparent(EObject element, EObject newContext) {
- EReference feature = findFeatureWhichReference(newContext.eClass(), element.eClass());
- return feature != null && !feature.isContainment() && shouldReparent(element, newContext);
- }
-
- /**
- * Finds a feature that can contain an object of type eClass.
- *
- * @param container
- * The container <code>EClass</code>.
- * @param eClass
- * The contained <code>EClass</code>.
- * @return The found feature.
- */
- protected static EReference findFeatureWhichReference(EClass container, EClass eClass) {
- Iterator i = container.getEAllReferences().iterator();
- while (i.hasNext()) {
- EReference reference = (EReference) i.next();
- if (PackageUtil.canReference(container, reference, eClass)) {
- return reference;
- }
- }
- return null;
- }
-
- /**
- * Checks if a container <code>EClass</code> can reference another <code>EClass</code>.
- *
- * @param class1
- * The referencer <code>EClass</code>.
- * @param class2
- * The referenced <code>EClass</code>.
- * @return True if an object can contain other objects of a given type.
- */
- protected static boolean canReference(EClass class1, EClass class2) {
- Iterator i = class1.getEAllReferences().iterator();
- while (i.hasNext()) {
- EReference reference = (EReference) i.next();
- if (!reference.isContainment()) {
- EClass eType = (EClass) reference.getEType();
- if ((eType.equals(class2)) || (eType.isSuperTypeOf(class2))) {
- return true;
- }
- }
- }
- return false;
- }
-
- @Override
- protected boolean shouldReparent(EObject element, EObject newContext) {
- return !(element == null || element == newContext || isContainedIn(element, newContext));
- }
-
- /**
- * Return true if the the container of the element if the newContext
- *
- * @param element
- * @param newContext
- * @return
- */
- protected boolean isSameContainer(EObject element, EObject newContext) {
- return element.eContainer() == newContext;
- }
-
- /*
- * This method checks to see element's containment tree already includes
- * itself. This is necessary to prevent cyclic graphs in the model that
- * cause StackOverflowExceptions.
- */
- private boolean isContainedIn(EObject element, EObject newContext) {
- EObject container = newContext.eContainer();
- while (container != null) {
- if (container.equals(element)) {
- return true;
- }
- container = container.eContainer();
- }
- return false;
- }
-
- @Override
- public EditPart getTargetEditPart(Request request) {
- if (request instanceof ChangeBoundsRequest) {
- ChangeBoundsRequest chRequest = (ChangeBoundsRequest) request;
- List editParts = chRequest.getEditParts();
- if (editParts != null) {
- for (Object p : editParts) {
- if (p instanceof IGraphicalEditPart) {
- IGraphicalEditPart graphEditPart = (IGraphicalEditPart) p;
- if (isVisuallyContained(graphEditPart, chRequest)) {
- return getHost();
- }
- return ((IGraphicalEditPart) getHost()).getTopGraphicEditPart().getParent();
- }
- }
- }
- }
- return super.getTargetEditPart(request);
- }
-
- @Override
- protected Command getCreateElementAndViewCommand(CreateViewAndElementRequest request) {
- // get the element descriptor
- CreateElementRequestAdapter requestAdapter = request.getViewAndElementDescriptor().getCreateElementRequestAdapter();
- // get the semantic request
- CreateElementRequest createElementRequest = (CreateElementRequest) requestAdapter.getAdapter(CreateElementRequest.class);
- tryToFindModelParentFromGroupFramework(createElementRequest, new AbstractGroupRequest((IGraphicalEditPart) getHost(), request, request.getViewAndElementDescriptor().getElementAdapter(), ContainerNodeDescriptorRegistry.getInstance()
- .getContainerNodeDescriptor(createElementRequest.getElementType().getEClass())) {
-
- @Override
- public GroupRequestType getGroupRequestType() {
- return GroupRequestType.CREATION;
- }
- });
- if (createElementRequest.getContainer() == null) {
- // complete the semantic request by filling in the host's semantic
- // element as the context
- View view = (View) getHost().getModel();
- EObject hostElement = ViewUtil.resolveSemanticElement(view);
- if (hostElement == null && view.getElement() == null) {
- hostElement = view;
- }
- // Returns null if host is unresolvable so that trying to create a
- // new element in an unresolved shape will not be allowed.
- if (hostElement == null) {
- return null;
- }
- createElementRequest.setContainer(hostElement);
- }
- // get the create element command based on the elementdescriptor's
- // request
- Command createElementCommand = getHost().getCommand(new EditCommandRequestWrapper((CreateElementRequest) requestAdapter.getAdapter(CreateElementRequest.class), request.getExtendedData()));
- if (createElementCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- if (!createElementCommand.canExecute()) {
- return createElementCommand;
- }
- // create the semantic create wrapper command
- SemanticCreateCommand semanticCommand = new SemanticCreateCommand(requestAdapter, createElementCommand);
- Command viewCommand = getCreateCommand(request);
- if (viewCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- if (!viewCommand.canExecute()) {
- return UnexecutableCommand.INSTANCE;
- }
- Command refreshConnectionCommand = getHost().getCommand(new RefreshConnectionsRequest(((List) request.getNewObject())));
- // form the compound command and return
- CompositeCommand cc = new CompositeCommand(semanticCommand.getLabel());
- cc.compose(semanticCommand);
- cc.compose(new CommandProxy(viewCommand));
- if (refreshConnectionCommand != null) {
- cc.compose(new CommandProxy(refreshConnectionCommand));
- }
- return new ICommandProxy(cc);
- }
-
- /**
- * Try to set the container of the request thanks to the group framework
- *
- * @param createElementRequest
- */
- protected void tryToFindModelParentFromGroupFramework(CreateElementRequest createElementRequest, IGroupRequest request) {
- EObject parent = GroupRequestAdvisor.getInstance().getPossibleModelParent(request);
- if (parent != null) {
- createElementRequest.setContainer(parent);
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.SemanticCreateCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GroupEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RefreshConnectionsRequest;
+import org.eclipse.gmf.runtime.emf.core.util.PackageUtil;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.ContainerNodeDescriptorRegistry;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.GroupRequestAdvisor;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.AbstractGroupRequest;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.IGroupRequest;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.Utils;
+
+public class GroupCreationEditPolicy extends CreationEditPolicy {
+
+ /**
+ * Node descriptor
+ */
+ private IContainerNodeDescriptor groupDescriptor;
+
+ /**
+ * @param groupDescriptor
+ */
+ public GroupCreationEditPolicy(IContainerNodeDescriptor groupDescriptor) {
+ super();
+ this.groupDescriptor = groupDescriptor;
+ }
+
+ /**
+ * Return the {@link IContainerNodeDescriptor} of the group owning this edit policy
+ *
+ * @return
+ */
+ protected IContainerNodeDescriptor getGroupDescriptor() {
+ return groupDescriptor;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy#getReparentCommand(org.eclipse.gef.requests.ChangeBoundsRequest)
+ */
+ @Override
+ protected Command getReparentCommand(ChangeBoundsRequest request) {
+ Iterator editParts = request.getEditParts().iterator();
+ View container = (View) getHost().getAdapter(View.class);
+ EObject context = container == null ? null : ViewUtil.resolveSemanticElement(container);
+ CompositeCommand cc = new CompositeCommand(DiagramUIMessages.AddCommand_Label);
+ while (editParts.hasNext()) {
+ EditPart ep = (EditPart) editParts.next();
+ if (ep instanceof LabelEditPart) {
+ continue;
+ }
+ if (ep instanceof GroupEditPart) {
+ cc.compose(getReparentGroupCommand((GroupEditPart) ep));
+ }
+ View view = (View) ep.getAdapter(View.class);
+ if (view == null) {
+ continue;
+ }
+ EObject semantic = ViewUtil.resolveSemanticElement(view);
+ if (semantic == null) {
+ cc.compose(getReparentViewCommand((IGraphicalEditPart) ep));
+ } else if (context != null) {
+ if (shouldReparentModel(semantic, context)) {
+ cc.compose(getReparentCommand((IGraphicalEditPart) ep));
+ } else if (shouldGraphicalyReparent(semantic, context)) {
+ cc.compose(getReparentViewCommand((IGraphicalEditPart) ep));
+ }
+ }
+ }
+ return cc.isEmpty() ? null : new ICommandProxy(cc.reduce());
+ }
+
+ /**
+ * Return true if the node is visually contained into the host
+ *
+ * @param ep
+ * @return
+ */
+ protected boolean isVisuallyContained(IGraphicalEditPart ep, ChangeBoundsRequest request) {
+ Rectangle hostBounds = Utils.getAbsoluteBounds((IGraphicalEditPart) getHost());
+ Rectangle ndeBounds = Utils.getAbslotueRequestBounds(request, ep);
+ return hostBounds.contains(ndeBounds);
+ }
+
+ /**
+ * Return true if this element should be a model child of this element
+ *
+ * @param semantic
+ * @param context
+ * @return
+ */
+ protected boolean shouldReparentModel(EObject element, EObject newContext) {
+ EReference feature = PackageUtil.findFeature(newContext.eClass(), element.eClass());
+ return feature != null && feature.isContainment() && shouldReparent(element, newContext) && !isSameContainer(element, newContext);
+ }
+
+ /**
+ * Return true if the element should be a graphical child to this element
+ *
+ * @param semantic
+ * @param context
+ * @return
+ */
+ protected boolean shouldGraphicalyReparent(EObject element, EObject newContext) {
+ EReference feature = findFeatureWhichReference(newContext.eClass(), element.eClass());
+ return feature != null && !feature.isContainment() && shouldReparent(element, newContext);
+ }
+
+ /**
+ * Finds a feature that can contain an object of type eClass.
+ *
+ * @param container
+ * The container <code>EClass</code>.
+ * @param eClass
+ * The contained <code>EClass</code>.
+ * @return The found feature.
+ */
+ protected static EReference findFeatureWhichReference(EClass container, EClass eClass) {
+ Iterator i = container.getEAllReferences().iterator();
+ while (i.hasNext()) {
+ EReference reference = (EReference) i.next();
+ if (PackageUtil.canReference(container, reference, eClass)) {
+ return reference;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Checks if a container <code>EClass</code> can reference another <code>EClass</code>.
+ *
+ * @param class1
+ * The referencer <code>EClass</code>.
+ * @param class2
+ * The referenced <code>EClass</code>.
+ * @return True if an object can contain other objects of a given type.
+ */
+ protected static boolean canReference(EClass class1, EClass class2) {
+ Iterator i = class1.getEAllReferences().iterator();
+ while (i.hasNext()) {
+ EReference reference = (EReference) i.next();
+ if (!reference.isContainment()) {
+ EClass eType = (EClass) reference.getEType();
+ if ((eType.equals(class2)) || (eType.isSuperTypeOf(class2))) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ protected boolean shouldReparent(EObject element, EObject newContext) {
+ return !(element == null || element == newContext || isContainedIn(element, newContext));
+ }
+
+ /**
+ * Return true if the the container of the element if the newContext
+ *
+ * @param element
+ * @param newContext
+ * @return
+ */
+ protected boolean isSameContainer(EObject element, EObject newContext) {
+ return element.eContainer() == newContext;
+ }
+
+ /*
+ * This method checks to see element's containment tree already includes
+ * itself. This is necessary to prevent cyclic graphs in the model that
+ * cause StackOverflowExceptions.
+ */
+ private boolean isContainedIn(EObject element, EObject newContext) {
+ EObject container = newContext.eContainer();
+ while (container != null) {
+ if (container.equals(element)) {
+ return true;
+ }
+ container = container.eContainer();
+ }
+ return false;
+ }
+
+ @Override
+ public EditPart getTargetEditPart(Request request) {
+ if (request instanceof ChangeBoundsRequest) {
+ ChangeBoundsRequest chRequest = (ChangeBoundsRequest) request;
+ List editParts = chRequest.getEditParts();
+ if (editParts != null) {
+ for (Object p : editParts) {
+ if (p instanceof IGraphicalEditPart) {
+ IGraphicalEditPart graphEditPart = (IGraphicalEditPart) p;
+ if (isVisuallyContained(graphEditPart, chRequest)) {
+ return getHost();
+ }
+ return ((IGraphicalEditPart) getHost()).getTopGraphicEditPart().getParent();
+ }
+ }
+ }
+ }
+ return super.getTargetEditPart(request);
+ }
+
+ @Override
+ protected Command getCreateElementAndViewCommand(CreateViewAndElementRequest request) {
+ // get the element descriptor
+ CreateElementRequestAdapter requestAdapter = request.getViewAndElementDescriptor().getCreateElementRequestAdapter();
+ // get the semantic request
+ CreateElementRequest createElementRequest = (CreateElementRequest) requestAdapter.getAdapter(CreateElementRequest.class);
+ tryToFindModelParentFromGroupFramework(createElementRequest, new AbstractGroupRequest((IGraphicalEditPart) getHost(), request, request.getViewAndElementDescriptor().getElementAdapter(), ContainerNodeDescriptorRegistry.getInstance()
+ .getContainerNodeDescriptor(createElementRequest.getElementType().getEClass())) {
+
+ @Override
+ public GroupRequestType getGroupRequestType() {
+ return GroupRequestType.CREATION;
+ }
+ });
+ if (createElementRequest.getContainer() == null) {
+ // complete the semantic request by filling in the host's semantic
+ // element as the context
+ View view = (View) getHost().getModel();
+ EObject hostElement = ViewUtil.resolveSemanticElement(view);
+ if (hostElement == null && view.getElement() == null) {
+ hostElement = view;
+ }
+ // Returns null if host is unresolvable so that trying to create a
+ // new element in an unresolved shape will not be allowed.
+ if (hostElement == null) {
+ return null;
+ }
+ createElementRequest.setContainer(hostElement);
+ }
+ // get the create element command based on the elementdescriptor's
+ // request
+ Command createElementCommand = getHost().getCommand(new EditCommandRequestWrapper((CreateElementRequest) requestAdapter.getAdapter(CreateElementRequest.class), request.getExtendedData()));
+ if (createElementCommand == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ if (!createElementCommand.canExecute()) {
+ return createElementCommand;
+ }
+ // create the semantic create wrapper command
+ SemanticCreateCommand semanticCommand = new SemanticCreateCommand(requestAdapter, createElementCommand);
+ Command viewCommand = getCreateCommand(request);
+ if (viewCommand == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ if (!viewCommand.canExecute()) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ Command refreshConnectionCommand = getHost().getCommand(new RefreshConnectionsRequest(((List) request.getNewObject())));
+ // form the compound command and return
+ CompositeCommand cc = new CompositeCommand(semanticCommand.getLabel());
+ cc.compose(semanticCommand);
+ cc.compose(new CommandProxy(viewCommand));
+ if (refreshConnectionCommand != null) {
+ cc.compose(new CommandProxy(refreshConnectionCommand));
+ }
+ return new ICommandProxy(cc);
+ }
+
+ /**
+ * Try to set the container of the request thanks to the group framework
+ *
+ * @param createElementRequest
+ */
+ protected void tryToFindModelParentFromGroupFramework(CreateElementRequest createElementRequest, IGroupRequest request) {
+ EObject parent = GroupRequestAdvisor.getInstance().getPossibleModelParent(request);
+ if (parent != null) {
+ createElementRequest.setContainer(parent);
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/InterruptibleActivityRegionContentCompartmentCreationEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/InterruptibleActivityRegionContentCompartmentCreationEditPolicy.java
index bf13917ff22..444598a6c9f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/InterruptibleActivityRegionContentCompartmentCreationEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/InterruptibleActivityRegionContentCompartmentCreationEditPolicy.java
@@ -1,30 +1,30 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy;
-
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
-
-/**
- * Handle creation in interruptible activity region content compartment
- *
- * @author adaussy
- *
- */
-public class InterruptibleActivityRegionContentCompartmentCreationEditPolicy extends GroupCreationEditPolicy {
-
- public InterruptibleActivityRegionContentCompartmentCreationEditPolicy(IContainerNodeDescriptor groupDescriptor) {
- super(groupDescriptor);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy;
+
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
+
+/**
+ * Handle creation in interruptible activity region content compartment
+ *
+ * @author adaussy
+ *
+ */
+public class InterruptibleActivityRegionContentCompartmentCreationEditPolicy extends GroupCreationEditPolicy {
+
+ public InterruptibleActivityRegionContentCompartmentCreationEditPolicy(IContainerNodeDescriptor groupDescriptor) {
+ super(groupDescriptor);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/ActivityGroupEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/ActivityGroupEditPolicy.java
index e74c64f49d4..5ddd35b9e08 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/ActivityGroupEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/ActivityGroupEditPolicy.java
@@ -1,84 +1,84 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IGroupEditPolicies;
-
-/**
- * The aim of the edit policy if to notify changes to the Group Framework for Activities Elements
- *
- * @author arthur daussy
- *
- */
-public class ActivityGroupEditPolicy extends GroupNotifyingOnMoveEditPolicy {
-
- /**
- *
- * @param groupDescriptor
- * IContainerNodeDescriptor
- */
- public ActivityGroupEditPolicy(IContainerNodeDescriptor groupDescriptor) {
- super(groupDescriptor);
- }
-
- /**
- * Override in order to:
- * - prevent Move of more than one Activity Group
- * - Initial Moving Edit Part State
- */
- @Override
- public Command getCommand(Request request) {
- if (understandsRequest(request)) {
- if (request instanceof ChangeBoundsRequest) {
- ChangeBoundsRequest chRq = (ChangeBoundsRequest) request;
- int compt = 0;
- if (chRq.getEditParts() != null) {
- for (Object p : chRq.getEditParts()) {
- if (p instanceof EditPart) {
- EditPart part = (EditPart) p;
- EditPolicy policy = part.getEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY);
- if (policy instanceof ActivityGroupEditPolicy) {
- compt++;
- }
- }
- }
- if (compt > 1) {
- return UnexecutableCommand.INSTANCE;
- }
- }
- initMovingPartState(chRq);
- Command cmd = super.getCommand(request);
- stopMovingPartState(chRq);
- return cmd;
- }
- }
- return null;
- }
-
- @Override
- public boolean understandsRequest(Request req) {
- if (req instanceof ChangeBoundsRequest) {
- return true;
- }
- return false;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IGroupEditPolicies;
+
+/**
+ * The aim of the edit policy if to notify changes to the Group Framework for Activities Elements
+ *
+ * @author arthur daussy
+ *
+ */
+public class ActivityGroupEditPolicy extends GroupNotifyingOnMoveEditPolicy {
+
+ /**
+ *
+ * @param groupDescriptor
+ * IContainerNodeDescriptor
+ */
+ public ActivityGroupEditPolicy(IContainerNodeDescriptor groupDescriptor) {
+ super(groupDescriptor);
+ }
+
+ /**
+ * Override in order to:
+ * - prevent Move of more than one Activity Group
+ * - Initial Moving Edit Part State
+ */
+ @Override
+ public Command getCommand(Request request) {
+ if (understandsRequest(request)) {
+ if (request instanceof ChangeBoundsRequest) {
+ ChangeBoundsRequest chRq = (ChangeBoundsRequest) request;
+ int compt = 0;
+ if (chRq.getEditParts() != null) {
+ for (Object p : chRq.getEditParts()) {
+ if (p instanceof EditPart) {
+ EditPart part = (EditPart) p;
+ EditPolicy policy = part.getEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY);
+ if (policy instanceof ActivityGroupEditPolicy) {
+ compt++;
+ }
+ }
+ }
+ if (compt > 1) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+ initMovingPartState(chRq);
+ Command cmd = super.getCommand(request);
+ stopMovingPartState(chRq);
+ return cmd;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public boolean understandsRequest(Request req) {
+ if (req instanceof ChangeBoundsRequest) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/ActivityNodeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/ActivityNodeEditPolicy.java
index 65bb3da56f3..fd28f978f7a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/ActivityNodeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/ActivityNodeEditPolicy.java
@@ -1,35 +1,35 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers;
-
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
-import org.eclipse.uml2.uml.ActivityNode;
-
-/**
- * Implementation of {@link GroupNotifyingOnMoveEditPolicy} for {@link ActivityNode}
- *
- * @author arthur daussy
- *
- */
-public class ActivityNodeEditPolicy extends GroupNotifyingOnMoveEditPolicy {
-
- /**
- *
- * @param groupDescriptor
- */
- public ActivityNodeEditPolicy(IContainerNodeDescriptor groupDescriptor) {
- super(groupDescriptor);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers;
+
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
+import org.eclipse.uml2.uml.ActivityNode;
+
+/**
+ * Implementation of {@link GroupNotifyingOnMoveEditPolicy} for {@link ActivityNode}
+ *
+ * @author arthur daussy
+ *
+ */
+public class ActivityNodeEditPolicy extends GroupNotifyingOnMoveEditPolicy {
+
+ /**
+ *
+ * @param groupDescriptor
+ */
+ public ActivityNodeEditPolicy(IContainerNodeDescriptor groupDescriptor) {
+ super(groupDescriptor);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/GroupListenerEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/GroupListenerEditPolicy.java
index 58fa10df50c..d946dc64ce6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/GroupListenerEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/GroupListenerEditPolicy.java
@@ -1,245 +1,245 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.ContainerNodeDescriptorRegistry;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.GroupRequestAdvisor;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IGroupRequestAdvisor;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.Utils;
-
-/**
- * Edit policy use as based for Group Edit Policies
- *
- * @author arthur daussy
- *
- */
-public abstract class GroupListenerEditPolicy extends GraphicalNodeEditPolicy implements IGroupNotifier {
-
- /**
- * {@link IContainerNodeDescriptor} which describe the relation that the semantic element can handle
- */
- private IContainerNodeDescriptor groupDescriptor;
-
- /**
- * State of the part. Return true is the part is currently moving
- */
- private boolean isMoving = false;
-
- /**
- * Moving request
- */
- private ChangeBoundsRequest movingRequest;
-
- /**
- * Constructor
- *
- * @param groupDescriptor
- * {@link IContainerNodeDescriptor} which describe the relation that the semantic element can handle
- */
- public GroupListenerEditPolicy(IContainerNodeDescriptor groupDescriptor) {
- super();
- this.groupDescriptor = groupDescriptor;
- }
-
- /**
- * {@inheritDoc IGroupNotifier#getEObject()}
- */
- @Override
- public EObject getEObject() {
- EditPart editPart = getHost();
- if (editPart instanceof IGraphicalEditPart) {
- return ((IGraphicalEditPart) editPart).resolveSemanticElement();
- }
- return null;
- }
-
- /**
- * Override to unregister this edit part from the group framework
- */
- @Override
- public void deactivate() {
- GroupRequestAdvisor.getInstance().removeListenner(this);
- super.deactivate();
- }
-
- /**
- * Override to register this edit part into the group framework
- */
- @Override
- public void activate() {
- EObject resolveSemanticElement = getHostEditPart().resolveSemanticElement();
- if (resolveSemanticElement != null) {
- GroupRequestAdvisor.getInstance().addListenner(resolveSemanticElement, this);
- }
- super.activate();
- }
-
- /**
- * {@inheritDoc IGroupNotifier#getGroupDescriptor()}
- */
- @Override
- public IContainerNodeDescriptor getHostGroupDescriptor() {
- return groupDescriptor;
- }
-
- /**
- * {@inheritDoc IGroupNotifier#getGroupRequestAdvisor()}
- */
- protected IGroupRequestAdvisor getGroupRequestAdvisor() {
- return GroupRequestAdvisor.getInstance();
- }
-
- /**
- * {@inheritDoc IGroupNotifier#getHostEditPart()}
- */
- @Override
- public IGraphicalEditPart getHostEditPart() {
- return (IGraphicalEditPart) getHost();
- }
-
- /**
- * {@inheritDoc IGroupNotifier#isIncludedIn()}
- */
- @Override
- public boolean isIncludedIn(Rectangle bounds) {
- Rectangle figureBounds = null;
- if (isMoving()) {
- figureBounds = Utils.getAbslotueRequestBounds(getMovingRequest(), getHostEditPart());
- } else {
- figureBounds = Utils.getAbsoluteBounds(getHostEditPart());
- }
- return bounds.contains(figureBounds);
- }
-
- /**
- * {@inheritDoc IGroupNotifier#includes()}
- */
- @Override
- public boolean includes(Rectangle bounds) {
- if (getHost() == null) {
- return false;
- }
- IGraphicalEditPart compartmentEditPart = getHostGroupDescriptor().getCompartmentPartFromView(getHostEditPart());
- if (compartmentEditPart != null) {
- Rectangle figureBounds = null;
- if (isMoving()) {
- figureBounds = Utils.getAbslotueRequestBounds(getMovingRequest(), compartmentEditPart);
- } else {
- figureBounds = Utils.getAbsoluteBounds(compartmentEditPart);
- }
- return figureBounds.contains(bounds);
- }
- return false;
- }
-
- /**
- * {@inheritDoc IAdaptable#getAdapter(Class)}
- */
- @Override
- public Object getAdapter(Class adapter) {
- if (IContainerNodeDescriptor.class.isAssignableFrom(adapter)) {
- return groupDescriptor;
- } else {
- return getHostEditPart().getAdapter(adapter);
- }
- }
-
- /**
- * {@inheritDoc Comparable#compareTo(Object)}
- */
- @Override
- public int compareTo(IGroupNotifier o) {
- return getHostGroupDescriptor().compareTo(o.getHostGroupDescriptor());
- }
-
- /**
- * {@inheritDoc IGroupNotifier#startMoving()}
- */
- @Override
- public void startMoving(ChangeBoundsRequest request) {
- setMoving(true);
- setMovingRequest(request);
- }
-
- /**
- * {@inheritDoc IGroupNotifier#stopMoving()}
- */
- @Override
- public void stopMoving() {
- setMoving(false);
- setMovingRequest(null);
- }
-
- /**
- * Get the moving parameter
- *
- * @return
- */
- protected boolean isMoving() {
- return isMoving;
- }
-
- protected ChangeBoundsRequest getMovingRequest() {
- return movingRequest;
- }
-
- protected void setMovingRequest(ChangeBoundsRequest movingRequest) {
- this.movingRequest = movingRequest;
- }
-
- protected void setMoving(boolean isMoving) {
- this.isMoving = isMoving;
- }
-
- /**
- * {@inheritDoc IGroupNotifier#isPartMoving()}
- */
- @Override
- public boolean isPartMoving() {
- return isMoving();
- }
-
- @Override
- public IAdaptable getAdaptableView() {
- return getViewAdapter();
- }
-
- @Override
- public void eraseTargetFeedback(Request request) {
- }
-
- @Override
- public void showSourceFeedback(Request request) {
- }
-
- @Override
- public IContainerNodeDescriptor getTargetGroupDescriptor(IAdaptable eObjectAdapter) {
- Object adapted = eObjectAdapter.getAdapter(EObject.class);
- if (adapted instanceof EObject) {
- EObject eObject = (EObject) adapted;
- return ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(eObject.eClass());
- }
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.ContainerNodeDescriptorRegistry;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.GroupRequestAdvisor;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IGroupRequestAdvisor;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.Utils;
+
+/**
+ * Edit policy use as based for Group Edit Policies
+ *
+ * @author arthur daussy
+ *
+ */
+public abstract class GroupListenerEditPolicy extends GraphicalNodeEditPolicy implements IGroupNotifier {
+
+ /**
+ * {@link IContainerNodeDescriptor} which describe the relation that the semantic element can handle
+ */
+ private IContainerNodeDescriptor groupDescriptor;
+
+ /**
+ * State of the part. Return true is the part is currently moving
+ */
+ private boolean isMoving = false;
+
+ /**
+ * Moving request
+ */
+ private ChangeBoundsRequest movingRequest;
+
+ /**
+ * Constructor
+ *
+ * @param groupDescriptor
+ * {@link IContainerNodeDescriptor} which describe the relation that the semantic element can handle
+ */
+ public GroupListenerEditPolicy(IContainerNodeDescriptor groupDescriptor) {
+ super();
+ this.groupDescriptor = groupDescriptor;
+ }
+
+ /**
+ * {@inheritDoc IGroupNotifier#getEObject()}
+ */
+ @Override
+ public EObject getEObject() {
+ EditPart editPart = getHost();
+ if (editPart instanceof IGraphicalEditPart) {
+ return ((IGraphicalEditPart) editPart).resolveSemanticElement();
+ }
+ return null;
+ }
+
+ /**
+ * Override to unregister this edit part from the group framework
+ */
+ @Override
+ public void deactivate() {
+ GroupRequestAdvisor.getInstance().removeListenner(this);
+ super.deactivate();
+ }
+
+ /**
+ * Override to register this edit part into the group framework
+ */
+ @Override
+ public void activate() {
+ EObject resolveSemanticElement = getHostEditPart().resolveSemanticElement();
+ if (resolveSemanticElement != null) {
+ GroupRequestAdvisor.getInstance().addListenner(resolveSemanticElement, this);
+ }
+ super.activate();
+ }
+
+ /**
+ * {@inheritDoc IGroupNotifier#getGroupDescriptor()}
+ */
+ @Override
+ public IContainerNodeDescriptor getHostGroupDescriptor() {
+ return groupDescriptor;
+ }
+
+ /**
+ * {@inheritDoc IGroupNotifier#getGroupRequestAdvisor()}
+ */
+ protected IGroupRequestAdvisor getGroupRequestAdvisor() {
+ return GroupRequestAdvisor.getInstance();
+ }
+
+ /**
+ * {@inheritDoc IGroupNotifier#getHostEditPart()}
+ */
+ @Override
+ public IGraphicalEditPart getHostEditPart() {
+ return (IGraphicalEditPart) getHost();
+ }
+
+ /**
+ * {@inheritDoc IGroupNotifier#isIncludedIn()}
+ */
+ @Override
+ public boolean isIncludedIn(Rectangle bounds) {
+ Rectangle figureBounds = null;
+ if (isMoving()) {
+ figureBounds = Utils.getAbslotueRequestBounds(getMovingRequest(), getHostEditPart());
+ } else {
+ figureBounds = Utils.getAbsoluteBounds(getHostEditPart());
+ }
+ return bounds.contains(figureBounds);
+ }
+
+ /**
+ * {@inheritDoc IGroupNotifier#includes()}
+ */
+ @Override
+ public boolean includes(Rectangle bounds) {
+ if (getHost() == null) {
+ return false;
+ }
+ IGraphicalEditPart compartmentEditPart = getHostGroupDescriptor().getCompartmentPartFromView(getHostEditPart());
+ if (compartmentEditPart != null) {
+ Rectangle figureBounds = null;
+ if (isMoving()) {
+ figureBounds = Utils.getAbslotueRequestBounds(getMovingRequest(), compartmentEditPart);
+ } else {
+ figureBounds = Utils.getAbsoluteBounds(compartmentEditPart);
+ }
+ return figureBounds.contains(bounds);
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc IAdaptable#getAdapter(Class)}
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (IContainerNodeDescriptor.class.isAssignableFrom(adapter)) {
+ return groupDescriptor;
+ } else {
+ return getHostEditPart().getAdapter(adapter);
+ }
+ }
+
+ /**
+ * {@inheritDoc Comparable#compareTo(Object)}
+ */
+ @Override
+ public int compareTo(IGroupNotifier o) {
+ return getHostGroupDescriptor().compareTo(o.getHostGroupDescriptor());
+ }
+
+ /**
+ * {@inheritDoc IGroupNotifier#startMoving()}
+ */
+ @Override
+ public void startMoving(ChangeBoundsRequest request) {
+ setMoving(true);
+ setMovingRequest(request);
+ }
+
+ /**
+ * {@inheritDoc IGroupNotifier#stopMoving()}
+ */
+ @Override
+ public void stopMoving() {
+ setMoving(false);
+ setMovingRequest(null);
+ }
+
+ /**
+ * Get the moving parameter
+ *
+ * @return
+ */
+ protected boolean isMoving() {
+ return isMoving;
+ }
+
+ protected ChangeBoundsRequest getMovingRequest() {
+ return movingRequest;
+ }
+
+ protected void setMovingRequest(ChangeBoundsRequest movingRequest) {
+ this.movingRequest = movingRequest;
+ }
+
+ protected void setMoving(boolean isMoving) {
+ this.isMoving = isMoving;
+ }
+
+ /**
+ * {@inheritDoc IGroupNotifier#isPartMoving()}
+ */
+ @Override
+ public boolean isPartMoving() {
+ return isMoving();
+ }
+
+ @Override
+ public IAdaptable getAdaptableView() {
+ return getViewAdapter();
+ }
+
+ @Override
+ public void eraseTargetFeedback(Request request) {
+ }
+
+ @Override
+ public void showSourceFeedback(Request request) {
+ }
+
+ @Override
+ public IContainerNodeDescriptor getTargetGroupDescriptor(IAdaptable eObjectAdapter) {
+ Object adapted = eObjectAdapter.getAdapter(EObject.class);
+ if (adapted instanceof EObject) {
+ EObject eObject = (EObject) adapted;
+ return ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(eObject.eClass());
+ }
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/GroupNotifyingInCreationEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/GroupNotifyingInCreationEditPolicy.java
index 76069fddc96..c36fe23648f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/GroupNotifyingInCreationEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/GroupNotifyingInCreationEditPolicy.java
@@ -1,152 +1,152 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers;
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.command.CompoundCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.internal.commands.RefreshEditPartCommand;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.commands.wrappers.EMFtoGEFCommandWrapper;
-import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.ContainerNodeDescriptorRegistry;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.GroupRequestAdvisor;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IGroupRequestAdvisor;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Policy which catch creation event in order to integrated it into the group framework
- *
- * @author arthur daussy
- *
- */
-public class GroupNotifyingInCreationEditPolicy extends GroupListenerEditPolicy {
-
- private static String FAKE_MOVE_COMMAND_TYPE = "FAKE_MOVE_COMMAND_TYPE";
-
- public GroupNotifyingInCreationEditPolicy(IContainerNodeDescriptor groupDescriptor) {
- super(groupDescriptor);
- }
-
- @Override
- public Command getCommand(Request request) {
- if (request instanceof CreateViewRequest) {
- final CreateViewRequest c = (CreateViewRequest) request;
- return new EMFtoGEFCommandWrapper(new DeferredFakeMoveCommand(getHostEditPart().getEditingDomain(), "Fake move command to integrate into group framework", c, getHost().getViewer().getEditPartRegistry()));
- }
- return null;
- }
-
- /**
- * Fake move command with a special type which will simulate a change bounds request in the newly create element in order to integrate it in te
- * group framework
- *
- * @author arthur daussy
- *
- */
- private class DeferredFakeMoveCommand extends CompoundCommand {
-
- /**
- * Initial Create View Request
- */
- private CreateViewRequest request;
-
- /**
- * Edit part registry
- */
- private Map editPartRegistry;
-
- /**
- * Special the for the fake move command
- */
- public DeferredFakeMoveCommand(TransactionalEditingDomain domain, String label, CreateViewRequest request, Map editPartRegistry) {
- super(label);
- this.request = request;
- this.editPartRegistry = editPartRegistry;
- }
-
- @Override
- public boolean canExecute() {
- return true;
- }
-
- @Override
- public void execute() {
- Object newObject = request.getNewObject();
- /*
- * Try to get the newly created view
- */
- if (newObject instanceof List<?> && !((List<?>) newObject).isEmpty()) {
- Object newObj = ((List<?>) newObject).get(0);
- if (newObj instanceof IAdaptable) {
- IAdaptable adpatable = (IAdaptable) newObj;
- Object v = adpatable.getAdapter(View.class);
- if (v instanceof View) {
- View view = (View) v;
- /*
- * Try to get the related editpart
- */
- Object editPart = editPartRegistry.get(view);
- if (editPart instanceof IGraphicalEditPart) {
- /*
- * Send a fake change bounds request
- */
- IGraphicalEditPart graphEdit = (IGraphicalEditPart) editPart;
- IGraphicalEditPart compartmentEditPart = ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(UMLPackage.Literals.ACTIVITY_PARTITION).getCompartmentPartFromView(graphEdit);
- if (compartmentEditPart != null) {
- RefreshEditPartCommand refreshCommand = new RefreshEditPartCommand(compartmentEditPart, true);
- if (refreshCommand.canExecute()) {
- appendAndExecute(new GMFtoEMFCommandWrapper(refreshCommand));
- }
- }
- ChangeBoundsRequest changeBoundRequest = new ChangeBoundsRequest(FAKE_MOVE_COMMAND_TYPE);
- changeBoundRequest.setEditParts(graphEdit);
- Command fakeMoveCommand = graphEdit.getCommand(changeBoundRequest);
- if (fakeMoveCommand != null && fakeMoveCommand.canExecute()) {
- appendAndExecute(new GEFtoEMFCommandWrapper(fakeMoveCommand));
- }
- }
- }
- }
- }
- }
- }
-
- @Override
- protected IGroupRequestAdvisor getGroupRequestAdvisor() {
- return GroupRequestAdvisor.getInstance();
- }
-
- /**
- * Override in order to accept correct request
- */
- @Override
- public boolean understandsRequest(Request req) {
- if (req instanceof ChangeBoundsRequest) {
- return true;
- }
- return false;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers;
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.internal.commands.RefreshEditPartCommand;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.commands.wrappers.EMFtoGEFCommandWrapper;
+import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.ContainerNodeDescriptorRegistry;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.GroupRequestAdvisor;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IGroupRequestAdvisor;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Policy which catch creation event in order to integrated it into the group framework
+ *
+ * @author arthur daussy
+ *
+ */
+public class GroupNotifyingInCreationEditPolicy extends GroupListenerEditPolicy {
+
+ private static String FAKE_MOVE_COMMAND_TYPE = "FAKE_MOVE_COMMAND_TYPE";
+
+ public GroupNotifyingInCreationEditPolicy(IContainerNodeDescriptor groupDescriptor) {
+ super(groupDescriptor);
+ }
+
+ @Override
+ public Command getCommand(Request request) {
+ if (request instanceof CreateViewRequest) {
+ final CreateViewRequest c = (CreateViewRequest) request;
+ return new EMFtoGEFCommandWrapper(new DeferredFakeMoveCommand(getHostEditPart().getEditingDomain(), "Fake move command to integrate into group framework", c, getHost().getViewer().getEditPartRegistry()));
+ }
+ return null;
+ }
+
+ /**
+ * Fake move command with a special type which will simulate a change bounds request in the newly create element in order to integrate it in te
+ * group framework
+ *
+ * @author arthur daussy
+ *
+ */
+ private class DeferredFakeMoveCommand extends CompoundCommand {
+
+ /**
+ * Initial Create View Request
+ */
+ private CreateViewRequest request;
+
+ /**
+ * Edit part registry
+ */
+ private Map editPartRegistry;
+
+ /**
+ * Special the for the fake move command
+ */
+ public DeferredFakeMoveCommand(TransactionalEditingDomain domain, String label, CreateViewRequest request, Map editPartRegistry) {
+ super(label);
+ this.request = request;
+ this.editPartRegistry = editPartRegistry;
+ }
+
+ @Override
+ public boolean canExecute() {
+ return true;
+ }
+
+ @Override
+ public void execute() {
+ Object newObject = request.getNewObject();
+ /*
+ * Try to get the newly created view
+ */
+ if (newObject instanceof List<?> && !((List<?>) newObject).isEmpty()) {
+ Object newObj = ((List<?>) newObject).get(0);
+ if (newObj instanceof IAdaptable) {
+ IAdaptable adpatable = (IAdaptable) newObj;
+ Object v = adpatable.getAdapter(View.class);
+ if (v instanceof View) {
+ View view = (View) v;
+ /*
+ * Try to get the related editpart
+ */
+ Object editPart = editPartRegistry.get(view);
+ if (editPart instanceof IGraphicalEditPart) {
+ /*
+ * Send a fake change bounds request
+ */
+ IGraphicalEditPart graphEdit = (IGraphicalEditPart) editPart;
+ IGraphicalEditPart compartmentEditPart = ContainerNodeDescriptorRegistry.getInstance().getContainerNodeDescriptor(UMLPackage.Literals.ACTIVITY_PARTITION).getCompartmentPartFromView(graphEdit);
+ if (compartmentEditPart != null) {
+ RefreshEditPartCommand refreshCommand = new RefreshEditPartCommand(compartmentEditPart, true);
+ if (refreshCommand.canExecute()) {
+ appendAndExecute(new GMFtoEMFCommandWrapper(refreshCommand));
+ }
+ }
+ ChangeBoundsRequest changeBoundRequest = new ChangeBoundsRequest(FAKE_MOVE_COMMAND_TYPE);
+ changeBoundRequest.setEditParts(graphEdit);
+ Command fakeMoveCommand = graphEdit.getCommand(changeBoundRequest);
+ if (fakeMoveCommand != null && fakeMoveCommand.canExecute()) {
+ appendAndExecute(new GEFtoEMFCommandWrapper(fakeMoveCommand));
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ protected IGroupRequestAdvisor getGroupRequestAdvisor() {
+ return GroupRequestAdvisor.getInstance();
+ }
+
+ /**
+ * Override in order to accept correct request
+ */
+ @Override
+ public boolean understandsRequest(Request req) {
+ if (req instanceof ChangeBoundsRequest) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/GroupNotifyingOnMoveEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/GroupNotifyingOnMoveEditPolicy.java
index e7b51f14f55..735cb7f9e97 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/GroupNotifyingOnMoveEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/GroupNotifyingOnMoveEditPolicy.java
@@ -1,148 +1,148 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.GroupRequestAdvisor;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IGroupEditPolicies;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IGroupRequestAdvisor;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.AbstractGroupRequest;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.DebugUtils;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.Utils;
-
-/**
- * Implementation of {@link GroupListenerEditPolicy} for Activity Group
- *
- * @author adaussy
- *
- */
-public class GroupNotifyingOnMoveEditPolicy extends GroupListenerEditPolicy {
-
- public GroupNotifyingOnMoveEditPolicy(IContainerNodeDescriptor groupDescriptor) {
- super(groupDescriptor);
- }
-
- /**
- * Override to :
- * -> Put in "Movin state" this edit part and all its children which are Group Framework concern
- */
- @Override
- public Command getCommand(Request request) {
- if (request instanceof ChangeBoundsRequest) {
- final ChangeBoundsRequest req = (ChangeBoundsRequest) request;
- CompositeCommand cc = new CompositeCommand("GroupNotifyingEditPolicy ");
- for (final EditPart part : Utils.getTargetedEditPart(req)) {
- ICommand cmd = getGroupRequestAdvisor().notifyGroupFramework(new AbstractGroupRequest((IGraphicalEditPart) getHost(), Utils.getChangeBoundsRequestCopy(req, part), part, getTargetGroupDescriptor(part)) {
-
- @Override
- public GroupRequestType getGroupRequestType() {
- return GroupRequestType.MOVE;
- }
- });
- if (cmd != null && cmd.canExecute()) {
- cc.compose(cmd);
- }
- }
- stopMovingPartState(req);
- if (cc != null && cc.canExecute()) {
- return new ICommandProxy(cc);
- }
- }
- return null;
- }
-
- /**
- * Set the art concern by the request to "Moving state" {@link IGroupNotifier#isPartMoving()}
- *
- * @param req
- */
- public void stopMovingPartState(final ChangeBoundsRequest req) {
- Iterable<IGraphicalEditPart> targetedEditPart = Utils.getTargetedEditPart(req);
- stopMovingParts(targetedEditPart);
- }
-
- /**
- * Set all part specify and its descendant to "Moving State"
- *
- * @param targetedEditPart
- */
- protected void stopMovingParts(Iterable<IGraphicalEditPart> targetedEditPart) {
- if (targetedEditPart != null) {
- for (EditPart part : targetedEditPart) {
- EditPolicy editPolicy = part.getEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY);
- if (editPolicy instanceof GroupNotifyingOnMoveEditPolicy) {
- GroupNotifyingOnMoveEditPolicy editPolicy2 = (GroupNotifyingOnMoveEditPolicy) editPolicy;
- if (DebugUtils.isDebugging()) {
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append(Utils.getCorrectLabel(editPolicy2.getEObject()));
- stringBuilder.append(" is stoping to move");
- DebugUtils.getLog().debug(stringBuilder.toString());
- }
- editPolicy2.stopMoving();
- }
- stopMovingParts(part.getChildren());
- }
- }
- }
-
- public void initMovingPartState(final ChangeBoundsRequest req) {
- Iterable<IGraphicalEditPart> targetedEditPart = Utils.getTargetedEditPart(req);
- startMovingParts(req, targetedEditPart);
- }
-
- protected void startMovingParts(final ChangeBoundsRequest req, Iterable<IGraphicalEditPart> targetedEditPart) {
- if (targetedEditPart != null) {
- for (final EditPart part : targetedEditPart) {
- EditPolicy editPolicy = part.getEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY);
- if (editPolicy instanceof GroupNotifyingOnMoveEditPolicy) {
- GroupNotifyingOnMoveEditPolicy editPolicy2 = (GroupNotifyingOnMoveEditPolicy) editPolicy;
- if (DebugUtils.isDebugging()) {
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append(Utils.getCorrectLabel(editPolicy2.getEObject()));
- stringBuilder.append(" is start to move");
- DebugUtils.getLog().debug(stringBuilder.toString());
- }
- editPolicy2.startMoving(req);
- }
- startMovingParts(req, part.getChildren());
- }
- }
- }
-
- @Override
- protected IGroupRequestAdvisor getGroupRequestAdvisor() {
- return GroupRequestAdvisor.getInstance();
- }
-
- /**
- * Override in order to accept correct request
- */
- @Override
- public boolean understandsRequest(Request req) {
- if (req instanceof ChangeBoundsRequest) {
- return true;
- }
- return false;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.GroupRequestAdvisor;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IGroupEditPolicies;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IGroupRequestAdvisor;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.AbstractGroupRequest;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.DebugUtils;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.Utils;
+
+/**
+ * Implementation of {@link GroupListenerEditPolicy} for Activity Group
+ *
+ * @author adaussy
+ *
+ */
+public class GroupNotifyingOnMoveEditPolicy extends GroupListenerEditPolicy {
+
+ public GroupNotifyingOnMoveEditPolicy(IContainerNodeDescriptor groupDescriptor) {
+ super(groupDescriptor);
+ }
+
+ /**
+ * Override to :
+ * -> Put in "Movin state" this edit part and all its children which are Group Framework concern
+ */
+ @Override
+ public Command getCommand(Request request) {
+ if (request instanceof ChangeBoundsRequest) {
+ final ChangeBoundsRequest req = (ChangeBoundsRequest) request;
+ CompositeCommand cc = new CompositeCommand("GroupNotifyingEditPolicy ");
+ for (final EditPart part : Utils.getTargetedEditPart(req)) {
+ ICommand cmd = getGroupRequestAdvisor().notifyGroupFramework(new AbstractGroupRequest((IGraphicalEditPart) getHost(), Utils.getChangeBoundsRequestCopy(req, part), part, getTargetGroupDescriptor(part)) {
+
+ @Override
+ public GroupRequestType getGroupRequestType() {
+ return GroupRequestType.MOVE;
+ }
+ });
+ if (cmd != null && cmd.canExecute()) {
+ cc.compose(cmd);
+ }
+ }
+ stopMovingPartState(req);
+ if (cc != null && cc.canExecute()) {
+ return new ICommandProxy(cc);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Set the art concern by the request to "Moving state" {@link IGroupNotifier#isPartMoving()}
+ *
+ * @param req
+ */
+ public void stopMovingPartState(final ChangeBoundsRequest req) {
+ Iterable<IGraphicalEditPart> targetedEditPart = Utils.getTargetedEditPart(req);
+ stopMovingParts(targetedEditPart);
+ }
+
+ /**
+ * Set all part specify and its descendant to "Moving State"
+ *
+ * @param targetedEditPart
+ */
+ protected void stopMovingParts(Iterable<IGraphicalEditPart> targetedEditPart) {
+ if (targetedEditPart != null) {
+ for (EditPart part : targetedEditPart) {
+ EditPolicy editPolicy = part.getEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY);
+ if (editPolicy instanceof GroupNotifyingOnMoveEditPolicy) {
+ GroupNotifyingOnMoveEditPolicy editPolicy2 = (GroupNotifyingOnMoveEditPolicy) editPolicy;
+ if (DebugUtils.isDebugging()) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append(Utils.getCorrectLabel(editPolicy2.getEObject()));
+ stringBuilder.append(" is stoping to move");
+ DebugUtils.getLog().debug(stringBuilder.toString());
+ }
+ editPolicy2.stopMoving();
+ }
+ stopMovingParts(part.getChildren());
+ }
+ }
+ }
+
+ public void initMovingPartState(final ChangeBoundsRequest req) {
+ Iterable<IGraphicalEditPart> targetedEditPart = Utils.getTargetedEditPart(req);
+ startMovingParts(req, targetedEditPart);
+ }
+
+ protected void startMovingParts(final ChangeBoundsRequest req, Iterable<IGraphicalEditPart> targetedEditPart) {
+ if (targetedEditPart != null) {
+ for (final EditPart part : targetedEditPart) {
+ EditPolicy editPolicy = part.getEditPolicy(IGroupEditPolicies.GROUP_FRAMEWORK_NOTIFYING_ON_MOVE_EDIT_POLICY);
+ if (editPolicy instanceof GroupNotifyingOnMoveEditPolicy) {
+ GroupNotifyingOnMoveEditPolicy editPolicy2 = (GroupNotifyingOnMoveEditPolicy) editPolicy;
+ if (DebugUtils.isDebugging()) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append(Utils.getCorrectLabel(editPolicy2.getEObject()));
+ stringBuilder.append(" is start to move");
+ DebugUtils.getLog().debug(stringBuilder.toString());
+ }
+ editPolicy2.startMoving(req);
+ }
+ startMovingParts(req, part.getChildren());
+ }
+ }
+ }
+
+ @Override
+ protected IGroupRequestAdvisor getGroupRequestAdvisor() {
+ return GroupRequestAdvisor.getInstance();
+ }
+
+ /**
+ * Override in order to accept correct request
+ */
+ @Override
+ public boolean understandsRequest(Request req) {
+ if (req instanceof ChangeBoundsRequest) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/IGroupNotifier.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/IGroupNotifier.java
index 3691022889d..9f94bff50d6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/IGroupNotifier.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/editpolicy/notifiers/IGroupNotifier.java
@@ -1,106 +1,106 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
-
-/**
- * This interface represent an element that can notify to the group framework some changes that may impact Activity groups
- *
- * @author arthur daussy
- *
- */
-public interface IGroupNotifier extends IAdaptable, EditPolicy, Comparable<IGroupNotifier> {
-
- /**
- * Get the {@link EObject} which is the notifier
- *
- * @return
- */
- public EObject getEObject();
-
- /**
- *
- * @return {@link IContainerNodeDescriptor} of the notifier
- */
- public abstract IContainerNodeDescriptor getHostGroupDescriptor();
-
- /**
- *
- * @return {@link IContainerNodeDescriptor} of the target
- */
- public abstract IContainerNodeDescriptor getTargetGroupDescriptor(IAdaptable eObjectAdapter);
-
- /**
- * Get the view of the notifier
- *
- * @return {@link IAdaptable} of the view of the element
- */
- public abstract IAdaptable getAdaptableView();
-
- /**
- * Get the {@link IGraphicalEditPart} host
- * (Sam as than getHost() but with GMF)
- *
- * @return
- */
- public IGraphicalEditPart getHostEditPart();
-
- /**
- * Return true if the element is included on the specified bounds
- * This method should take into account if the node is currently moving or not
- *
- * @param bounds
- * {@link Rectangle} in which the element is tested
- * @return
- */
- public boolean isIncludedIn(Rectangle bounds);
-
- /**
- * Return true if the specified bounds are included in the bounds of the element.
- * This method should take into account if the node is currently moving or not
- *
- * @param bounds
- * @return
- */
- public boolean includes(Rectangle bounds);
-
- /**
- * Notify edit policy that edit part start to move
- * This method represent a state of the edit part
- *
- * @param request
- */
- public void startMoving(ChangeBoundsRequest request);
-
- /**
- * Notify edit policy that edit part stop moving
- * This method represent a state of the edit part
- */
- public void stopMoving();
-
- /**
- * Return true if the part is moving
- *
- * @return
- */
- public boolean isPartMoving();
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
+
+/**
+ * This interface represent an element that can notify to the group framework some changes that may impact Activity groups
+ *
+ * @author arthur daussy
+ *
+ */
+public interface IGroupNotifier extends IAdaptable, EditPolicy, Comparable<IGroupNotifier> {
+
+ /**
+ * Get the {@link EObject} which is the notifier
+ *
+ * @return
+ */
+ public EObject getEObject();
+
+ /**
+ *
+ * @return {@link IContainerNodeDescriptor} of the notifier
+ */
+ public abstract IContainerNodeDescriptor getHostGroupDescriptor();
+
+ /**
+ *
+ * @return {@link IContainerNodeDescriptor} of the target
+ */
+ public abstract IContainerNodeDescriptor getTargetGroupDescriptor(IAdaptable eObjectAdapter);
+
+ /**
+ * Get the view of the notifier
+ *
+ * @return {@link IAdaptable} of the view of the element
+ */
+ public abstract IAdaptable getAdaptableView();
+
+ /**
+ * Get the {@link IGraphicalEditPart} host
+ * (Sam as than getHost() but with GMF)
+ *
+ * @return
+ */
+ public IGraphicalEditPart getHostEditPart();
+
+ /**
+ * Return true if the element is included on the specified bounds
+ * This method should take into account if the node is currently moving or not
+ *
+ * @param bounds
+ * {@link Rectangle} in which the element is tested
+ * @return
+ */
+ public boolean isIncludedIn(Rectangle bounds);
+
+ /**
+ * Return true if the specified bounds are included in the bounds of the element.
+ * This method should take into account if the node is currently moving or not
+ *
+ * @param bounds
+ * @return
+ */
+ public boolean includes(Rectangle bounds);
+
+ /**
+ * Notify edit policy that edit part start to move
+ * This method represent a state of the edit part
+ *
+ * @param request
+ */
+ public void startMoving(ChangeBoundsRequest request);
+
+ /**
+ * Notify edit policy that edit part stop moving
+ * This method represent a state of the edit part
+ */
+ public void stopMoving();
+
+ /**
+ * Return true if the part is moving
+ *
+ * @return
+ */
+ public boolean isPartMoving();
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/functions/FromIGroupNotifierToEObject.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/functions/FromIGroupNotifierToEObject.java
index 007e5673959..489e7ca5a6e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/functions/FromIGroupNotifierToEObject.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/functions/FromIGroupNotifierToEObject.java
@@ -1,60 +1,60 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.functions;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.IGroupNotifier;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-
-/**
- * Transform an IGroupNotifier to an EObject they reference
- *
- * @author adaussy
- *
- */
-public class FromIGroupNotifierToEObject implements Function<IGroupNotifier, EObject> {
-
- FromIGroupNotifierToEObject() {
- }
-
- /**
- * @author adaussy
- *
- */
- private static class SingletonHolder {
-
- public static final FromIGroupNotifierToEObject INSTANCE = new FromIGroupNotifierToEObject();
- }
-
- /**
- * Get the singleton object
- *
- * @return
- */
- public static FromIGroupNotifierToEObject getInstance() {
- return SingletonHolder.INSTANCE;
- }
-
- public static Iterable<EObject> transform(Iterable<IGroupNotifier> from) {
- return Iterables.transform(from, FromIGroupNotifierToEObject.getInstance());
- }
-
- @Override
- public EObject apply(IGroupNotifier from) {
- return from.getEObject();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.functions;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.IGroupNotifier;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
+
+/**
+ * Transform an IGroupNotifier to an EObject they reference
+ *
+ * @author adaussy
+ *
+ */
+public class FromIGroupNotifierToEObject implements Function<IGroupNotifier, EObject> {
+
+ FromIGroupNotifierToEObject() {
+ }
+
+ /**
+ * @author adaussy
+ *
+ */
+ private static class SingletonHolder {
+
+ public static final FromIGroupNotifierToEObject INSTANCE = new FromIGroupNotifierToEObject();
+ }
+
+ /**
+ * Get the singleton object
+ *
+ * @return
+ */
+ public static FromIGroupNotifierToEObject getInstance() {
+ return SingletonHolder.INSTANCE;
+ }
+
+ public static Iterable<EObject> transform(Iterable<IGroupNotifier> from) {
+ return Iterables.transform(from, FromIGroupNotifierToEObject.getInstance());
+ }
+
+ @Override
+ public EObject apply(IGroupNotifier from) {
+ return from.getEObject();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ActivityContainment.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ActivityContainment.java
index df4c42e378f..93770d9c205 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ActivityContainment.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ActivityContainment.java
@@ -1,108 +1,108 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor;
-import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityActivityContentCompartmentEditPart;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Node descriptor for an activity
- *
- * @author adaussy
- *
- */
-public class ActivityContainment extends AbstractContainerNodeDescriptor {
-
- private List<EReference> parentReferences;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getContainerEClass()
- */
- @Override
- public EClass getContainerEClass() {
- return UMLPackage.Literals.ACTIVITY;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getChildrenReferences()
- */
- @Override
- public List<EReference> getChildrenReferences() {
- if (parentReferences == null) {
- parentReferences = new ArrayList<EReference>();
- parentReferences.add(UMLPackage.Literals.ACTIVITY__OWNED_NODE);
- parentReferences.add(UMLPackage.Literals.ACTIVITY__OWNED_GROUP);
- }
- return parentReferences;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getParentReferences()
- */
- @Override
- public List<EReference> getParentReferences() {
- return Collections.emptyList();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getCompartmentPartFromView(org.eclipse.gmf.runtime.diagram
- * .ui.editparts.IGraphicalEditPart)
- */
- @Override
- public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
- String hint = "" + ActivityActivityContentCompartmentEditPart.VISUAL_ID;
- return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor#getGroupPriority()
- */
- @Override
- public int getGroupPriority() {
- return IGroupPriority.ACTIVITY_PRIORITY;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getParentEOppositeReferences()
- */
- @Override
- public Map<EStructuralFeature, EStructuralFeature> getParentEOppositeReferences() {
- return Collections.emptyMap();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityActivityContentCompartmentEditPart;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Node descriptor for an activity
+ *
+ * @author adaussy
+ *
+ */
+public class ActivityContainment extends AbstractContainerNodeDescriptor {
+
+ private List<EReference> parentReferences;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getContainerEClass()
+ */
+ @Override
+ public EClass getContainerEClass() {
+ return UMLPackage.Literals.ACTIVITY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getChildrenReferences()
+ */
+ @Override
+ public List<EReference> getChildrenReferences() {
+ if (parentReferences == null) {
+ parentReferences = new ArrayList<EReference>();
+ parentReferences.add(UMLPackage.Literals.ACTIVITY__OWNED_NODE);
+ parentReferences.add(UMLPackage.Literals.ACTIVITY__OWNED_GROUP);
+ }
+ return parentReferences;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getParentReferences()
+ */
+ @Override
+ public List<EReference> getParentReferences() {
+ return Collections.emptyList();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getCompartmentPartFromView(org.eclipse.gmf.runtime.diagram
+ * .ui.editparts.IGraphicalEditPart)
+ */
+ @Override
+ public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
+ String hint = "" + ActivityActivityContentCompartmentEditPart.VISUAL_ID;
+ return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor#getGroupPriority()
+ */
+ @Override
+ public int getGroupPriority() {
+ return IGroupPriority.ACTIVITY_PRIORITY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getParentEOppositeReferences()
+ */
+ @Override
+ public Map<EStructuralFeature, EStructuralFeature> getParentEOppositeReferences() {
+ return Collections.emptyMap();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ActivityNodeContainment.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ActivityNodeContainment.java
index 35ab145f939..20bc907ce24 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ActivityNodeContainment.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ActivityNodeContainment.java
@@ -1,115 +1,115 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Descriptor for an Activity Node
- *
- * @author adaussy
- *
- */
-public class ActivityNodeContainment extends AbstractContainerNodeDescriptor {
-
- private List<EReference> parentReferences;
-
- private Map<EStructuralFeature, EStructuralFeature> parentOpositeReferences;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getContainerEClass()
- */
- @Override
- public EClass getContainerEClass() {
- return UMLPackage.Literals.ACTIVITY_NODE;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getChildrenReferences()
- */
- @Override
- public List<EReference> getChildrenReferences() {
- return Collections.emptyList();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getParentReferences()
- */
- @Override
- public List<EReference> getParentReferences() {
- if (parentReferences == null) {
- parentReferences = new ArrayList<EReference>();
- parentReferences.add(UMLPackage.Literals.ACTIVITY_NODE__IN_STRUCTURED_NODE);
- parentReferences.add(UMLPackage.Literals.ACTIVITY_NODE__ACTIVITY);
- }
- return parentReferences;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getParentEOppositeReferences()
- */
- @Override
- public Map<EStructuralFeature, EStructuralFeature> getParentEOppositeReferences() {
- if (parentOpositeReferences == null) {
- parentOpositeReferences = new HashMap<EStructuralFeature, EStructuralFeature>();
- parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__IN_INTERRUPTIBLE_REGION, UMLPackage.Literals.INTERRUPTIBLE_ACTIVITY_REGION__NODE);
- parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__IN_PARTITION, UMLPackage.Literals.ACTIVITY_PARTITION__NODE);
- parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__IN_STRUCTURED_NODE, UMLPackage.Literals.STRUCTURED_ACTIVITY_NODE__NODE);
- parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__ACTIVITY, UMLPackage.Literals.ACTIVITY__OWNED_NODE);
- }
- return parentOpositeReferences;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getCompartmentPartFromView(org.eclipse.gmf.runtime.diagram
- * .ui.editparts.IGraphicalEditPart)
- */
- @Override
- public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
- return null;// no compartment for activity node
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor#getGroupPriority()
- */
- @Override
- public int getGroupPriority() {
- return IGroupPriority.ACTIVITY_NODE_PRIORITY;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Descriptor for an Activity Node
+ *
+ * @author adaussy
+ *
+ */
+public class ActivityNodeContainment extends AbstractContainerNodeDescriptor {
+
+ private List<EReference> parentReferences;
+
+ private Map<EStructuralFeature, EStructuralFeature> parentOpositeReferences;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getContainerEClass()
+ */
+ @Override
+ public EClass getContainerEClass() {
+ return UMLPackage.Literals.ACTIVITY_NODE;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getChildrenReferences()
+ */
+ @Override
+ public List<EReference> getChildrenReferences() {
+ return Collections.emptyList();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getParentReferences()
+ */
+ @Override
+ public List<EReference> getParentReferences() {
+ if (parentReferences == null) {
+ parentReferences = new ArrayList<EReference>();
+ parentReferences.add(UMLPackage.Literals.ACTIVITY_NODE__IN_STRUCTURED_NODE);
+ parentReferences.add(UMLPackage.Literals.ACTIVITY_NODE__ACTIVITY);
+ }
+ return parentReferences;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getParentEOppositeReferences()
+ */
+ @Override
+ public Map<EStructuralFeature, EStructuralFeature> getParentEOppositeReferences() {
+ if (parentOpositeReferences == null) {
+ parentOpositeReferences = new HashMap<EStructuralFeature, EStructuralFeature>();
+ parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__IN_INTERRUPTIBLE_REGION, UMLPackage.Literals.INTERRUPTIBLE_ACTIVITY_REGION__NODE);
+ parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__IN_PARTITION, UMLPackage.Literals.ACTIVITY_PARTITION__NODE);
+ parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__IN_STRUCTURED_NODE, UMLPackage.Literals.STRUCTURED_ACTIVITY_NODE__NODE);
+ parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__ACTIVITY, UMLPackage.Literals.ACTIVITY__OWNED_NODE);
+ }
+ return parentOpositeReferences;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor#getCompartmentPartFromView(org.eclipse.gmf.runtime.diagram
+ * .ui.editparts.IGraphicalEditPart)
+ */
+ @Override
+ public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
+ return null;// no compartment for activity node
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor#getGroupPriority()
+ */
+ @Override
+ public int getGroupPriority() {
+ return IGroupPriority.ACTIVITY_NODE_PRIORITY;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ActivityPartitionContainment.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ActivityPartitionContainment.java
index 5e0f8577fb9..648d770eeec 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ActivityPartitionContainment.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ActivityPartitionContainment.java
@@ -1,97 +1,97 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor;
-import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityPartitionActivityPartitionContentCompartmentEditPart;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * The descriptor for ActivityPartition node used by
- * org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension point.
- *
- * @author vhemery
- */
-public class ActivityPartitionContainment extends AbstractContainerNodeDescriptor {
-
- private List<EReference> parentReferences;
-
- private Map<EStructuralFeature, EStructuralFeature> parentOpositeReferences;
-
- /**
- * Get the eclass of the model eobject represented by the node
- *
- * @return ActivityPartition eclass
- */
- @Override
- public EClass getContainerEClass() {
- return UMLPackage.eINSTANCE.getActivityPartition();
- }
-
- /**
- * Get the list of references linking the ActivityPartition to children
- * element.
- *
- * @return the references to contained elements
- */
- @Override
- public List<EReference> getChildrenReferences() {
- List<EReference> references = new ArrayList<EReference>(3);
- references.add(UMLPackage.eINSTANCE.getActivityPartition_Subpartition());
- references.add(UMLPackage.eINSTANCE.getElement_OwnedComment());
- return references;
- }
-
- @Override
- public List<EReference> getParentReferences() {
- if (parentReferences == null) {
- parentReferences = new ArrayList<EReference>();
- parentReferences.add(UMLPackage.Literals.ACTIVITY_PARTITION__SUPER_PARTITION);
- parentReferences.add(UMLPackage.Literals.ACTIVITY_GROUP__IN_ACTIVITY);
- }
- return parentReferences;
- }
-
- @Override
- public Map<EStructuralFeature, EStructuralFeature> getParentEOppositeReferences() {
- if (parentOpositeReferences == null) {
- parentOpositeReferences = new HashMap<EStructuralFeature, EStructuralFeature>();
- parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_PARTITION__SUPER_PARTITION, UMLPackage.Literals.ACTIVITY_PARTITION__SUBPARTITION);
- parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_GROUP__IN_ACTIVITY, UMLPackage.Literals.ACTIVITY__OWNED_GROUP);
- }
- return parentOpositeReferences;
- }
-
- @Override
- public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
- String hint = "" + ActivityPartitionActivityPartitionContentCompartmentEditPart.VISUAL_ID;
- return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
- }
-
- @Override
- public int getGroupPriority() {
- return IGroupPriority.ACTIVITY_PARTITION_PRIORITY;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityPartitionActivityPartitionContentCompartmentEditPart;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * The descriptor for ActivityPartition node used by
+ * org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension point.
+ *
+ * @author vhemery
+ */
+public class ActivityPartitionContainment extends AbstractContainerNodeDescriptor {
+
+ private List<EReference> parentReferences;
+
+ private Map<EStructuralFeature, EStructuralFeature> parentOpositeReferences;
+
+ /**
+ * Get the eclass of the model eobject represented by the node
+ *
+ * @return ActivityPartition eclass
+ */
+ @Override
+ public EClass getContainerEClass() {
+ return UMLPackage.eINSTANCE.getActivityPartition();
+ }
+
+ /**
+ * Get the list of references linking the ActivityPartition to children
+ * element.
+ *
+ * @return the references to contained elements
+ */
+ @Override
+ public List<EReference> getChildrenReferences() {
+ List<EReference> references = new ArrayList<EReference>(3);
+ references.add(UMLPackage.eINSTANCE.getActivityPartition_Subpartition());
+ references.add(UMLPackage.eINSTANCE.getElement_OwnedComment());
+ return references;
+ }
+
+ @Override
+ public List<EReference> getParentReferences() {
+ if (parentReferences == null) {
+ parentReferences = new ArrayList<EReference>();
+ parentReferences.add(UMLPackage.Literals.ACTIVITY_PARTITION__SUPER_PARTITION);
+ parentReferences.add(UMLPackage.Literals.ACTIVITY_GROUP__IN_ACTIVITY);
+ }
+ return parentReferences;
+ }
+
+ @Override
+ public Map<EStructuralFeature, EStructuralFeature> getParentEOppositeReferences() {
+ if (parentOpositeReferences == null) {
+ parentOpositeReferences = new HashMap<EStructuralFeature, EStructuralFeature>();
+ parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_PARTITION__SUPER_PARTITION, UMLPackage.Literals.ACTIVITY_PARTITION__SUBPARTITION);
+ parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_GROUP__IN_ACTIVITY, UMLPackage.Literals.ACTIVITY__OWNED_GROUP);
+ }
+ return parentOpositeReferences;
+ }
+
+ @Override
+ public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
+ String hint = "" + ActivityPartitionActivityPartitionContentCompartmentEditPart.VISUAL_ID;
+ return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
+ }
+
+ @Override
+ public int getGroupPriority() {
+ return IGroupPriority.ACTIVITY_PARTITION_PRIORITY;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ConditionalNodeContainment.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ConditionalNodeContainment.java
index 252e164d661..82adcebcad8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ConditionalNodeContainment.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ConditionalNodeContainment.java
@@ -1,45 +1,45 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ConditionalNodeStructuredActivityNodeContentCompartmentEditPart;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * The descriptor for ConditionalNode node used by
- * org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension point.
- *
- * @author vhemery
- */
-public class ConditionalNodeContainment extends StructuredActivityNodeContainment {
-
- /**
- * Get the eclass of the model eobject represented by the node
- *
- * @return ConditionalNode eclass
- */
- @Override
- public EClass getContainerEClass() {
- return UMLPackage.eINSTANCE.getConditionalNode();
- }
-
- @Override
- public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
- String hint = "" + ConditionalNodeStructuredActivityNodeContentCompartmentEditPart.VISUAL_ID;
- return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ConditionalNodeStructuredActivityNodeContentCompartmentEditPart;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * The descriptor for ConditionalNode node used by
+ * org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension point.
+ *
+ * @author vhemery
+ */
+public class ConditionalNodeContainment extends StructuredActivityNodeContainment {
+
+ /**
+ * Get the eclass of the model eobject represented by the node
+ *
+ * @return ConditionalNode eclass
+ */
+ @Override
+ public EClass getContainerEClass() {
+ return UMLPackage.eINSTANCE.getConditionalNode();
+ }
+
+ @Override
+ public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
+ String hint = "" + ConditionalNodeStructuredActivityNodeContentCompartmentEditPart.VISUAL_ID;
+ return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ExpansionRegionContainment.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ExpansionRegionContainment.java
index b348b9f6204..98d340da5fb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ExpansionRegionContainment.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/ExpansionRegionContainment.java
@@ -1,45 +1,45 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ExpansionRegionStructuredActivityNodeContentCompartmentEditPart;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * The descriptor for ExpansionRegion node used by
- * org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension point.
- *
- * @author vhemery
- */
-public class ExpansionRegionContainment extends StructuredActivityNodeContainment {
-
- /**
- * Get the eclass of the model eobject represented by the node
- *
- * @return ExpansionRegion eclass
- */
- @Override
- public EClass getContainerEClass() {
- return UMLPackage.eINSTANCE.getExpansionRegion();
- }
-
- @Override
- public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
- String hint = "" + ExpansionRegionStructuredActivityNodeContentCompartmentEditPart.VISUAL_ID;
- return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ExpansionRegionStructuredActivityNodeContentCompartmentEditPart;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * The descriptor for ExpansionRegion node used by
+ * org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension point.
+ *
+ * @author vhemery
+ */
+public class ExpansionRegionContainment extends StructuredActivityNodeContainment {
+
+ /**
+ * Get the eclass of the model eobject represented by the node
+ *
+ * @return ExpansionRegion eclass
+ */
+ @Override
+ public EClass getContainerEClass() {
+ return UMLPackage.eINSTANCE.getExpansionRegion();
+ }
+
+ @Override
+ public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
+ String hint = "" + ExpansionRegionStructuredActivityNodeContentCompartmentEditPart.VISUAL_ID;
+ return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/IGroupPriority.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/IGroupPriority.java
index 12896eda882..3134101ba52 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/IGroupPriority.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/IGroupPriority.java
@@ -1,34 +1,34 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
-
-/**
- * Define the priority of groups to be a graphicla parent of a child
- *
- * @author adaussy
- *
- */
-public interface IGroupPriority {
-
- public static int STRUCTURED_ACTIVITY_NODE_PRIORITY = 100;
-
- public static int ACTIVITY_PARTITION_PRIORITY = 90;
-
- public static int INTERRUPTIBLE_REGION_PRIORITY = 80;
-
- public static int ACTIVITY_PRIORITY = 50;
-
- public static int ACTIVITY_NODE_PRIORITY = -1;
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
+
+/**
+ * Define the priority of groups to be a graphicla parent of a child
+ *
+ * @author adaussy
+ *
+ */
+public interface IGroupPriority {
+
+ public static int STRUCTURED_ACTIVITY_NODE_PRIORITY = 100;
+
+ public static int ACTIVITY_PARTITION_PRIORITY = 90;
+
+ public static int INTERRUPTIBLE_REGION_PRIORITY = 80;
+
+ public static int ACTIVITY_PRIORITY = 50;
+
+ public static int ACTIVITY_NODE_PRIORITY = -1;
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/InterruptibleActivityRegionContainment.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/InterruptibleActivityRegionContainment.java
index 9515f31924d..84005d1bc4c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/InterruptibleActivityRegionContainment.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/InterruptibleActivityRegionContainment.java
@@ -1,85 +1,85 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor;
-import org.eclipse.papyrus.uml.diagram.activity.edit.parts.InterruptibleActivityRegionInterruptibleActivityRegionContentCompartmentEditPart;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * The descriptor for InterruptibleActivityRegion node used by
- * org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension point.
- *
- * @author vhemery
- */
-public class InterruptibleActivityRegionContainment extends AbstractContainerNodeDescriptor {
-
- private Map<EStructuralFeature, EStructuralFeature> parentOpositeReferences;
-
- /**
- * Get the eclass of the model eobject represented by the node
- *
- * @return InterruptibleActivityRegion eclass
- */
- @Override
- public EClass getContainerEClass() {
- return UMLPackage.eINSTANCE.getInterruptibleActivityRegion();
- }
-
- /**
- * Get the list of references linking the InterruptibleActivityRegion to
- * children element.
- *
- * @return the references to contained elements
- */
- @Override
- public List<EReference> getChildrenReferences() {
- return Collections.emptyList();
- }
-
- @Override
- public List<EReference> getParentReferences() {
- return Collections.singletonList(UMLPackage.Literals.ACTIVITY_GROUP__IN_ACTIVITY);
- }
-
- @Override
- public Map<EStructuralFeature, EStructuralFeature> getParentEOppositeReferences() {
- if (parentOpositeReferences == null) {
- parentOpositeReferences = new HashMap<EStructuralFeature, EStructuralFeature>();
- parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_GROUP__IN_ACTIVITY, UMLPackage.Literals.ACTIVITY__OWNED_GROUP);
- }
- return parentOpositeReferences;
- }
-
- @Override
- public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
- String hint = "" + InterruptibleActivityRegionInterruptibleActivityRegionContentCompartmentEditPart.VISUAL_ID;
- return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
- }
-
- @Override
- public int getGroupPriority() {
- return IGroupPriority.INTERRUPTIBLE_REGION_PRIORITY;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.InterruptibleActivityRegionInterruptibleActivityRegionContentCompartmentEditPart;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * The descriptor for InterruptibleActivityRegion node used by
+ * org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension point.
+ *
+ * @author vhemery
+ */
+public class InterruptibleActivityRegionContainment extends AbstractContainerNodeDescriptor {
+
+ private Map<EStructuralFeature, EStructuralFeature> parentOpositeReferences;
+
+ /**
+ * Get the eclass of the model eobject represented by the node
+ *
+ * @return InterruptibleActivityRegion eclass
+ */
+ @Override
+ public EClass getContainerEClass() {
+ return UMLPackage.eINSTANCE.getInterruptibleActivityRegion();
+ }
+
+ /**
+ * Get the list of references linking the InterruptibleActivityRegion to
+ * children element.
+ *
+ * @return the references to contained elements
+ */
+ @Override
+ public List<EReference> getChildrenReferences() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public List<EReference> getParentReferences() {
+ return Collections.singletonList(UMLPackage.Literals.ACTIVITY_GROUP__IN_ACTIVITY);
+ }
+
+ @Override
+ public Map<EStructuralFeature, EStructuralFeature> getParentEOppositeReferences() {
+ if (parentOpositeReferences == null) {
+ parentOpositeReferences = new HashMap<EStructuralFeature, EStructuralFeature>();
+ parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_GROUP__IN_ACTIVITY, UMLPackage.Literals.ACTIVITY__OWNED_GROUP);
+ }
+ return parentOpositeReferences;
+ }
+
+ @Override
+ public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
+ String hint = "" + InterruptibleActivityRegionInterruptibleActivityRegionContentCompartmentEditPart.VISUAL_ID;
+ return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
+ }
+
+ @Override
+ public int getGroupPriority() {
+ return IGroupPriority.INTERRUPTIBLE_REGION_PRIORITY;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/LoopNodeContainment.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/LoopNodeContainment.java
index b309d20cdfa..2d888dffb8a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/LoopNodeContainment.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/LoopNodeContainment.java
@@ -1,45 +1,45 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.edit.parts.LoopNodeStructuredActivityNodeContentCompartmentEditPart;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * The descriptor for LoopNode node used by
- * org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension point.
- *
- * @author vhemery
- */
-public class LoopNodeContainment extends StructuredActivityNodeContainment {
-
- /**
- * Get the eclass of the model eobject represented by the node
- *
- * @return LoopNode eclass
- */
- @Override
- public EClass getContainerEClass() {
- return UMLPackage.eINSTANCE.getLoopNode();
- }
-
- @Override
- public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
- String hint = "" + LoopNodeStructuredActivityNodeContentCompartmentEditPart.VISUAL_ID;
- return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.LoopNodeStructuredActivityNodeContentCompartmentEditPart;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * The descriptor for LoopNode node used by
+ * org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension point.
+ *
+ * @author vhemery
+ */
+public class LoopNodeContainment extends StructuredActivityNodeContainment {
+
+ /**
+ * Get the eclass of the model eobject represented by the node
+ *
+ * @return LoopNode eclass
+ */
+ @Override
+ public EClass getContainerEClass() {
+ return UMLPackage.eINSTANCE.getLoopNode();
+ }
+
+ @Override
+ public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
+ String hint = "" + LoopNodeStructuredActivityNodeContentCompartmentEditPart.VISUAL_ID;
+ return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/SequenceNodeContainment.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/SequenceNodeContainment.java
index 5afef82d41e..a4a84d1313b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/SequenceNodeContainment.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/SequenceNodeContainment.java
@@ -1,45 +1,45 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.edit.parts.SequenceNodeStructuredActivityNodeContentCompartmentEditPart;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * The descriptor for SequenceNode node used by
- * org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension point.
- *
- * @author vhemery
- */
-public class SequenceNodeContainment extends StructuredActivityNodeContainment {
-
- /**
- * Get the eclass of the model eobject represented by the node
- *
- * @return SequenceNode eclass
- */
- @Override
- public EClass getContainerEClass() {
- return UMLPackage.eINSTANCE.getSequenceNode();
- }
-
- @Override
- public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
- String hint = "" + SequenceNodeStructuredActivityNodeContentCompartmentEditPart.VISUAL_ID;
- return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.SequenceNodeStructuredActivityNodeContentCompartmentEditPart;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * The descriptor for SequenceNode node used by
+ * org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension point.
+ *
+ * @author vhemery
+ */
+public class SequenceNodeContainment extends StructuredActivityNodeContainment {
+
+ /**
+ * Get the eclass of the model eobject represented by the node
+ *
+ * @return SequenceNode eclass
+ */
+ @Override
+ public EClass getContainerEClass() {
+ return UMLPackage.eINSTANCE.getSequenceNode();
+ }
+
+ @Override
+ public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
+ String hint = "" + SequenceNodeStructuredActivityNodeContentCompartmentEditPart.VISUAL_ID;
+ return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/StructuredActivityNodeContainment.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/StructuredActivityNodeContainment.java
index f76b724dfbe..1441e17811d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/StructuredActivityNodeContainment.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/groupcontainment/StructuredActivityNodeContainment.java
@@ -1,104 +1,104 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor;
-import org.eclipse.papyrus.uml.diagram.activity.edit.parts.StructuredActivityNodeStructuredActivityNodeContentCompartmentEditPart;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * The descriptor for StructuredActivityNode node used by
- * org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension point.
- *
- * @author vhemery
- */
-public class StructuredActivityNodeContainment extends AbstractContainerNodeDescriptor {
-
- private ArrayList<EReference> childrenReferences;
-
- private ArrayList<EReference> parentReferences;
-
- private Map<EStructuralFeature, EStructuralFeature> parentOpositeReferences;
-
- /**
- * Get the eclass of the model eobject represented by the node
- *
- * @return StructuredActivityNode eclass
- */
- @Override
- public EClass getContainerEClass() {
- return UMLPackage.eINSTANCE.getStructuredActivityNode();
- }
-
- /**
- * Get the list of references linking the StructuredActivityNode to children
- * element.
- *
- * @return the references to contained elements
- */
- @Override
- public List<EReference> getChildrenReferences() {
- if (childrenReferences == null) {
- childrenReferences = new ArrayList<EReference>(2);
- childrenReferences.add(UMLPackage.eINSTANCE.getStructuredActivityNode_Node());
- childrenReferences.add(UMLPackage.eINSTANCE.getStructuredActivityNode_Edge());
- }
- return childrenReferences;
- }
-
- @Override
- public List<EReference> getParentReferences() {
- if (parentReferences == null) {
- parentReferences = new ArrayList<EReference>();
- parentReferences.add(UMLPackage.Literals.ACTIVITY_NODE__IN_INTERRUPTIBLE_REGION);
- parentReferences.add(UMLPackage.Literals.ACTIVITY_NODE__IN_PARTITION);
- parentReferences.add(UMLPackage.Literals.ACTIVITY_NODE__IN_STRUCTURED_NODE);
- parentReferences.add(UMLPackage.Literals.ACTIVITY_GROUP__IN_ACTIVITY);
- }
- return parentReferences;
- }
-
- @Override
- public Map<EStructuralFeature, EStructuralFeature> getParentEOppositeReferences() {
- if (parentOpositeReferences == null) {
- parentOpositeReferences = new HashMap<EStructuralFeature, EStructuralFeature>();
- parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__IN_INTERRUPTIBLE_REGION, UMLPackage.Literals.INTERRUPTIBLE_ACTIVITY_REGION__NODE);
- parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__IN_PARTITION, UMLPackage.Literals.ACTIVITY_PARTITION__NODE);
- parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__IN_STRUCTURED_NODE, UMLPackage.Literals.STRUCTURED_ACTIVITY_NODE__NODE);
- parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__ACTIVITY, UMLPackage.Literals.ACTIVITY__OWNED_NODE);
- }
- return parentOpositeReferences;
- }
-
- @Override
- public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
- String hint = "" + StructuredActivityNodeStructuredActivityNodeContentCompartmentEditPart.VISUAL_ID;
- return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
- }
-
- @Override
- public int getGroupPriority() {
- return IGroupPriority.STRUCTURED_ACTIVITY_NODE_PRIORITY;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.groupcontainment;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.AbstractContainerNodeDescriptor;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.StructuredActivityNodeStructuredActivityNodeContentCompartmentEditPart;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * The descriptor for StructuredActivityNode node used by
+ * org.eclipse.papyrus.uml.diagram.common.groups.groupcontainment extension point.
+ *
+ * @author vhemery
+ */
+public class StructuredActivityNodeContainment extends AbstractContainerNodeDescriptor {
+
+ private ArrayList<EReference> childrenReferences;
+
+ private ArrayList<EReference> parentReferences;
+
+ private Map<EStructuralFeature, EStructuralFeature> parentOpositeReferences;
+
+ /**
+ * Get the eclass of the model eobject represented by the node
+ *
+ * @return StructuredActivityNode eclass
+ */
+ @Override
+ public EClass getContainerEClass() {
+ return UMLPackage.eINSTANCE.getStructuredActivityNode();
+ }
+
+ /**
+ * Get the list of references linking the StructuredActivityNode to children
+ * element.
+ *
+ * @return the references to contained elements
+ */
+ @Override
+ public List<EReference> getChildrenReferences() {
+ if (childrenReferences == null) {
+ childrenReferences = new ArrayList<EReference>(2);
+ childrenReferences.add(UMLPackage.eINSTANCE.getStructuredActivityNode_Node());
+ childrenReferences.add(UMLPackage.eINSTANCE.getStructuredActivityNode_Edge());
+ }
+ return childrenReferences;
+ }
+
+ @Override
+ public List<EReference> getParentReferences() {
+ if (parentReferences == null) {
+ parentReferences = new ArrayList<EReference>();
+ parentReferences.add(UMLPackage.Literals.ACTIVITY_NODE__IN_INTERRUPTIBLE_REGION);
+ parentReferences.add(UMLPackage.Literals.ACTIVITY_NODE__IN_PARTITION);
+ parentReferences.add(UMLPackage.Literals.ACTIVITY_NODE__IN_STRUCTURED_NODE);
+ parentReferences.add(UMLPackage.Literals.ACTIVITY_GROUP__IN_ACTIVITY);
+ }
+ return parentReferences;
+ }
+
+ @Override
+ public Map<EStructuralFeature, EStructuralFeature> getParentEOppositeReferences() {
+ if (parentOpositeReferences == null) {
+ parentOpositeReferences = new HashMap<EStructuralFeature, EStructuralFeature>();
+ parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__IN_INTERRUPTIBLE_REGION, UMLPackage.Literals.INTERRUPTIBLE_ACTIVITY_REGION__NODE);
+ parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__IN_PARTITION, UMLPackage.Literals.ACTIVITY_PARTITION__NODE);
+ parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__IN_STRUCTURED_NODE, UMLPackage.Literals.STRUCTURED_ACTIVITY_NODE__NODE);
+ parentOpositeReferences.put(UMLPackage.Literals.ACTIVITY_NODE__ACTIVITY, UMLPackage.Literals.ACTIVITY__OWNED_NODE);
+ }
+ return parentOpositeReferences;
+ }
+
+ @Override
+ public IGraphicalEditPart getCompartmentPartFromView(IGraphicalEditPart editpart) {
+ String hint = "" + StructuredActivityNodeStructuredActivityNodeContentCompartmentEditPart.VISUAL_ID;
+ return ((GraphicalEditPart) editpart).getChildBySemanticHintOnPrimaryView(hint);
+ }
+
+ @Override
+ public int getGroupPriority() {
+ return IGroupPriority.STRUCTURED_ACTIVITY_NODE_PRIORITY;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/AncestorFilter.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/AncestorFilter.java
index c2e500055a2..bef21a3a18a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/AncestorFilter.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/AncestorFilter.java
@@ -1,49 +1,49 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-
-import com.google.common.base.Predicate;
-
-/**
- * Filter all ancestors
- *
- * @author arthur daussy
- *
- */
-public class AncestorFilter implements Predicate<EObject> {
-
- private Iterable<? extends EObject> initialCollection;
-
- public AncestorFilter(Iterable<? extends EObject> initialCollection) {
- super();
- this.initialCollection = initialCollection;
- }
-
- @Override
- public boolean apply(EObject input) {
- for (EObject target : initialCollection) {
- if (target == input) {
- continue;
- }
- if (EcoreUtil.isAncestor(target, input)) {
- return false;
- }
- }
- return true;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import com.google.common.base.Predicate;
+
+/**
+ * Filter all ancestors
+ *
+ * @author arthur daussy
+ *
+ */
+public class AncestorFilter implements Predicate<EObject> {
+
+ private Iterable<? extends EObject> initialCollection;
+
+ public AncestorFilter(Iterable<? extends EObject> initialCollection) {
+ super();
+ this.initialCollection = initialCollection;
+ }
+
+ @Override
+ public boolean apply(EObject input) {
+ for (EObject target : initialCollection) {
+ if (target == input) {
+ continue;
+ }
+ if (EcoreUtil.isAncestor(target, input)) {
+ return false;
+ }
+ }
+ return true;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/DescendantsFilter.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/DescendantsFilter.java
index 89ffded6c4f..088cd2ce9da 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/DescendantsFilter.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/DescendantsFilter.java
@@ -1,49 +1,49 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-
-import com.google.common.base.Predicate;
-
-/**
- * Same as {@link EcoreUtil#filterDescendants(java.util.Collection)}
- *
- * @author arthur daussy
- *
- */
-public class DescendantsFilter implements Predicate<EObject> {
-
- private Iterable<? extends EObject> initialCollection;
-
- public DescendantsFilter(Iterable<? extends EObject> initialCollection) {
- super();
- this.initialCollection = initialCollection;
- }
-
- @Override
- public boolean apply(EObject input) {
- for (EObject target : initialCollection) {
- if (target == input) {
- continue;
- }
- if (EcoreUtil.isAncestor(input, target)) {
- return false;
- }
- }
- return true;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import com.google.common.base.Predicate;
+
+/**
+ * Same as {@link EcoreUtil#filterDescendants(java.util.Collection)}
+ *
+ * @author arthur daussy
+ *
+ */
+public class DescendantsFilter implements Predicate<EObject> {
+
+ private Iterable<? extends EObject> initialCollection;
+
+ public DescendantsFilter(Iterable<? extends EObject> initialCollection) {
+ super();
+ this.initialCollection = initialCollection;
+ }
+
+ @Override
+ public boolean apply(EObject input) {
+ for (EObject target : initialCollection) {
+ if (target == input) {
+ continue;
+ }
+ if (EcoreUtil.isAncestor(input, target)) {
+ return false;
+ }
+ }
+ return true;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/DescendantsFilterIGroupNotifier.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/DescendantsFilterIGroupNotifier.java
index 53e5745c98f..d600930e7cb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/DescendantsFilterIGroupNotifier.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/DescendantsFilterIGroupNotifier.java
@@ -1,55 +1,55 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.IGroupNotifier;
-
-import com.google.common.base.Predicate;
-
-/**
- * Same as {@link EcoreUtil#filterDescendants(java.util.Collection)}
- *
- * @author arthur daussy
- *
- */
-public class DescendantsFilterIGroupNotifier implements Predicate<IGroupNotifier> {
-
- private Iterable<? extends IGroupNotifier> initialCollection;
-
- public DescendantsFilterIGroupNotifier(Iterable<? extends IGroupNotifier> initialCollection) {
- super();
- this.initialCollection = initialCollection;
- }
-
- @Override
- public boolean apply(IGroupNotifier input) {
- for (IGroupNotifier target : initialCollection) {
- EObject targetEObject = target.getEObject();
- EObject inputEObject = input.getEObject();
- if (targetEObject == inputEObject) {
- continue;
- }
- if (inputEObject == null) {
- return false;
- }
- if (EcoreUtil.isAncestor(inputEObject, targetEObject)) {
- return false;
- }
- }
- return true;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.IGroupNotifier;
+
+import com.google.common.base.Predicate;
+
+/**
+ * Same as {@link EcoreUtil#filterDescendants(java.util.Collection)}
+ *
+ * @author arthur daussy
+ *
+ */
+public class DescendantsFilterIGroupNotifier implements Predicate<IGroupNotifier> {
+
+ private Iterable<? extends IGroupNotifier> initialCollection;
+
+ public DescendantsFilterIGroupNotifier(Iterable<? extends IGroupNotifier> initialCollection) {
+ super();
+ this.initialCollection = initialCollection;
+ }
+
+ @Override
+ public boolean apply(IGroupNotifier input) {
+ for (IGroupNotifier target : initialCollection) {
+ EObject targetEObject = target.getEObject();
+ EObject inputEObject = input.getEObject();
+ if (targetEObject == inputEObject) {
+ continue;
+ }
+ if (inputEObject == null) {
+ return false;
+ }
+ if (EcoreUtil.isAncestor(inputEObject, targetEObject)) {
+ return false;
+ }
+ }
+ return true;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/SameContainerFilter.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/SameContainerFilter.java
index fc7ff93c8a0..2be158462ef 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/SameContainerFilter.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/predicates/SameContainerFilter.java
@@ -1,49 +1,49 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates;
-
-import org.eclipse.uml2.uml.Element;
-
-import com.google.common.base.Predicate;
-
-/**
- * filter which return true or element which have the same container
- *
- * @author arthur
- *
- */
-public class SameContainerFilter implements Predicate<Element> {
-
- private Element parent;
-
- private Element container;
-
- public SameContainerFilter(Element parent) {
- super();
- this.parent = parent;
- }
-
- @Override
- public boolean apply(Element arg0) {
- return getContainer() != null && getContainer().equals(arg0.getOwner());
- }
-
- private Element getContainer() {
- if (container == null) {
- container = parent.getOwner();
- }
- return container;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates;
+
+import org.eclipse.uml2.uml.Element;
+
+import com.google.common.base.Predicate;
+
+/**
+ * filter which return true or element which have the same container
+ *
+ * @author arthur
+ *
+ */
+public class SameContainerFilter implements Predicate<Element> {
+
+ private Element parent;
+
+ private Element container;
+
+ public SameContainerFilter(Element parent) {
+ super();
+ this.parent = parent;
+ }
+
+ @Override
+ public boolean apply(Element arg0) {
+ return getContainer() != null && getContainer().equals(arg0.getOwner());
+ }
+
+ private Element getContainer() {
+ if (container == null) {
+ container = parent.getOwner();
+ }
+ return container;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/preferences/OpacityFactoryHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/preferences/OpacityFactoryHelper.java
index 8b9bf99700d..707ad6e2ff8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/preferences/OpacityFactoryHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/preferences/OpacityFactoryHelper.java
@@ -1,82 +1,82 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.preferences;
-
-import org.eclipse.draw2d.Shape;
-import org.eclipse.jface.dialogs.DialogPage;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Factory Helper used to set the opacity setting on groups ( setAlpha , listenner, preferences etc...)
- *
- * @author adaussy
- *
- */
-public class OpacityFactoryHelper {
-
- /**
- * Get the preference group to set the opqcity
- *
- * @param parent
- * @param key
- * @param dialogPage
- * @param preferenceName
- * @return
- */
- static public OpacityGroup getOpacityGroup(Composite parent, String key, DialogPage dialogPage, String preferenceName) {
- return new OpacityGroup(parent, key, dialogPage, preferenceName);
- }
-
- /**
- * Init the opacity preferences of a figure
- *
- * @param preferenceName
- * Name of the preferences which point to the alpha preference
- * @param store
- * Preference Store
- * @param figure
- * Figure on which the alpha setting has to be made
- */
- static public void initOpacityPreferences(final String preferenceName, final IPreferenceStore store, final Shape figure) {
- Integer defaultAlpha = getStoredValueOfOpacity(preferenceName, store);
- figure.setAlpha(defaultAlpha);
- store.addPropertyChangeListener(new IPropertyChangeListener() {
-
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- if (preferenceName.equals(event.getProperty())) {
- if (figure != null) {
- figure.setAlpha(store.getInt(preferenceName));
- }
- }
- }
- });
- }
-
- /**
- * Get the store value of the alpha setting
- *
- * @param preferenceName
- * name of the preference
- * @param store
- * Preference store
- * @return
- */
- static public Integer getStoredValueOfOpacity(String preferenceName, IPreferenceStore store) {
- return new Integer(store.getInt(preferenceName));
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.preferences;
+
+import org.eclipse.draw2d.Shape;
+import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Factory Helper used to set the opacity setting on groups ( setAlpha , listenner, preferences etc...)
+ *
+ * @author adaussy
+ *
+ */
+public class OpacityFactoryHelper {
+
+ /**
+ * Get the preference group to set the opqcity
+ *
+ * @param parent
+ * @param key
+ * @param dialogPage
+ * @param preferenceName
+ * @return
+ */
+ static public OpacityGroup getOpacityGroup(Composite parent, String key, DialogPage dialogPage, String preferenceName) {
+ return new OpacityGroup(parent, key, dialogPage, preferenceName);
+ }
+
+ /**
+ * Init the opacity preferences of a figure
+ *
+ * @param preferenceName
+ * Name of the preferences which point to the alpha preference
+ * @param store
+ * Preference Store
+ * @param figure
+ * Figure on which the alpha setting has to be made
+ */
+ static public void initOpacityPreferences(final String preferenceName, final IPreferenceStore store, final Shape figure) {
+ Integer defaultAlpha = getStoredValueOfOpacity(preferenceName, store);
+ figure.setAlpha(defaultAlpha);
+ store.addPropertyChangeListener(new IPropertyChangeListener() {
+
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
+ if (preferenceName.equals(event.getProperty())) {
+ if (figure != null) {
+ figure.setAlpha(store.getInt(preferenceName));
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ * Get the store value of the alpha setting
+ *
+ * @param preferenceName
+ * name of the preference
+ * @param store
+ * Preference store
+ * @return
+ */
+ static public Integer getStoredValueOfOpacity(String preferenceName, IPreferenceStore store) {
+ return new Integer(store.getInt(preferenceName));
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/preferences/OpacityGroup.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/preferences/OpacityGroup.java
index 07e32d7c3fb..699cf7ec9fc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/preferences/OpacityGroup.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/preferences/OpacityGroup.java
@@ -1,63 +1,63 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.preferences;
-
-import org.eclipse.jface.dialogs.DialogPage;
-import org.eclipse.jface.preference.ScaleFieldEditor;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup;
-import org.eclipse.papyrus.uml.diagram.common.ui.helper.HelpComponentFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-/**
- * Group use to set the opacity of a compartment of a group
- *
- * @author adaussy
- *
- */
-public class OpacityGroup extends AbstractGroup {
-
- /**
- * Name of the preferance to set
- */
- protected String preferenceName;
-
- public OpacityGroup(Composite parent, String key, DialogPage dialogPage, String preferenceName) {
- super(parent, key, dialogPage);
- this.preferenceName = preferenceName;
- createContent(parent);
- }
-
- /**
- * Creates the content.
- *
- * @param parent
- * the parent
- */
- public void createContent(Composite parent) {
- Group visibilityGroup = new Group(parent, SWT.SCROLL_PAGE);
- /*
- * TODO Refactor layout (help component at the end of the line)
- */
- visibilityGroup.setLayout(new GridLayout());
- visibilityGroup.setText("Opacity of the compartment");
- ScaleFieldEditor alphaEditor = new ScaleFieldEditor(preferenceName, "Opacity", visibilityGroup, 0, 255, 5, 20);
- alphaEditor.setPage(dialogPage);
- addFieldEditor(alphaEditor);
- HelpComponentFactory.createHelpComponent(visibilityGroup, new FormToolkit(parent.getDisplay()), "Set to min to make the compartment totally transparent");
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.preferences;
+
+import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.jface.preference.ScaleFieldEditor;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup;
+import org.eclipse.papyrus.uml.diagram.common.ui.helper.HelpComponentFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * Group use to set the opacity of a compartment of a group
+ *
+ * @author adaussy
+ *
+ */
+public class OpacityGroup extends AbstractGroup {
+
+ /**
+ * Name of the preferance to set
+ */
+ protected String preferenceName;
+
+ public OpacityGroup(Composite parent, String key, DialogPage dialogPage, String preferenceName) {
+ super(parent, key, dialogPage);
+ this.preferenceName = preferenceName;
+ createContent(parent);
+ }
+
+ /**
+ * Creates the content.
+ *
+ * @param parent
+ * the parent
+ */
+ public void createContent(Composite parent) {
+ Group visibilityGroup = new Group(parent, SWT.SCROLL_PAGE);
+ /*
+ * TODO Refactor layout (help component at the end of the line)
+ */
+ visibilityGroup.setLayout(new GridLayout());
+ visibilityGroup.setText("Opacity of the compartment");
+ ScaleFieldEditor alphaEditor = new ScaleFieldEditor(preferenceName, "Opacity", visibilityGroup, 0, 255, 5, 20);
+ alphaEditor.setPage(dialogPage);
+ addFieldEditor(alphaEditor);
+ HelpComponentFactory.createHelpComponent(visibilityGroup, new FormToolkit(parent.getDisplay()), "Set to min to make the compartment totally transparent");
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/AbstractGroupRequest.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/AbstractGroupRequest.java
index bdbc0f7117d..ad53ece915b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/AbstractGroupRequest.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/AbstractGroupRequest.java
@@ -1,141 +1,141 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.request;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.gef.Request;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.Utils;
-
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.Multimap;
-
-public abstract class AbstractGroupRequest extends Request implements IGroupRequest {
-
- protected IGraphicalEditPart host;
-
- protected Request request;
-
- protected IAdaptable target;
-
- protected IContainerNodeDescriptor nodeDescriptor;
-
- /**
- * Map to link to a parent with a EReference
- */
- private Multimap<EReference, EObject> eParentRefenceMap;
-
- /**
- * Map to link to a child with {@link EReference}
- */
- private Multimap<EReference, EObject> eChildrenRefenceMap;
-
- public AbstractGroupRequest(IGraphicalEditPart host, Request request, IAdaptable target, IContainerNodeDescriptor nodeDescriptor) {
- super();
- this.host = host;
- this.request = request;
- this.target = target;
- this.nodeDescriptor = nodeDescriptor;
- }
-
- @Override
- public IGraphicalEditPart getHostRequest() {
- return host;
- }
-
- @Override
- public Request getInitialRequest() {
- return request;
- }
-
- @Override
- public IContainerNodeDescriptor getNodeDescpitor() {
- return nodeDescriptor;
- }
-
- @Override
- public IAdaptable getTargetElement() {
- return target;
- }
-
- @Override
- public String getLabel() {
- StringBuilder builder = new StringBuilder(" IGroupRequest :\n \t Request : ").append(request).append("\n \t Target : ");
- Object eObject = getTargetElement().getAdapter(EObject.class);
- if (eObject instanceof EObject) {
- return "";
- }
- builder.append(Utils.getCorrectLabel(eObject));
- builder.append("\n \t Host :").append(Utils.getCorrectLabel(getHostRequest()));
- builder.append("\n \t Type :").append(getGroupRequestType());
- return builder.toString();
- }
-
- // /**
- // * Get the absolute bounds of the initial target.
- // * For example for changeBoudnsRequest in group. This will represent the bounds of the group after the bounds have changed
- // *
- // * @return
- // */
- // public Rectangle getIntialTargetAbsoluteBounds() {
- // @SuppressWarnings("rawtypes")
- // Map metadata = request.getExtendedData();
- // if(metadata != null) {
- // Object bounds_ = metadata.get((Object)INITIAL_TARGET_REQUEST_NEW_BOUNDS);
- // if(bounds_ instanceof Rectangle) {
- // Rectangle bounds = (Rectangle)bounds_;
- // return bounds;
- // }
- // }
- // return null;
- // }
- // /**
- // * Set the absolute bounds of the initial target.
- // * For example for changeBoudnsRequest in group. This will represent the bounds of the group after the bounds have changed
- // *
- // * @return
- // */
- //
- // public void setIntialTargetAbsoluteBounds(Rectangle bounds) {
- // Map metadata = request.getExtendedData();
- // if(bounds == null) {
- // return;
- // }
- // if(metadata != null) {
- // Object oldsBounds = metadata.put((Object)INITIAL_TARGET_REQUEST_NEW_BOUNDS, bounds);
- // if(DebugUtils.isDebugging()) {
- // DebugUtils.getLog().debug("The absolute bounds of " + Utils.getCorrectLabel(getTargetElement()) + " went from " + oldsBounds + " to " + bounds);
- // }
- // }
- // }
- @Override
- public Multimap<EReference, EObject> getParentEReferenceMap() {
- if (eParentRefenceMap == null) {
- eParentRefenceMap = ArrayListMultimap.create();
- }
- return this.eParentRefenceMap;
- }
-
- @Override
- public Multimap<EReference, EObject> getChildrenEReferenceMap() {
- if (eChildrenRefenceMap == null) {
- eChildrenRefenceMap = ArrayListMultimap.create();
- }
- return this.eChildrenRefenceMap;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.request;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.gef.Request;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.Utils;
+
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.Multimap;
+
+public abstract class AbstractGroupRequest extends Request implements IGroupRequest {
+
+ protected IGraphicalEditPart host;
+
+ protected Request request;
+
+ protected IAdaptable target;
+
+ protected IContainerNodeDescriptor nodeDescriptor;
+
+ /**
+ * Map to link to a parent with a EReference
+ */
+ private Multimap<EReference, EObject> eParentRefenceMap;
+
+ /**
+ * Map to link to a child with {@link EReference}
+ */
+ private Multimap<EReference, EObject> eChildrenRefenceMap;
+
+ public AbstractGroupRequest(IGraphicalEditPart host, Request request, IAdaptable target, IContainerNodeDescriptor nodeDescriptor) {
+ super();
+ this.host = host;
+ this.request = request;
+ this.target = target;
+ this.nodeDescriptor = nodeDescriptor;
+ }
+
+ @Override
+ public IGraphicalEditPart getHostRequest() {
+ return host;
+ }
+
+ @Override
+ public Request getInitialRequest() {
+ return request;
+ }
+
+ @Override
+ public IContainerNodeDescriptor getNodeDescpitor() {
+ return nodeDescriptor;
+ }
+
+ @Override
+ public IAdaptable getTargetElement() {
+ return target;
+ }
+
+ @Override
+ public String getLabel() {
+ StringBuilder builder = new StringBuilder(" IGroupRequest :\n \t Request : ").append(request).append("\n \t Target : ");
+ Object eObject = getTargetElement().getAdapter(EObject.class);
+ if (eObject instanceof EObject) {
+ return "";
+ }
+ builder.append(Utils.getCorrectLabel(eObject));
+ builder.append("\n \t Host :").append(Utils.getCorrectLabel(getHostRequest()));
+ builder.append("\n \t Type :").append(getGroupRequestType());
+ return builder.toString();
+ }
+
+ // /**
+ // * Get the absolute bounds of the initial target.
+ // * For example for changeBoudnsRequest in group. This will represent the bounds of the group after the bounds have changed
+ // *
+ // * @return
+ // */
+ // public Rectangle getIntialTargetAbsoluteBounds() {
+ // @SuppressWarnings("rawtypes")
+ // Map metadata = request.getExtendedData();
+ // if(metadata != null) {
+ // Object bounds_ = metadata.get((Object)INITIAL_TARGET_REQUEST_NEW_BOUNDS);
+ // if(bounds_ instanceof Rectangle) {
+ // Rectangle bounds = (Rectangle)bounds_;
+ // return bounds;
+ // }
+ // }
+ // return null;
+ // }
+ // /**
+ // * Set the absolute bounds of the initial target.
+ // * For example for changeBoudnsRequest in group. This will represent the bounds of the group after the bounds have changed
+ // *
+ // * @return
+ // */
+ //
+ // public void setIntialTargetAbsoluteBounds(Rectangle bounds) {
+ // Map metadata = request.getExtendedData();
+ // if(bounds == null) {
+ // return;
+ // }
+ // if(metadata != null) {
+ // Object oldsBounds = metadata.put((Object)INITIAL_TARGET_REQUEST_NEW_BOUNDS, bounds);
+ // if(DebugUtils.isDebugging()) {
+ // DebugUtils.getLog().debug("The absolute bounds of " + Utils.getCorrectLabel(getTargetElement()) + " went from " + oldsBounds + " to " + bounds);
+ // }
+ // }
+ // }
+ @Override
+ public Multimap<EReference, EObject> getParentEReferenceMap() {
+ if (eParentRefenceMap == null) {
+ eParentRefenceMap = ArrayListMultimap.create();
+ }
+ return this.eParentRefenceMap;
+ }
+
+ @Override
+ public Multimap<EReference, EObject> getChildrenEReferenceMap() {
+ if (eChildrenRefenceMap == null) {
+ eChildrenRefenceMap = ArrayListMultimap.create();
+ }
+ return this.eChildrenRefenceMap;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/DeferredMoveRequest.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/DeferredMoveRequest.java
index ca54db2811a..720809eb71c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/DeferredMoveRequest.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/DeferredMoveRequest.java
@@ -1,112 +1,112 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.request;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.DebugUtils;
-import org.eclipse.papyrus.uml.diagram.activity.part.UMLDiagramEditorPlugin;
-
-public class DeferredMoveRequest extends MoveRequest {
-
- /**
- * IAdaptable of the container
- */
- private IAdaptable targetContainer;
-
- /**
- * {@link IAdaptable} of the element to move
- */
- private Map<IAdaptable, Object> iAdaptableToMove;
-
- /**
- * {@link EObject= to move
- */
- private Map<EObject, Object> elementsToMove;
-
- /**
- * Class used to adapt the IAdaptable (for example {@link EObject} or {@link View}
- */
- private Class<? extends EObject> classToCast;
-
- /**
- *
- * @param editingDomain
- * @param targetContainer
- * @param elementsToMove
- */
- public DeferredMoveRequest(TransactionalEditingDomain editingDomain, IAdaptable targetContainer, List<? extends IAdaptable> elementsToMove, Class<? extends EObject> classToCast) {
- super(editingDomain, null, elementsToMove);
- this.targetContainer = targetContainer;
- this.iAdaptableToMove = new HashMap<IAdaptable, Object>();
- this.classToCast = classToCast;
- for (Iterator<? extends IAdaptable> i = elementsToMove.iterator(); i.hasNext();) {
- this.iAdaptableToMove.put(i.next(), null);
- }
- }
-
- public DeferredMoveRequest(TransactionalEditingDomain editingDomain, IAdaptable targetContainer, EReference targetFeature, IAdaptable elementToMove, Class<? extends EObject> classToCast) {
- super(editingDomain, null, targetFeature, null);
- this.targetContainer = targetContainer;
- this.iAdaptableToMove = new HashMap<IAdaptable, Object>();
- this.classToCast = classToCast;
- iAdaptableToMove.put(elementToMove, targetFeature);
- }
-
- public DeferredMoveRequest(TransactionalEditingDomain editingDomain, IAdaptable targetContainer, Map<IAdaptable, Object> elementsToMove, Class<? extends EObject> classToCast) {
- super(editingDomain, null, elementsToMove);
- this.targetContainer = targetContainer;
- this.classToCast = classToCast;
- this.iAdaptableToMove = elementsToMove;
- }
-
- @Override
- public Map getElementsToMove() {
- if (elementsToMove == null) {
- elementsToMove = new HashMap<EObject, Object>(iAdaptableToMove.size());
- for (Entry<IAdaptable, Object> entry : iAdaptableToMove.entrySet()) {
- IAdaptable key = entry.getKey();
- Object object = key.getAdapter(classToCast);
- if (object instanceof EObject) {
- elementsToMove.put((EObject) object, entry.getValue());
- } else if (UMLDiagramEditorPlugin.getInstance().isDebugging()) {
- DebugUtils.getLog().warn("Unable to retrieve the Eobject to move (" + key + ")");
- }
- }
- }
- return elementsToMove;
- }
-
- @Override
- public EObject getTargetContainer() {
- Object object = targetContainer.getAdapter(classToCast);
- if (object instanceof EObject) {
- return (EObject) object;
- } else if (UMLDiagramEditorPlugin.getInstance().isDebugging()) {
- DebugUtils.getLog().warn("Unable to retrieve the Eobject of the target container (" + targetContainer + ")");
- }
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.request;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils.DebugUtils;
+import org.eclipse.papyrus.uml.diagram.activity.part.UMLDiagramEditorPlugin;
+
+public class DeferredMoveRequest extends MoveRequest {
+
+ /**
+ * IAdaptable of the container
+ */
+ private IAdaptable targetContainer;
+
+ /**
+ * {@link IAdaptable} of the element to move
+ */
+ private Map<IAdaptable, Object> iAdaptableToMove;
+
+ /**
+ * {@link EObject= to move
+ */
+ private Map<EObject, Object> elementsToMove;
+
+ /**
+ * Class used to adapt the IAdaptable (for example {@link EObject} or {@link View}
+ */
+ private Class<? extends EObject> classToCast;
+
+ /**
+ *
+ * @param editingDomain
+ * @param targetContainer
+ * @param elementsToMove
+ */
+ public DeferredMoveRequest(TransactionalEditingDomain editingDomain, IAdaptable targetContainer, List<? extends IAdaptable> elementsToMove, Class<? extends EObject> classToCast) {
+ super(editingDomain, null, elementsToMove);
+ this.targetContainer = targetContainer;
+ this.iAdaptableToMove = new HashMap<IAdaptable, Object>();
+ this.classToCast = classToCast;
+ for (Iterator<? extends IAdaptable> i = elementsToMove.iterator(); i.hasNext();) {
+ this.iAdaptableToMove.put(i.next(), null);
+ }
+ }
+
+ public DeferredMoveRequest(TransactionalEditingDomain editingDomain, IAdaptable targetContainer, EReference targetFeature, IAdaptable elementToMove, Class<? extends EObject> classToCast) {
+ super(editingDomain, null, targetFeature, null);
+ this.targetContainer = targetContainer;
+ this.iAdaptableToMove = new HashMap<IAdaptable, Object>();
+ this.classToCast = classToCast;
+ iAdaptableToMove.put(elementToMove, targetFeature);
+ }
+
+ public DeferredMoveRequest(TransactionalEditingDomain editingDomain, IAdaptable targetContainer, Map<IAdaptable, Object> elementsToMove, Class<? extends EObject> classToCast) {
+ super(editingDomain, null, elementsToMove);
+ this.targetContainer = targetContainer;
+ this.classToCast = classToCast;
+ this.iAdaptableToMove = elementsToMove;
+ }
+
+ @Override
+ public Map getElementsToMove() {
+ if (elementsToMove == null) {
+ elementsToMove = new HashMap<EObject, Object>(iAdaptableToMove.size());
+ for (Entry<IAdaptable, Object> entry : iAdaptableToMove.entrySet()) {
+ IAdaptable key = entry.getKey();
+ Object object = key.getAdapter(classToCast);
+ if (object instanceof EObject) {
+ elementsToMove.put((EObject) object, entry.getValue());
+ } else if (UMLDiagramEditorPlugin.getInstance().isDebugging()) {
+ DebugUtils.getLog().warn("Unable to retrieve the Eobject to move (" + key + ")");
+ }
+ }
+ }
+ return elementsToMove;
+ }
+
+ @Override
+ public EObject getTargetContainer() {
+ Object object = targetContainer.getAdapter(classToCast);
+ if (object instanceof EObject) {
+ return (EObject) object;
+ } else if (UMLDiagramEditorPlugin.getInstance().isDebugging()) {
+ DebugUtils.getLog().warn("Unable to retrieve the Eobject of the target container (" + targetContainer + ")");
+ }
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/IGroupRequest.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/IGroupRequest.java
index b9c3b8f4e0d..d768376c57d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/IGroupRequest.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/IGroupRequest.java
@@ -1,87 +1,87 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.request;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.gef.Request;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
-
-import com.google.common.collect.Multimap;
-
-public interface IGroupRequest {
-
- public static enum GroupRequestType {
- /**
- * Refer to an creation event
- */
- CREATION,
- /**
- * Refer to an move(and or resize) event
- */
- MOVE,
- /**
- * Refresh groups request
- */
- REFRESH
- }
-
- public static String INITIAL_TARGET_REQUEST_NEW_BOUNDS = "GroupFramework_InitialTargetRequestNewBounds";////$NON-NLS-1$
-
- public GroupRequestType getGroupRequestType();
-
- public IGraphicalEditPart getHostRequest();
-
- public Request getInitialRequest();
-
- public IAdaptable getTargetElement();
-
- /**
- * Get the label of the request
- *
- * @return
- */
- public String getLabel();
-
- public IContainerNodeDescriptor getNodeDescpitor();
-
- // /**
- // * Get the absolute bounds of the initial target.
- // * For example for changeBoudnsRequest in group. This will represent the bounds of the group after the bounds have changed
- // * @return
- // */
- // public Rectangle getIntialTargetAbsoluteBounds();
- // /**
- // * Set the absolute bounds of the initial target.
- // * For example for changeBoudnsRequest in group. This will represent the bounds of the group after the bounds have changed
- // * @return
- // */
- // public void setIntialTargetAbsoluteBounds(Rectangle bounds);
- /**
- * Map which link an An Reference to it's values
- *
- * @return
- */
- public Multimap<EReference, EObject> getParentEReferenceMap();
-
- /**
- * Map which link an EObject to its {@link EReference} of the current target
- *
- * @return
- */
- public Multimap<EReference, EObject> getChildrenEReferenceMap();
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.request;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.gef.Request;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
+
+import com.google.common.collect.Multimap;
+
+public interface IGroupRequest {
+
+ public static enum GroupRequestType {
+ /**
+ * Refer to an creation event
+ */
+ CREATION,
+ /**
+ * Refer to an move(and or resize) event
+ */
+ MOVE,
+ /**
+ * Refresh groups request
+ */
+ REFRESH
+ }
+
+ public static String INITIAL_TARGET_REQUEST_NEW_BOUNDS = "GroupFramework_InitialTargetRequestNewBounds";////$NON-NLS-1$
+
+ public GroupRequestType getGroupRequestType();
+
+ public IGraphicalEditPart getHostRequest();
+
+ public Request getInitialRequest();
+
+ public IAdaptable getTargetElement();
+
+ /**
+ * Get the label of the request
+ *
+ * @return
+ */
+ public String getLabel();
+
+ public IContainerNodeDescriptor getNodeDescpitor();
+
+ // /**
+ // * Get the absolute bounds of the initial target.
+ // * For example for changeBoudnsRequest in group. This will represent the bounds of the group after the bounds have changed
+ // * @return
+ // */
+ // public Rectangle getIntialTargetAbsoluteBounds();
+ // /**
+ // * Set the absolute bounds of the initial target.
+ // * For example for changeBoudnsRequest in group. This will represent the bounds of the group after the bounds have changed
+ // * @return
+ // */
+ // public void setIntialTargetAbsoluteBounds(Rectangle bounds);
+ /**
+ * Map which link an An Reference to it's values
+ *
+ * @return
+ */
+ public Multimap<EReference, EObject> getParentEReferenceMap();
+
+ /**
+ * Map which link an EObject to its {@link EReference} of the current target
+ *
+ * @return
+ */
+ public Multimap<EReference, EObject> getChildrenEReferenceMap();
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/RefreshGroupsRequest.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/RefreshGroupsRequest.java
index b7c5be666b3..b238ec8ea25 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/RefreshGroupsRequest.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/RefreshGroupsRequest.java
@@ -1,33 +1,33 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.request;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
-
-public class RefreshGroupsRequest extends AbstractGroupRequest {
-
- public RefreshGroupsRequest(IGraphicalEditPart host, IAdaptable target, IContainerNodeDescriptor nodeDescriptor) {
- super(host, null, target, nodeDescriptor);
- request = new ChangeBoundsRequest();
- }
-
- @Override
- public GroupRequestType getGroupRequestType() {
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.request;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.IContainerNodeDescriptor;
+
+public class RefreshGroupsRequest extends AbstractGroupRequest {
+
+ public RefreshGroupsRequest(IGraphicalEditPart host, IAdaptable target, IContainerNodeDescriptor nodeDescriptor) {
+ super(host, null, target, nodeDescriptor);
+ request = new ChangeBoundsRequest();
+ }
+
+ @Override
+ public GroupRequestType getGroupRequestType() {
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/SetDeferredRequest.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/SetDeferredRequest.java
index be457eaacc8..b463a0008e5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/SetDeferredRequest.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/request/SetDeferredRequest.java
@@ -1,45 +1,45 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.request;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-
-public class SetDeferredRequest extends SetRequest {
-
- protected IAdaptable elementToEdit;
-
- public SetDeferredRequest(TransactionalEditingDomain editinDomain, IAdaptable elementToEdit, EStructuralFeature feature, Object value) {
- super(editinDomain, null, feature, value);
- this.elementToEdit = elementToEdit;
- }
-
- public IAdaptable getElementToSet() {
- return elementToEdit;
- }
-
- /**
- * @deprecated use {@link SetDeferredRequest#getElementToSet()}
- */
- @Deprecated
- @Override
- public List getElementsToEdit() {
- return super.getElementsToEdit();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.request;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+
+public class SetDeferredRequest extends SetRequest {
+
+ protected IAdaptable elementToEdit;
+
+ public SetDeferredRequest(TransactionalEditingDomain editinDomain, IAdaptable elementToEdit, EStructuralFeature feature, Object value) {
+ super(editinDomain, null, feature, value);
+ this.elementToEdit = elementToEdit;
+ }
+
+ public IAdaptable getElementToSet() {
+ return elementToEdit;
+ }
+
+ /**
+ * @deprecated use {@link SetDeferredRequest#getElementToSet()}
+ */
+ @Deprecated
+ @Override
+ public List getElementsToEdit() {
+ return super.getElementsToEdit();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/ui/GroupNotifierLabelProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/ui/GroupNotifierLabelProvider.java
index 139e6fca05b..0a9bb242b89 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/ui/GroupNotifierLabelProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/ui/GroupNotifierLabelProvider.java
@@ -1,57 +1,57 @@
-/*****************************************************************************
- * Copyright (c) 2011, 2014 Atos, CEA, and others.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- * Christian W. Damus (CEA) - bug 410346
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.ui;
-
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.IGroupNotifier;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * {@link LabelProvider} for {@link IGroupNotifier}
- */
-public class GroupNotifierLabelProvider extends LabelProvider {
-
- private ComposedAdapterFactory factory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
- private AdapterFactoryLabelProvider delegate = new AdapterFactoryLabelProvider(factory);
-
- @Override
- public String getText(Object element) {
- if (element instanceof IGroupNotifier) {
- IGroupNotifier notifier = (IGroupNotifier) element;
- return delegate.getText(notifier.getEObject());
- }
- return super.getText(element);
- }
-
- @Override
- public Image getImage(Object element) {
- if (element instanceof IGroupNotifier) {
- IGroupNotifier notifier = (IGroupNotifier) element;
- return delegate.getImage(notifier.getEObject());
- }
- return super.getImage(element);
- }
-
- @Override
- public void dispose() {
- delegate.dispose();
- factory.dispose();
-
- super.dispose();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011, 2014 Atos, CEA, and others.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ * Christian W. Damus (CEA) - bug 410346
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.ui;
+
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.IGroupNotifier;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * {@link LabelProvider} for {@link IGroupNotifier}
+ */
+public class GroupNotifierLabelProvider extends LabelProvider {
+
+ private ComposedAdapterFactory factory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ private AdapterFactoryLabelProvider delegate = new AdapterFactoryLabelProvider(factory);
+
+ @Override
+ public String getText(Object element) {
+ if (element instanceof IGroupNotifier) {
+ IGroupNotifier notifier = (IGroupNotifier) element;
+ return delegate.getText(notifier.getEObject());
+ }
+ return super.getText(element);
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof IGroupNotifier) {
+ IGroupNotifier notifier = (IGroupNotifier) element;
+ return delegate.getImage(notifier.getEObject());
+ }
+ return super.getImage(element);
+ }
+
+ @Override
+ public void dispose() {
+ delegate.dispose();
+ factory.dispose();
+
+ super.dispose();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/ui/IntegrateViewToConfigureComposite.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/ui/IntegrateViewToConfigureComposite.java
index 45316d22b27..4789e545897 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/ui/IntegrateViewToConfigureComposite.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/ui/IntegrateViewToConfigureComposite.java
@@ -1,84 +1,84 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.ui;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.IGroupNotifier;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
-/**
- * Composite used to notify user of new visual child
- */
-public class IntegrateViewToConfigureComposite extends Composite {
-
- /**
- *
- */
- private Table table;
-
- /**
- *
- */
- private CheckboxTableViewer checkboxTableViewer;
-
- /**
- * Create the composite.
- *
- * @param parent
- * @param style
- */
- public IntegrateViewToConfigureComposite(Composite parent, int style, List<IGroupNotifier> newChildren, String label) {
- super(parent, style);
- setLayout(new GridLayout(1, false));
- Label lblNewLabel = new Label(this, SWT.NONE);
- lblNewLabel.setText(label);
- checkboxTableViewer = CheckboxTableViewer.newCheckList(this, SWT.FULL_SELECTION);
- table = checkboxTableViewer.getTable();
- table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
- checkboxTableViewer.setContentProvider(new ArrayContentProvider());
- checkboxTableViewer.setLabelProvider(new GroupNotifierLabelProvider());
- checkboxTableViewer.setInput(newChildren);
- checkboxTableViewer.setAllChecked(true);
- }
-
- @Override
- protected void checkSubclass() {
- }
-
- public Iterable<IGroupNotifier> getSelectedNotifier() {
- Object[] selection = checkboxTableViewer.getCheckedElements();
- Iterable<Object> groupNotifiers = Iterables.filter(Lists.newArrayList(selection), Predicates.instanceOf(IGroupNotifier.class));
- return Iterables.transform(groupNotifiers, new Function<Object, IGroupNotifier>() {
-
- @Override
- public IGroupNotifier apply(Object arg0) {
- return (IGroupNotifier) arg0;
- }
- });
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.ui;
+
+import java.util.List;
+
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.editpolicy.notifiers.IGroupNotifier;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicates;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+
+/**
+ * Composite used to notify user of new visual child
+ */
+public class IntegrateViewToConfigureComposite extends Composite {
+
+ /**
+ *
+ */
+ private Table table;
+
+ /**
+ *
+ */
+ private CheckboxTableViewer checkboxTableViewer;
+
+ /**
+ * Create the composite.
+ *
+ * @param parent
+ * @param style
+ */
+ public IntegrateViewToConfigureComposite(Composite parent, int style, List<IGroupNotifier> newChildren, String label) {
+ super(parent, style);
+ setLayout(new GridLayout(1, false));
+ Label lblNewLabel = new Label(this, SWT.NONE);
+ lblNewLabel.setText(label);
+ checkboxTableViewer = CheckboxTableViewer.newCheckList(this, SWT.FULL_SELECTION);
+ table = checkboxTableViewer.getTable();
+ table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+ checkboxTableViewer.setContentProvider(new ArrayContentProvider());
+ checkboxTableViewer.setLabelProvider(new GroupNotifierLabelProvider());
+ checkboxTableViewer.setInput(newChildren);
+ checkboxTableViewer.setAllChecked(true);
+ }
+
+ @Override
+ protected void checkSubclass() {
+ }
+
+ public Iterable<IGroupNotifier> getSelectedNotifier() {
+ Object[] selection = checkboxTableViewer.getCheckedElements();
+ Iterable<Object> groupNotifiers = Iterables.filter(Lists.newArrayList(selection), Predicates.instanceOf(IGroupNotifier.class));
+ return Iterables.transform(groupNotifiers, new Function<Object, IGroupNotifier>() {
+
+ @Override
+ public IGroupNotifier apply(Object arg0) {
+ return (IGroupNotifier) arg0;
+ }
+ });
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/utils/DebugUtils.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/utils/DebugUtils.java
index a0332677f17..34df7b758dc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/utils/DebugUtils.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/utils/DebugUtils.java
@@ -1,74 +1,74 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils;
-
-import java.util.Map.Entry;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-import org.eclipse.papyrus.uml.diagram.activity.part.UMLDiagramEditorPlugin;
-
-import com.google.common.collect.Multimap;
-
-public class DebugUtils {
-
- /**
- * Allow user during debug to desactivation debug notficcation
- */
- private static final boolean LOCAL_DESACTIVATOR = true;
-
- private static LogHelper log = null;
-
- /**
- * Get loger
- *
- * @return
- */
- public static LogHelper getLog() {
- if (log == null) {
- log = new LogHelper(UMLDiagramEditorPlugin.getInstance());
- }
- return log;
- }
-
- /**
- * return true if debugging
- *
- * @return
- */
- public static boolean isDebugging() {
- return UMLDiagramEditorPlugin.getInstance().isDebugging() && LOCAL_DESACTIVATOR;
- }
-
- /**
- * Display a multi map
- *
- * @param message
- * @param multimap
- */
- public static void displayMultipmapDebug(String message, Multimap<EReference, EObject> multimap) {
- if (DebugUtils.isDebugging()) {
- DebugUtils.getLog().debug(message);
- for (Entry<EReference, EObject> e : multimap.entries()) {
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append(Utils.getCorrectLabel(e.getValue()));
- stringBuilder.append(" --> ");
- stringBuilder.append(e.getKey().getName());
- DebugUtils.getLog().debug(stringBuilder.toString());
- }
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils;
+
+import java.util.Map.Entry;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.papyrus.uml.diagram.activity.part.UMLDiagramEditorPlugin;
+
+import com.google.common.collect.Multimap;
+
+public class DebugUtils {
+
+ /**
+ * Allow user during debug to desactivation debug notficcation
+ */
+ private static final boolean LOCAL_DESACTIVATOR = true;
+
+ private static LogHelper log = null;
+
+ /**
+ * Get loger
+ *
+ * @return
+ */
+ public static LogHelper getLog() {
+ if (log == null) {
+ log = new LogHelper(UMLDiagramEditorPlugin.getInstance());
+ }
+ return log;
+ }
+
+ /**
+ * return true if debugging
+ *
+ * @return
+ */
+ public static boolean isDebugging() {
+ return UMLDiagramEditorPlugin.getInstance().isDebugging() && LOCAL_DESACTIVATOR;
+ }
+
+ /**
+ * Display a multi map
+ *
+ * @param message
+ * @param multimap
+ */
+ public static void displayMultipmapDebug(String message, Multimap<EReference, EObject> multimap) {
+ if (DebugUtils.isDebugging()) {
+ DebugUtils.getLog().debug(message);
+ for (Entry<EReference, EObject> e : multimap.entries()) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append(Utils.getCorrectLabel(e.getValue()));
+ stringBuilder.append(" --> ");
+ stringBuilder.append(e.getKey().getName());
+ DebugUtils.getLog().debug(stringBuilder.toString());
+ }
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/utils/Utils.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/utils/Utils.java
index 221432fc325..7bdc59d017e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/utils/Utils.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/activitygroup/utils/Utils.java
@@ -1,286 +1,286 @@
-/*****************************************************************************
- * Copyright (c) 2011, 2014 Atos, CEA, and others.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- * Christian W. Damus (CEA) - bug 410346
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.notation.Bounds;
-import org.eclipse.gmf.runtime.notation.LayoutConstraint;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates.DescendantsFilter;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.IGroupRequest;
-import org.eclipse.papyrus.uml.diagram.activity.part.UMLDiagramEditorPlugin;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Multimap;
-import com.google.common.collect.Sets;
-
-public class Utils {
-
- /**
- * Debug message
- */
- private static final String OLD_PARENT = "Old parent :";
-
- /**
- * Return a iterable of each targeted edit part
- *
- * @param req
- * @return
- */
- public static Iterable<IGraphicalEditPart> getTargetedEditPart(ChangeBoundsRequest req) {
- if (req != null && req.getEditParts() != null) {
- return Iterables.transform(Iterables.filter((Iterable<Object>) req.getEditParts(), new Predicate<Object>() {
-
- @Override
- public boolean apply(Object input) {
- return input instanceof IGraphicalEditPart;
- }
- }), new Function<Object, IGraphicalEditPart>() {
-
- @Override
- public IGraphicalEditPart apply(Object from) {
- return (IGraphicalEditPart) from;
- }
- });
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * Get the abslotue bounds of a figure after a change bounds request
- *
- * @param request
- * @param host
- * @return
- */
- public static Rectangle getAbslotueRequestBounds(ChangeBoundsRequest request, IGraphicalEditPart host) {
- Rectangle bounds = getAbsoluteBounds(host);
- return request.getTransformedRectangle(bounds);
- }
-
- /**
- * Get the bounds of an edit part
- *
- * @param part
- * edit part to find bounds
- * @return part's bounds in absolute coordinates
- */
- public static Rectangle getAbsoluteBounds(IGraphicalEditPart part) {
- // take bounds from figure
- part.refresh();
- part.getFigure().invalidate();
- part.getFigure().validate();
- Rectangle bounds = part.getFigure().getBounds().getCopy();
- if (part.getNotationView() instanceof Node) {
- // rather update with up to date model bounds
- Node node = (Node) part.getNotationView();
- LayoutConstraint cst = node.getLayoutConstraint();
- if (cst instanceof Bounds) {
- Bounds b = (Bounds) cst;
- Point parentLoc = part.getFigure().getParent().getBounds().getLocation();
- if (b.getX() > 0) {
- bounds.x = b.getX() + parentLoc.x;
- }
- if (b.getY() > 0) {
- bounds.y = b.getY() + parentLoc.y;
- }
- if (b.getHeight() != -1) {
- bounds.height = b.getHeight();
- }
- if (b.getWidth() != -1) {
- bounds.width = b.getWidth();
- }
- }
- }
- part.getFigure().getParent().translateToAbsolute(bounds);
- return bounds;
- }
-
- // /**
- // * Get the bounds of an edit part
- // *
- // * @param part
- // * edit part to find bounds
- // * @return part's bounds in absolute coordinates
- // */
- // public static Rectangle getAbsoluteBounds(Shape s) {
- // s.
- // // take bounds from figure
- // part.getTopGraphicEditPart().refresh();
- // Rectangle bounds = part.getFigure().getBounds().getCopy();
- //
- // if(part.getNotationView() instanceof Node) {
- // // rather update with up to date model bounds
- // Node node = (Node)part.getNotationView();
- // LayoutConstraint cst = node.getLayoutConstraint();
- // if(cst instanceof Bounds) {
- // Bounds b = (Bounds)cst;
- // Point parentLoc = part.getFigure().getParent().getBounds().getLocation();
- // if(b.getX() > 0) {
- // bounds.x = b.getX() + parentLoc.x;
- // }
- // if(b.getY() > 0) {
- // bounds.y = b.getY() + parentLoc.y;
- // }
- // if(b.getHeight() != -1) {
- // bounds.height = b.getHeight();
- // }
- // if(b.getWidth() != -1) {
- // bounds.width = b.getWidth();
- // }
- // }
- // }
- //
- // part.getFigure().getParent().translateToAbsolute(bounds);
- //
- // return bounds;
- // }
- /**
- * Same as {@link EcoreUtil#filterDescendants(Collection)}
- *
- * @param all
- * @return
- */
- public static Set<EObject> filterDescendants(Set<EObject> all) {
- return Sets.filter(all, new DescendantsFilter(all));
- }
-
- static AdapterFactoryLabelProvider factory = new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
-
- public static String getCorrectLabel(Object object) {
- if (object instanceof EObject) {
- return factory.getText(object);
- } else if (object instanceof EReference) {
- return ((EReference) object).getName();
- } else {
- return String.valueOf(object); // null safe
- }
- }
-
- public static String getCorrectLabel(IAdaptable object) {
- Object view = object.getAdapter(EObject.class);
- if (view instanceof EObject) {
- return getCorrectLabel(view);
- } else {
- return object.toString();
- }
- }
-
- /**
- * Get old parent references {@link EObject} sorted with {@link EReference} as keys
- *
- * @param request
- * @return
- */
- public static Multimap<EReference, EObject> getOldParents(IGroupRequest request) {
- if (request.getNodeDescpitor() != null) {
- return getReferenceMultimap(request, request.getNodeDescpitor().getParentReferences());
- }
- return ArrayListMultimap.create();
- }
-
- /**
- * Get old getOldChildren references {@link EObject} sorted with {@link EReference} as keys
- *
- * @param request
- * @return
- */
- public static Multimap<EReference, EObject> getOldChildren(IGroupRequest request) {
- if (request.getNodeDescpitor() != null) {
- return getReferenceMultimap(request, request.getNodeDescpitor().getChildrenReferences());
- }
- return ArrayListMultimap.create();
- }
-
- /**
- * Get the the multimap relative a request and a {@link Iterable} of {@link EReference}
- *
- * @param request
- * @param references
- * @return
- */
- protected static Multimap<EReference, EObject> getReferenceMultimap(IGroupRequest request, Iterable<EReference> references) {
- Object elementAdapter = request.getTargetElement().getAdapter(EObject.class);
- if (elementAdapter instanceof EObject && references != null) {
- Multimap<EReference, EObject> result = ArrayListMultimap.create();
- EObject targetElement = (EObject) elementAdapter;
- if (targetElement != null) {
- for (EReference ref : references) {
- if (ref.isMany()) {
- Collection<EObject> values = (Collection<EObject>) targetElement.eGet(ref);
- for (EObject v : values) {
- result.put(ref, v);
- }
- } else {
- Object value = targetElement.eGet(ref);
- ;
- if (value instanceof EObject) {
- result.put(ref, (EObject) value);
- }
- }
- }
- }
- return result;
- }
- return ArrayListMultimap.create();
- }
-
- /**
- * Copy a ChangeBoundsRequest.
- * Do not copy metadata
- *
- * @param req
- * @param part
- * @return
- */
- public static ChangeBoundsRequest getChangeBoundsRequestCopy(final ChangeBoundsRequest req, final EditPart part) {
- ChangeBoundsRequest auxRequest = new ChangeBoundsRequest(req.getType());
- auxRequest.setLocation(req.getLocation());
- auxRequest.setEditParts(Collections.singletonList(part));
- auxRequest.setMoveDelta(req.getMoveDelta());
- auxRequest.setResizeDirection(req.getResizeDirection());
- auxRequest.setSizeDelta(req.getSizeDelta());
- return auxRequest;
- }
-
- public static Rectangle getAbslotueRequestBounds(CreateViewRequest initialRequest) {
- Point location = initialRequest.getLocation();
- Dimension size = initialRequest.getSize();
- /**
- * TODO get default size
- */
- Rectangle creationBounds = new Rectangle(location != null ? location : new Point(0, 0), size != null ? size : new Dimension(20, 20));
- return creationBounds;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011, 2014 Atos, CEA, and others.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ * Christian W. Damus (CEA) - bug 410346
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.activitygroup.utils;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.notation.Bounds;
+import org.eclipse.gmf.runtime.notation.LayoutConstraint;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.predicates.DescendantsFilter;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.IGroupRequest;
+import org.eclipse.papyrus.uml.diagram.activity.part.UMLDiagramEditorPlugin;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Multimap;
+import com.google.common.collect.Sets;
+
+public class Utils {
+
+ /**
+ * Debug message
+ */
+ private static final String OLD_PARENT = "Old parent :";
+
+ /**
+ * Return a iterable of each targeted edit part
+ *
+ * @param req
+ * @return
+ */
+ public static Iterable<IGraphicalEditPart> getTargetedEditPart(ChangeBoundsRequest req) {
+ if (req != null && req.getEditParts() != null) {
+ return Iterables.transform(Iterables.filter((Iterable<Object>) req.getEditParts(), new Predicate<Object>() {
+
+ @Override
+ public boolean apply(Object input) {
+ return input instanceof IGraphicalEditPart;
+ }
+ }), new Function<Object, IGraphicalEditPart>() {
+
+ @Override
+ public IGraphicalEditPart apply(Object from) {
+ return (IGraphicalEditPart) from;
+ }
+ });
+ }
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * Get the abslotue bounds of a figure after a change bounds request
+ *
+ * @param request
+ * @param host
+ * @return
+ */
+ public static Rectangle getAbslotueRequestBounds(ChangeBoundsRequest request, IGraphicalEditPart host) {
+ Rectangle bounds = getAbsoluteBounds(host);
+ return request.getTransformedRectangle(bounds);
+ }
+
+ /**
+ * Get the bounds of an edit part
+ *
+ * @param part
+ * edit part to find bounds
+ * @return part's bounds in absolute coordinates
+ */
+ public static Rectangle getAbsoluteBounds(IGraphicalEditPart part) {
+ // take bounds from figure
+ part.refresh();
+ part.getFigure().invalidate();
+ part.getFigure().validate();
+ Rectangle bounds = part.getFigure().getBounds().getCopy();
+ if (part.getNotationView() instanceof Node) {
+ // rather update with up to date model bounds
+ Node node = (Node) part.getNotationView();
+ LayoutConstraint cst = node.getLayoutConstraint();
+ if (cst instanceof Bounds) {
+ Bounds b = (Bounds) cst;
+ Point parentLoc = part.getFigure().getParent().getBounds().getLocation();
+ if (b.getX() > 0) {
+ bounds.x = b.getX() + parentLoc.x;
+ }
+ if (b.getY() > 0) {
+ bounds.y = b.getY() + parentLoc.y;
+ }
+ if (b.getHeight() != -1) {
+ bounds.height = b.getHeight();
+ }
+ if (b.getWidth() != -1) {
+ bounds.width = b.getWidth();
+ }
+ }
+ }
+ part.getFigure().getParent().translateToAbsolute(bounds);
+ return bounds;
+ }
+
+ // /**
+ // * Get the bounds of an edit part
+ // *
+ // * @param part
+ // * edit part to find bounds
+ // * @return part's bounds in absolute coordinates
+ // */
+ // public static Rectangle getAbsoluteBounds(Shape s) {
+ // s.
+ // // take bounds from figure
+ // part.getTopGraphicEditPart().refresh();
+ // Rectangle bounds = part.getFigure().getBounds().getCopy();
+ //
+ // if(part.getNotationView() instanceof Node) {
+ // // rather update with up to date model bounds
+ // Node node = (Node)part.getNotationView();
+ // LayoutConstraint cst = node.getLayoutConstraint();
+ // if(cst instanceof Bounds) {
+ // Bounds b = (Bounds)cst;
+ // Point parentLoc = part.getFigure().getParent().getBounds().getLocation();
+ // if(b.getX() > 0) {
+ // bounds.x = b.getX() + parentLoc.x;
+ // }
+ // if(b.getY() > 0) {
+ // bounds.y = b.getY() + parentLoc.y;
+ // }
+ // if(b.getHeight() != -1) {
+ // bounds.height = b.getHeight();
+ // }
+ // if(b.getWidth() != -1) {
+ // bounds.width = b.getWidth();
+ // }
+ // }
+ // }
+ //
+ // part.getFigure().getParent().translateToAbsolute(bounds);
+ //
+ // return bounds;
+ // }
+ /**
+ * Same as {@link EcoreUtil#filterDescendants(Collection)}
+ *
+ * @param all
+ * @return
+ */
+ public static Set<EObject> filterDescendants(Set<EObject> all) {
+ return Sets.filter(all, new DescendantsFilter(all));
+ }
+
+ static AdapterFactoryLabelProvider factory = new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
+
+ public static String getCorrectLabel(Object object) {
+ if (object instanceof EObject) {
+ return factory.getText(object);
+ } else if (object instanceof EReference) {
+ return ((EReference) object).getName();
+ } else {
+ return String.valueOf(object); // null safe
+ }
+ }
+
+ public static String getCorrectLabel(IAdaptable object) {
+ Object view = object.getAdapter(EObject.class);
+ if (view instanceof EObject) {
+ return getCorrectLabel(view);
+ } else {
+ return object.toString();
+ }
+ }
+
+ /**
+ * Get old parent references {@link EObject} sorted with {@link EReference} as keys
+ *
+ * @param request
+ * @return
+ */
+ public static Multimap<EReference, EObject> getOldParents(IGroupRequest request) {
+ if (request.getNodeDescpitor() != null) {
+ return getReferenceMultimap(request, request.getNodeDescpitor().getParentReferences());
+ }
+ return ArrayListMultimap.create();
+ }
+
+ /**
+ * Get old getOldChildren references {@link EObject} sorted with {@link EReference} as keys
+ *
+ * @param request
+ * @return
+ */
+ public static Multimap<EReference, EObject> getOldChildren(IGroupRequest request) {
+ if (request.getNodeDescpitor() != null) {
+ return getReferenceMultimap(request, request.getNodeDescpitor().getChildrenReferences());
+ }
+ return ArrayListMultimap.create();
+ }
+
+ /**
+ * Get the the multimap relative a request and a {@link Iterable} of {@link EReference}
+ *
+ * @param request
+ * @param references
+ * @return
+ */
+ protected static Multimap<EReference, EObject> getReferenceMultimap(IGroupRequest request, Iterable<EReference> references) {
+ Object elementAdapter = request.getTargetElement().getAdapter(EObject.class);
+ if (elementAdapter instanceof EObject && references != null) {
+ Multimap<EReference, EObject> result = ArrayListMultimap.create();
+ EObject targetElement = (EObject) elementAdapter;
+ if (targetElement != null) {
+ for (EReference ref : references) {
+ if (ref.isMany()) {
+ Collection<EObject> values = (Collection<EObject>) targetElement.eGet(ref);
+ for (EObject v : values) {
+ result.put(ref, v);
+ }
+ } else {
+ Object value = targetElement.eGet(ref);
+ ;
+ if (value instanceof EObject) {
+ result.put(ref, (EObject) value);
+ }
+ }
+ }
+ }
+ return result;
+ }
+ return ArrayListMultimap.create();
+ }
+
+ /**
+ * Copy a ChangeBoundsRequest.
+ * Do not copy metadata
+ *
+ * @param req
+ * @param part
+ * @return
+ */
+ public static ChangeBoundsRequest getChangeBoundsRequestCopy(final ChangeBoundsRequest req, final EditPart part) {
+ ChangeBoundsRequest auxRequest = new ChangeBoundsRequest(req.getType());
+ auxRequest.setLocation(req.getLocation());
+ auxRequest.setEditParts(Collections.singletonList(part));
+ auxRequest.setMoveDelta(req.getMoveDelta());
+ auxRequest.setResizeDirection(req.getResizeDirection());
+ auxRequest.setSizeDelta(req.getSizeDelta());
+ return auxRequest;
+ }
+
+ public static Rectangle getAbslotueRequestBounds(CreateViewRequest initialRequest) {
+ Point location = initialRequest.getLocation();
+ Dimension size = initialRequest.getSize();
+ /**
+ * TODO get default size
+ */
+ Rectangle creationBounds = new Rectangle(location != null ? location : new Point(0, 0), size != null ? size : new Dimension(20, 20));
+ return creationBounds;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/ChangeParentCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/ChangeParentCommand.java
index 30a2719bf5d..dbc35b95d99 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/ChangeParentCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/ChangeParentCommand.java
@@ -1,152 +1,152 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.internal.l10n.DiagramCoreMessages;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-
-public class ChangeParentCommand extends AbstractTransactionalCommand {
-
- private IAdaptable parent;
-
- private IAdaptable child;
-
- private int index;
-
- /**
- * Creates a new <code>AddCommand</code>
- *
- * @param editingDomain
- * the editing domain through which model changes are made
- * @param parent
- * The parent view adapter
- * @param child
- * The child view adapter
- */
- public ChangeParentCommand(TransactionalEditingDomain editingDomain, IAdaptable parent, IAdaptable child) {
- this(editingDomain, parent, child, ViewUtil.APPEND);
- }
-
- /**
- * Creates a new <code>AddCommand</code>
- *
- * @param editingDomain
- * the editing domain through which model changes are made
- * @param parent
- * The parent view adapter
- * @param child
- * The child view adapter
- * @param index
- * the child insertion index
- */
- public ChangeParentCommand(TransactionalEditingDomain editingDomain, IAdaptable parent, IAdaptable child, int index) {
- super(editingDomain, DiagramCoreMessages.AddCommand_Label, null);
- assert null != parent : "Null parent in AddCommand";//$NON-NLS-1$
- assert null != child : "Null child in AddCommand";//$NON-NLS-1$
- this.parent = parent;
- this.child = child;
- this.index = index;
- }
-
- @Override
- public List getAffectedFiles() {
- View view = (View) parent.getAdapter(View.class);
- if (view != null) {
- List result = new ArrayList();
- IFile file = WorkspaceSynchronizer.getFile(view.eResource());
- if (file != null) {
- result.add(file);
- }
- return result;
- }
- return super.getAffectedFiles();
- }
-
- /**
- * executes the command; which will get the child and the containaer from
- * the <code>IAdaptable<code> and then insert the child at the given index
- * in the containers child list.
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- /**
- * Change graphical parent
- */
- View childView = (View) child.getAdapter(View.class);
- View parentView = (View) parent.getAdapter(View.class);
- EObject oldParent = childView.eContainer();
- if (oldParent instanceof View) {
- ((View) oldParent).removeChild(childView);
- }
- if (index == ViewUtil.APPEND) {
- parentView.insertChild(childView);
- } else {
- parentView.insertChildAt(childView, index);
- }
- /**
- * Change coordiante
- */
- Point childViewCoordinate = getLocation(childView);
- Point parentViewCoordinate = getLocation(parentView);
- ViewUtil.setStructuralFeatureValue(childView, NotationPackage.eINSTANCE.getLocation_X(), Integer.valueOf(110));
- ViewUtil.setStructuralFeatureValue(childView, NotationPackage.eINSTANCE.getLocation_Y(), Integer.valueOf(110));
- return CommandResult.newOKCommandResult();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gmf.runtime.common.core.command.ICommand#getLabel()
- */
- @Override
- public String getLabel() {
- return DiagramCoreMessages.AddCommand_Label;
- }
-
- protected Point getAbsoluteLocation(View v) {
- Point result = getLocation(v);
- EObject container = v.eContainer();
- while (container instanceof View) {
- View parentView = (View) container;
- Point parentCoordinate = getLocation(parentView);
- if (parentCoordinate != null) {
- result.translate(parentCoordinate);
- }
- container = parentView.eContainer();
- }
- return result;
- }
-
- protected Point getLocation(View v) {
- Integer x = (Integer) ViewUtil.getStructuralFeatureValue(v, NotationPackage.eINSTANCE.getLocation_X());
- Integer y = (Integer) ViewUtil.getStructuralFeatureValue(v, NotationPackage.eINSTANCE.getLocation_Y());
- return new Point(x, y);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.core.internal.l10n.DiagramCoreMessages;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+
+public class ChangeParentCommand extends AbstractTransactionalCommand {
+
+ private IAdaptable parent;
+
+ private IAdaptable child;
+
+ private int index;
+
+ /**
+ * Creates a new <code>AddCommand</code>
+ *
+ * @param editingDomain
+ * the editing domain through which model changes are made
+ * @param parent
+ * The parent view adapter
+ * @param child
+ * The child view adapter
+ */
+ public ChangeParentCommand(TransactionalEditingDomain editingDomain, IAdaptable parent, IAdaptable child) {
+ this(editingDomain, parent, child, ViewUtil.APPEND);
+ }
+
+ /**
+ * Creates a new <code>AddCommand</code>
+ *
+ * @param editingDomain
+ * the editing domain through which model changes are made
+ * @param parent
+ * The parent view adapter
+ * @param child
+ * The child view adapter
+ * @param index
+ * the child insertion index
+ */
+ public ChangeParentCommand(TransactionalEditingDomain editingDomain, IAdaptable parent, IAdaptable child, int index) {
+ super(editingDomain, DiagramCoreMessages.AddCommand_Label, null);
+ assert null != parent : "Null parent in AddCommand";//$NON-NLS-1$
+ assert null != child : "Null child in AddCommand";//$NON-NLS-1$
+ this.parent = parent;
+ this.child = child;
+ this.index = index;
+ }
+
+ @Override
+ public List getAffectedFiles() {
+ View view = (View) parent.getAdapter(View.class);
+ if (view != null) {
+ List result = new ArrayList();
+ IFile file = WorkspaceSynchronizer.getFile(view.eResource());
+ if (file != null) {
+ result.add(file);
+ }
+ return result;
+ }
+ return super.getAffectedFiles();
+ }
+
+ /**
+ * executes the command; which will get the child and the containaer from
+ * the <code>IAdaptable<code> and then insert the child at the given index
+ * in the containers child list.
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ /**
+ * Change graphical parent
+ */
+ View childView = (View) child.getAdapter(View.class);
+ View parentView = (View) parent.getAdapter(View.class);
+ EObject oldParent = childView.eContainer();
+ if (oldParent instanceof View) {
+ ((View) oldParent).removeChild(childView);
+ }
+ if (index == ViewUtil.APPEND) {
+ parentView.insertChild(childView);
+ } else {
+ parentView.insertChildAt(childView, index);
+ }
+ /**
+ * Change coordiante
+ */
+ Point childViewCoordinate = getLocation(childView);
+ Point parentViewCoordinate = getLocation(parentView);
+ ViewUtil.setStructuralFeatureValue(childView, NotationPackage.eINSTANCE.getLocation_X(), Integer.valueOf(110));
+ ViewUtil.setStructuralFeatureValue(childView, NotationPackage.eINSTANCE.getLocation_Y(), Integer.valueOf(110));
+ return CommandResult.newOKCommandResult();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gmf.runtime.common.core.command.ICommand#getLabel()
+ */
+ @Override
+ public String getLabel() {
+ return DiagramCoreMessages.AddCommand_Label;
+ }
+
+ protected Point getAbsoluteLocation(View v) {
+ Point result = getLocation(v);
+ EObject container = v.eContainer();
+ while (container instanceof View) {
+ View parentView = (View) container;
+ Point parentCoordinate = getLocation(parentView);
+ if (parentCoordinate != null) {
+ result.translate(parentCoordinate);
+ }
+ container = parentView.eContainer();
+ }
+ return result;
+ }
+
+ protected Point getLocation(View v) {
+ Integer x = (Integer) ViewUtil.getStructuralFeatureValue(v, NotationPackage.eINSTANCE.getLocation_X());
+ Integer y = (Integer) ViewUtil.getStructuralFeatureValue(v, NotationPackage.eINSTANCE.getLocation_Y());
+ return new Point(x, y);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/CreatePinToParameterLinkEAnnotation.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/CreatePinToParameterLinkEAnnotation.java
index 81393a1b7a0..aaa3fc09ab9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/CreatePinToParameterLinkEAnnotation.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/CreatePinToParameterLinkEAnnotation.java
@@ -1,104 +1,104 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : [Activitydiagram] Papyrus should provide a way to manually resynchronize pins and parameters on Call Actions
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.commands;
-
-import org.eclipse.emf.common.util.EMap;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.xmi.XMIResource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.papyrus.infra.emf.commands.CreateEAnnotationCommand;
-import org.eclipse.papyrus.uml.diagram.activity.helper.IPinToParameterLinkCommand;
-import org.eclipse.papyrus.uml.diagram.activity.helper.datastructure.ILinkPinToTarget;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Parameter;
-import org.eclipse.uml2.uml.Pin;
-
-/**
- * Command to create or update the EAnnoation which store the link from a {@link Pin} to a {@link Parameter}
- *
- * @author arthur daussy
- *
- */
-public class CreatePinToParameterLinkEAnnotation extends CreateEAnnotationCommand implements IPinToParameterLinkCommand {
-
- /**
- * {@link Parameter}
- */
- private Element target;
-
- /**
- * {@link EAnnotation}
- */
- protected EAnnotation eAnnotation;
-
- /**
- * Pin which will old the {@link EAnnotation}
- */
- protected EModelElement modelOwner;
-
- public CreatePinToParameterLinkEAnnotation(TransactionalEditingDomain domain, Pin object, Element target) {
- super(domain, object, PIN_TO_PARAMETER_LINK);
- this.target = target;
- this.modelOwner = object;
- }
-
- public CreatePinToParameterLinkEAnnotation(TransactionalEditingDomain domain, ILinkPinToTarget link) {
- super(domain, link.getPin(), PIN_TO_PARAMETER_LINK);
- this.target = link.getTarget();
- this.modelOwner = link.getPin();
- }
-
- @Override
- protected EAnnotation createEAnnotation() {
- eAnnotation = super.createEAnnotation();
- return eAnnotation;
- }
-
- @Override
- protected void doExecute() {
- // try to get an old EAnnotation
- eAnnotation = modelOwner.getEAnnotation(PIN_TO_PARAMETER_LINK);
- if (eAnnotation == null) {
- super.doExecute();
- }
- EMap<String, String> details = eAnnotation.getDetails();
- if (details != null) {
- details.put(PIN_TO_PARAMETER_LINK, getXmiID(target));
- }
- }
-
- /**
- * Get the XMI id to identify the parameter
- *
- * @param p
- * {@link Parameter} to identify
- * @return XMI id og the {@link Parameter}
- */
- protected String getXmiID(EObject p) {
- Resource ressource = p.eResource();
- if (ressource instanceof XMIResource) {
- return ((XMIResource) ressource).getID(p);
- }
- return NO_PARAMETER_ID;
- }
-
- @Override
- public boolean canExecute() {
- return super.canExecute() && modelOwner != null && target != null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : [Activitydiagram] Papyrus should provide a way to manually resynchronize pins and parameters on Call Actions
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.commands;
+
+import org.eclipse.emf.common.util.EMap;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.xmi.XMIResource;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.infra.emf.commands.CreateEAnnotationCommand;
+import org.eclipse.papyrus.uml.diagram.activity.helper.IPinToParameterLinkCommand;
+import org.eclipse.papyrus.uml.diagram.activity.helper.datastructure.ILinkPinToTarget;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.Pin;
+
+/**
+ * Command to create or update the EAnnoation which store the link from a {@link Pin} to a {@link Parameter}
+ *
+ * @author arthur daussy
+ *
+ */
+public class CreatePinToParameterLinkEAnnotation extends CreateEAnnotationCommand implements IPinToParameterLinkCommand {
+
+ /**
+ * {@link Parameter}
+ */
+ private Element target;
+
+ /**
+ * {@link EAnnotation}
+ */
+ protected EAnnotation eAnnotation;
+
+ /**
+ * Pin which will old the {@link EAnnotation}
+ */
+ protected EModelElement modelOwner;
+
+ public CreatePinToParameterLinkEAnnotation(TransactionalEditingDomain domain, Pin object, Element target) {
+ super(domain, object, PIN_TO_PARAMETER_LINK);
+ this.target = target;
+ this.modelOwner = object;
+ }
+
+ public CreatePinToParameterLinkEAnnotation(TransactionalEditingDomain domain, ILinkPinToTarget link) {
+ super(domain, link.getPin(), PIN_TO_PARAMETER_LINK);
+ this.target = link.getTarget();
+ this.modelOwner = link.getPin();
+ }
+
+ @Override
+ protected EAnnotation createEAnnotation() {
+ eAnnotation = super.createEAnnotation();
+ return eAnnotation;
+ }
+
+ @Override
+ protected void doExecute() {
+ // try to get an old EAnnotation
+ eAnnotation = modelOwner.getEAnnotation(PIN_TO_PARAMETER_LINK);
+ if (eAnnotation == null) {
+ super.doExecute();
+ }
+ EMap<String, String> details = eAnnotation.getDetails();
+ if (details != null) {
+ details.put(PIN_TO_PARAMETER_LINK, getXmiID(target));
+ }
+ }
+
+ /**
+ * Get the XMI id to identify the parameter
+ *
+ * @param p
+ * {@link Parameter} to identify
+ * @return XMI id og the {@link Parameter}
+ */
+ protected String getXmiID(EObject p) {
+ Resource ressource = p.eResource();
+ if (ressource instanceof XMIResource) {
+ return ((XMIResource) ressource).getID(p);
+ }
+ return NO_PARAMETER_ID;
+ }
+
+ @Override
+ public boolean canExecute() {
+ return super.canExecute() && modelOwner != null && target != null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/DeferredSetValueCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/DeferredSetValueCommand.java
index a7c5a88cdad..162dfdf8683 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/DeferredSetValueCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/DeferredSetValueCommand.java
@@ -1,41 +1,41 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.commands;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.SetDeferredRequest;
-
-public class DeferredSetValueCommand extends org.eclipse.gmf.runtime.emf.type.core.commands.DeferredSetValueCommand {
-
- protected SetDeferredRequest request;
-
- protected EObject elementToEdit;
-
- public DeferredSetValueCommand(SetDeferredRequest request) {
- super(request);
- this.request = request;
- }
-
- @Override
- protected EObject getElementToEdit() {
- if (elementToEdit == null) {
- Object adapter = request.getElementToSet().getAdapter(EObject.class);
- if (adapter instanceof EObject) {
- elementToEdit = (EObject) adapter;
- }
- }
- return elementToEdit;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.commands;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.uml.diagram.activity.activitygroup.request.SetDeferredRequest;
+
+public class DeferredSetValueCommand extends org.eclipse.gmf.runtime.emf.type.core.commands.DeferredSetValueCommand {
+
+ protected SetDeferredRequest request;
+
+ protected EObject elementToEdit;
+
+ public DeferredSetValueCommand(SetDeferredRequest request) {
+ super(request);
+ this.request = request;
+ }
+
+ @Override
+ protected EObject getElementToEdit() {
+ if (elementToEdit == null) {
+ Object adapter = request.getElementToSet().getAdapter(EObject.class);
+ if (adapter instanceof EObject) {
+ elementToEdit = (EObject) adapter;
+ }
+ }
+ return elementToEdit;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/RunNotificationCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/RunNotificationCommand.java
index 4bd4bd8d660..3f8bfd468d6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/RunNotificationCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/RunNotificationCommand.java
@@ -1,67 +1,67 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.commands;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.INotification;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.NotificationBuilder;
-
-import com.google.common.collect.Lists;
-
-/**
- * Command used to launch a notification
- *
- * @author arthur daussy
- *
- */
-public class RunNotificationCommand extends AbstractTransactionalCommand {
-
- private NotificationBuilder notification;
-
- private static List<INotification> notifs = Lists.newArrayList();
-
- public RunNotificationCommand(TransactionalEditingDomain domain, String label, List affectedFiles, NotificationBuilder notification) {
- super(domain, label, affectedFiles);
- this.notification = notification;
- }
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- /**
- * Clear old notif
- */
- clearOldNotif();
- addNotif(notification.run());
- return CommandResult.newOKCommandResult();
- }
-
- private synchronized void addNotif(INotification notif) {
- notifs.add(notif);
- }
-
- private synchronized void clearOldNotif() {
- for (INotification notif : notifs) {
- notif.delete();
- }
- notifs.clear();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Arthur Daussy (Atos) - Initial API and implementation
+ * Arthur Daussy - 371712 : 372745: [ActivityDiagram] Major refactoring group framework
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.commands;
+
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.papyrus.infra.widgets.toolbox.notification.INotification;
+import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.NotificationBuilder;
+
+import com.google.common.collect.Lists;
+
+/**
+ * Command used to launch a notification
+ *
+ * @author arthur daussy
+ *
+ */
+public class RunNotificationCommand extends AbstractTransactionalCommand {
+
+ private NotificationBuilder notification;
+
+ private static List<INotification> notifs = Lists.newArrayList();
+
+ public RunNotificationCommand(TransactionalEditingDomain domain, String label, List affectedFiles, NotificationBuilder notification) {
+ super(domain, label, affectedFiles);
+ this.notification = notification;
+ }
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ /**
+ * Clear old notif
+ */
+ clearOldNotif();
+ addNotif(notification.run());
+ return CommandResult.newOKCommandResult();
+ }
+
+ private synchronized void addNotif(INotification notif) {
+ notifs.add(notif);
+ }
+
+ private synchronized void clearOldNotif() {
+ for (INotification notif : notifs) {
+ notif.delete();
+ }
+ notifs.clear();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/CenteredColumnConstraint.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/CenteredColumnConstraint.java
index 2007205942d..e114e310bff 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/CenteredColumnConstraint.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/CenteredColumnConstraint.java
@@ -1,37 +1,37 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.draw2d;
-
-/**
- * Constraint to use with {@link CenteredColumnLayout}. Specifies whether figure
- * fills extra space
- */
-public class CenteredColumnConstraint {
-
- private boolean fill;
-
- /**
- * Constructor.
- *
- * @param fillAvailableSpace
- * whether available space is filled by this figure
- */
- public CenteredColumnConstraint(boolean fillAvailableSpace) {
- fill = fillAvailableSpace;
- }
-
- public boolean isAvailableSpaceFilled() {
- return fill;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.draw2d;
+
+/**
+ * Constraint to use with {@link CenteredColumnLayout}. Specifies whether figure
+ * fills extra space
+ */
+public class CenteredColumnConstraint {
+
+ private boolean fill;
+
+ /**
+ * Constructor.
+ *
+ * @param fillAvailableSpace
+ * whether available space is filled by this figure
+ */
+ public CenteredColumnConstraint(boolean fillAvailableSpace) {
+ fill = fillAvailableSpace;
+ }
+
+ public boolean isAvailableSpaceFilled() {
+ return fill;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/CenteredColumnLayout.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/CenteredColumnLayout.java
index cde12099be1..b514647bfc4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/CenteredColumnLayout.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/CenteredColumnLayout.java
@@ -1,122 +1,122 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.draw2d;
-
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.papyrus.uml.diagram.common.draw2d.CenterLayout;
-
-/**
- * This implementation is based on {@link CenterLayout}, except it avoids
- * superposing figures. Elements are centered and placed in a row. Available
- * extra place is dispatched between figures with fill constraint.
- *
- * @see CenteredColumnConstraint
- */
-public class CenteredColumnLayout extends StackLayout {
-
- private static final Rectangle RECTANGLE = new Rectangle();
-
- /** Extra margin (for avoiding cut) */
- private static final int MARGIN = 5;
-
- private Map<IFigure, CenteredColumnConstraint> constraints = new HashMap<IFigure, CenteredColumnConstraint>();
-
- @Override
- public void layout(IFigure figure) {
- Rectangle rect = figure.getClientArea();
- final int centerX = rect.x + rect.width / 2;
- int yAxe = rect.y;
- int availableExtraHeight = rect.height;
- int numberOfFillChildren = 0;
- List<IFigure> orderedFigures = new LinkedList<IFigure>();
- List<?> children = figure.getChildren();
- IFigure child;
- for (int i = 0; i < children.size(); i++) {
- child = (IFigure) children.get(i);
- Dimension prefSize = child.getPreferredSize(-1, -1);
- availableExtraHeight -= prefSize.height + MARGIN;
- if (constraints.get(child) != null && constraints.get(child).isAvailableSpaceFilled()) {
- numberOfFillChildren++;
- }
- if (!constraints.containsKey(child)) {
- constraints.put(child, null);
- }
- orderedFigures.add(i, child);
- }
- int fillExtraHeight = 0;
- if (numberOfFillChildren > 0) {
- fillExtraHeight = availableExtraHeight / numberOfFillChildren;
- }
- for (IFigure childF : orderedFigures) {
- boolean fill = constraints.get(childF).isAvailableSpaceFilled();
- Dimension prefSize = childF.getPreferredSize(-1, -1);
- RECTANGLE.x = centerX - prefSize.width / 2;
- RECTANGLE.y = yAxe;
- RECTANGLE.width = prefSize.width;
- if (!fill) {
- RECTANGLE.height = prefSize.height + MARGIN;
- } else {
- RECTANGLE.height = prefSize.height + MARGIN + fillExtraHeight;
- }
- // Workaround for 209648
- childF.setBounds(RECTANGLE);
- yAxe += RECTANGLE.height;
- }
- }
-
- @Override
- public void setConstraint(IFigure child, Object constraint) {
- if (constraint instanceof CenteredColumnConstraint) {
- constraints.put(child, (CenteredColumnConstraint) constraint);
- }
- super.setConstraint(child, constraint);
- }
-
- @Override
- public Object getConstraint(IFigure child) {
- return constraints.get(child);
- }
-
- @Override
- protected Dimension calculateMinimumSize(IFigure figure, int wHint, int hHint) {
- if (wHint > -1) {
- wHint = Math.max(0, wHint - figure.getInsets().getWidth());
- }
- if (hHint > -1) {
- hHint = Math.max(0, hHint - figure.getInsets().getHeight());
- }
- Dimension d = new Dimension();
- List children = figure.getChildren();
- IFigure child;
- for (int i = 0; i < children.size(); i++) {
- child = (IFigure) children.get(i);
- if (!isObservingVisibility() || child.isVisible()) {
- Dimension childSize = child.getMinimumSize(wHint, hHint);
- d.height += childSize.height;
- d.width = Math.max(d.width, childSize.width);
- }
- }
- d.expand(figure.getInsets().getWidth(), figure.getInsets().getHeight());
- d.union(getBorderPreferredSize(figure));
- return d;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.draw2d;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.papyrus.uml.diagram.common.draw2d.CenterLayout;
+
+/**
+ * This implementation is based on {@link CenterLayout}, except it avoids
+ * superposing figures. Elements are centered and placed in a row. Available
+ * extra place is dispatched between figures with fill constraint.
+ *
+ * @see CenteredColumnConstraint
+ */
+public class CenteredColumnLayout extends StackLayout {
+
+ private static final Rectangle RECTANGLE = new Rectangle();
+
+ /** Extra margin (for avoiding cut) */
+ private static final int MARGIN = 5;
+
+ private Map<IFigure, CenteredColumnConstraint> constraints = new HashMap<IFigure, CenteredColumnConstraint>();
+
+ @Override
+ public void layout(IFigure figure) {
+ Rectangle rect = figure.getClientArea();
+ final int centerX = rect.x + rect.width / 2;
+ int yAxe = rect.y;
+ int availableExtraHeight = rect.height;
+ int numberOfFillChildren = 0;
+ List<IFigure> orderedFigures = new LinkedList<IFigure>();
+ List<?> children = figure.getChildren();
+ IFigure child;
+ for (int i = 0; i < children.size(); i++) {
+ child = (IFigure) children.get(i);
+ Dimension prefSize = child.getPreferredSize(-1, -1);
+ availableExtraHeight -= prefSize.height + MARGIN;
+ if (constraints.get(child) != null && constraints.get(child).isAvailableSpaceFilled()) {
+ numberOfFillChildren++;
+ }
+ if (!constraints.containsKey(child)) {
+ constraints.put(child, null);
+ }
+ orderedFigures.add(i, child);
+ }
+ int fillExtraHeight = 0;
+ if (numberOfFillChildren > 0) {
+ fillExtraHeight = availableExtraHeight / numberOfFillChildren;
+ }
+ for (IFigure childF : orderedFigures) {
+ boolean fill = constraints.get(childF).isAvailableSpaceFilled();
+ Dimension prefSize = childF.getPreferredSize(-1, -1);
+ RECTANGLE.x = centerX - prefSize.width / 2;
+ RECTANGLE.y = yAxe;
+ RECTANGLE.width = prefSize.width;
+ if (!fill) {
+ RECTANGLE.height = prefSize.height + MARGIN;
+ } else {
+ RECTANGLE.height = prefSize.height + MARGIN + fillExtraHeight;
+ }
+ // Workaround for 209648
+ childF.setBounds(RECTANGLE);
+ yAxe += RECTANGLE.height;
+ }
+ }
+
+ @Override
+ public void setConstraint(IFigure child, Object constraint) {
+ if (constraint instanceof CenteredColumnConstraint) {
+ constraints.put(child, (CenteredColumnConstraint) constraint);
+ }
+ super.setConstraint(child, constraint);
+ }
+
+ @Override
+ public Object getConstraint(IFigure child) {
+ return constraints.get(child);
+ }
+
+ @Override
+ protected Dimension calculateMinimumSize(IFigure figure, int wHint, int hHint) {
+ if (wHint > -1) {
+ wHint = Math.max(0, wHint - figure.getInsets().getWidth());
+ }
+ if (hHint > -1) {
+ hHint = Math.max(0, hHint - figure.getInsets().getHeight());
+ }
+ Dimension d = new Dimension();
+ List children = figure.getChildren();
+ IFigure child;
+ for (int i = 0; i < children.size(); i++) {
+ child = (IFigure) children.get(i);
+ if (!isObservingVisibility() || child.isVisible()) {
+ Dimension childSize = child.getMinimumSize(wHint, hHint);
+ d.height += childSize.height;
+ d.width = Math.max(d.width, childSize.width);
+ }
+ }
+ d.expand(figure.getInsets().getWidth(), figure.getInsets().getHeight());
+ d.union(getBorderPreferredSize(figure));
+ return d;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/FlowLayoutAdvanced.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/FlowLayoutAdvanced.java
index d7a7682d1f6..100095b7a8f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/FlowLayoutAdvanced.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/FlowLayoutAdvanced.java
@@ -1,158 +1,158 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.draw2d;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.draw2d.FlowLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * Layout to create a row (or colunm) layout All children will be displayer
- * under the previous one You can add constraint with {@link FlowLayoutAdvancedConstraint}
- *
- * @author arthur daussy - arthur.daussy@atosorigin.com
- *
- */
-public class FlowLayoutAdvanced extends FlowLayout {
-
- /***
- * Orientation of the layout
- *
- * @author adaussy
- *
- */
- public enum Orientation {
- HORIZONTAL, VERTICAL
- }
-
- /**
- * Not implemented yet TODO
- */
- private Orientation orientation = Orientation.VERTICAL;
-
- private Map<IFigure, Object> constraints = new HashMap<IFigure, Object>();
-
- @Override
- protected void setBoundsOfChild(IFigure parent, IFigure child, Rectangle bounds) {
- parent.getClientArea(Rectangle.SINGLETON);
- bounds.translate(Rectangle.SINGLETON.x, Rectangle.SINGLETON.y);
- Dimension childDim = this.getChildSize(child, Rectangle.SINGLETON.width, Rectangle.SINGLETON.height).getCopy();
- bounds.setSize(childDim);
- Object _constraint = getConstraint(child);
- if (_constraint instanceof FlowLayoutAdvancedConstraint) {
- FlowLayoutAdvancedConstraint constraint = (FlowLayoutAdvancedConstraint) _constraint;
- if (constraint != null) {
- if (constraint.isFill()) {
- if (Orientation.VERTICAL.equals(orientation)) {
- bounds.setSize(bounds.getSize().getCopy().width, getAvailableSpaceForFilledElement(child, Rectangle.SINGLETON.getSize().getCopy()).getCopy().height);
- } else {
- bounds.setSize(getAvailableSpaceForFilledElement(child, Rectangle.SINGLETON.getSize().getCopy()).getCopy().width, bounds.getSize().getCopy().height);
- }
- }
- if (constraint.isFull()) {
- bounds.setSize(Rectangle.SINGLETON.getSize().getCopy());
- bounds.setLocation(Rectangle.SINGLETON.getLocation().getCopy());
- }
- }
- }
- child.setBounds(bounds);
- }
-
- @Override
- public Object getConstraint(IFigure child) {
- return constraints.get(child);
- }
-
- /**
- *
- * @see org.eclipse.draw2d.AbstractLayout#setConstraint(org.eclipse.draw2d.IFigure, java.lang.Object) Use this kind of constraint {@link FlowLayoutAdvancedConstraint}
- * @param child
- * @param constraint
- */
- @Override
- public void setConstraint(IFigure child, Object constraint) {
- if (constraint instanceof FlowLayoutAdvancedConstraint || constraint == null) {
- constraints.put(child, constraint);
- }
- }
-
- private Dimension getAvailableSpaceForFilledElement(IFigure currentChild, Dimension parentDim) {
- Set<IFigure> children = constraints.keySet();
- if (children.isEmpty()) {
- throw new RuntimeException("Current layout is not set on any figure");// TODO
- // externalize
- }
- int numberOfFilledElement = 0;
- for (Object _child : children) {
- if (_child instanceof IFigure) {
- IFigure child = (IFigure) _child;
- if (constraints.containsKey(child)) {
- FlowLayoutAdvancedConstraint localConstraint = (FlowLayoutAdvancedConstraint) constraints.get(child);
- if (localConstraint != null && localConstraint.isFill()) {
- numberOfFilledElement++;
- }
- }
- /*
- * TODO set with the orientation attribute
- */
- if (!child.equals(currentChild)) {
- parentDim = parentDim.getShrinked(0, getChildSize(child, Rectangle.SINGLETON.width, Rectangle.SINGLETON.height).height);
- }
- }
- }
- if (Orientation.VERTICAL.equals(orientation)) {
- parentDim.setHeight((int) ((float) parentDim.height / (float) numberOfFilledElement));
- // parentDim.setWidth(0);
- } else {
- parentDim.setWidth((int) ((float) parentDim.width / (float) numberOfFilledElement));
- // parentDim.setHeight(0);
- }
- return parentDim;
- }
-
- public Orientation getOrientation() {
- return orientation;
- }
-
- public void setOrientation(Orientation orientation) {
- this.orientation = orientation;
- }
-
- @Override
- public Dimension getMinimumSize(IFigure container, int w, int h) {
- Dimension minDim = null;
- for (IFigure figure : constraints.keySet()) {
- Object _c = constraints.get(figure);
- if (_c instanceof FlowLayoutAdvancedConstraint) {
- FlowLayoutAdvancedConstraint constraint = (FlowLayoutAdvancedConstraint) _c;
- if (constraint.isHasMinsize()) {
- if (minDim == null) {
- minDim = figure.getMinimumSize();
- } else {
- minDim = Dimension.min(minDim, figure.getMinimumSize());
- }
- }
- }
- }
- if (minDim == null) {
- minDim = new Dimension(0, 0);
- }
- return minDim;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.draw2d;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.draw2d.FlowLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+/**
+ * Layout to create a row (or colunm) layout All children will be displayer
+ * under the previous one You can add constraint with {@link FlowLayoutAdvancedConstraint}
+ *
+ * @author arthur daussy - arthur.daussy@atosorigin.com
+ *
+ */
+public class FlowLayoutAdvanced extends FlowLayout {
+
+ /***
+ * Orientation of the layout
+ *
+ * @author adaussy
+ *
+ */
+ public enum Orientation {
+ HORIZONTAL, VERTICAL
+ }
+
+ /**
+ * Not implemented yet TODO
+ */
+ private Orientation orientation = Orientation.VERTICAL;
+
+ private Map<IFigure, Object> constraints = new HashMap<IFigure, Object>();
+
+ @Override
+ protected void setBoundsOfChild(IFigure parent, IFigure child, Rectangle bounds) {
+ parent.getClientArea(Rectangle.SINGLETON);
+ bounds.translate(Rectangle.SINGLETON.x, Rectangle.SINGLETON.y);
+ Dimension childDim = this.getChildSize(child, Rectangle.SINGLETON.width, Rectangle.SINGLETON.height).getCopy();
+ bounds.setSize(childDim);
+ Object _constraint = getConstraint(child);
+ if (_constraint instanceof FlowLayoutAdvancedConstraint) {
+ FlowLayoutAdvancedConstraint constraint = (FlowLayoutAdvancedConstraint) _constraint;
+ if (constraint != null) {
+ if (constraint.isFill()) {
+ if (Orientation.VERTICAL.equals(orientation)) {
+ bounds.setSize(bounds.getSize().getCopy().width, getAvailableSpaceForFilledElement(child, Rectangle.SINGLETON.getSize().getCopy()).getCopy().height);
+ } else {
+ bounds.setSize(getAvailableSpaceForFilledElement(child, Rectangle.SINGLETON.getSize().getCopy()).getCopy().width, bounds.getSize().getCopy().height);
+ }
+ }
+ if (constraint.isFull()) {
+ bounds.setSize(Rectangle.SINGLETON.getSize().getCopy());
+ bounds.setLocation(Rectangle.SINGLETON.getLocation().getCopy());
+ }
+ }
+ }
+ child.setBounds(bounds);
+ }
+
+ @Override
+ public Object getConstraint(IFigure child) {
+ return constraints.get(child);
+ }
+
+ /**
+ *
+ * @see org.eclipse.draw2d.AbstractLayout#setConstraint(org.eclipse.draw2d.IFigure, java.lang.Object) Use this kind of constraint {@link FlowLayoutAdvancedConstraint}
+ * @param child
+ * @param constraint
+ */
+ @Override
+ public void setConstraint(IFigure child, Object constraint) {
+ if (constraint instanceof FlowLayoutAdvancedConstraint || constraint == null) {
+ constraints.put(child, constraint);
+ }
+ }
+
+ private Dimension getAvailableSpaceForFilledElement(IFigure currentChild, Dimension parentDim) {
+ Set<IFigure> children = constraints.keySet();
+ if (children.isEmpty()) {
+ throw new RuntimeException("Current layout is not set on any figure");// TODO
+ // externalize
+ }
+ int numberOfFilledElement = 0;
+ for (Object _child : children) {
+ if (_child instanceof IFigure) {
+ IFigure child = (IFigure) _child;
+ if (constraints.containsKey(child)) {
+ FlowLayoutAdvancedConstraint localConstraint = (FlowLayoutAdvancedConstraint) constraints.get(child);
+ if (localConstraint != null && localConstraint.isFill()) {
+ numberOfFilledElement++;
+ }
+ }
+ /*
+ * TODO set with the orientation attribute
+ */
+ if (!child.equals(currentChild)) {
+ parentDim = parentDim.getShrinked(0, getChildSize(child, Rectangle.SINGLETON.width, Rectangle.SINGLETON.height).height);
+ }
+ }
+ }
+ if (Orientation.VERTICAL.equals(orientation)) {
+ parentDim.setHeight((int) ((float) parentDim.height / (float) numberOfFilledElement));
+ // parentDim.setWidth(0);
+ } else {
+ parentDim.setWidth((int) ((float) parentDim.width / (float) numberOfFilledElement));
+ // parentDim.setHeight(0);
+ }
+ return parentDim;
+ }
+
+ public Orientation getOrientation() {
+ return orientation;
+ }
+
+ public void setOrientation(Orientation orientation) {
+ this.orientation = orientation;
+ }
+
+ @Override
+ public Dimension getMinimumSize(IFigure container, int w, int h) {
+ Dimension minDim = null;
+ for (IFigure figure : constraints.keySet()) {
+ Object _c = constraints.get(figure);
+ if (_c instanceof FlowLayoutAdvancedConstraint) {
+ FlowLayoutAdvancedConstraint constraint = (FlowLayoutAdvancedConstraint) _c;
+ if (constraint.isHasMinsize()) {
+ if (minDim == null) {
+ minDim = figure.getMinimumSize();
+ } else {
+ minDim = Dimension.min(minDim, figure.getMinimumSize());
+ }
+ }
+ }
+ }
+ if (minDim == null) {
+ minDim = new Dimension(0, 0);
+ }
+ return minDim;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/FlowLayoutAdvancedConstraint.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/FlowLayoutAdvancedConstraint.java
index 34768bb7e3d..d54849b77b6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/FlowLayoutAdvancedConstraint.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/FlowLayoutAdvancedConstraint.java
@@ -1,111 +1,111 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.draw2d;
-
-/**
- * Constraint used for FlowAdvancedLayout
- *
- * @author Arthur Daussy - arthur.daussy@atosorigin.com
- *
- */
-public class FlowLayoutAdvancedConstraint {
-
- /**
- * If true then the figure take all the free space left (divided by the
- * number of fill element (An element is event full or fill)
- */
- private boolean fill;
-
- /**
- * If true then the figure take the same size than the parent (An element is
- * event full or fill)
- */
- private boolean full;
-
- /**
- * Has minimum size
- */
- private boolean hasMinsize;
-
- /**
- *
- * Constructor. Init all contants to false
- */
- public FlowLayoutAdvancedConstraint() {
- super();
- fill = false;
- full = false;
- hasMinsize = false;
- }
-
- /**
- * {@link #fill}
- *
- * @param fill
- */
- public void setFill(boolean fill) {
- if (fill) {
- full = false;
- }
- this.fill = fill;
- }
-
- /**
- * {@link #fill}
- *
- * @return
- */
- public boolean isFull() {
- return full;
- }
-
- /**
- * {@link #full}
- *
- * @param full
- */
- public void setFull(boolean full) {
- if (full) {
- fill = false;
- }
- this.full = full;
- }
-
- /**
- * {@link #full}
- *
- * @return
- */
- public boolean isFill() {
- return fill;
- }
-
- /**
- * {@link #hasMinsize}
- *
- * @return
- */
- public boolean isHasMinsize() {
- return hasMinsize;
- }
-
- /**
- * {@link #hasMinsize}
- *
- * @param hasMinsize
- */
- public void setHasMinsize(boolean hasMinsize) {
- this.hasMinsize = hasMinsize;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.draw2d;
+
+/**
+ * Constraint used for FlowAdvancedLayout
+ *
+ * @author Arthur Daussy - arthur.daussy@atosorigin.com
+ *
+ */
+public class FlowLayoutAdvancedConstraint {
+
+ /**
+ * If true then the figure take all the free space left (divided by the
+ * number of fill element (An element is event full or fill)
+ */
+ private boolean fill;
+
+ /**
+ * If true then the figure take the same size than the parent (An element is
+ * event full or fill)
+ */
+ private boolean full;
+
+ /**
+ * Has minimum size
+ */
+ private boolean hasMinsize;
+
+ /**
+ *
+ * Constructor. Init all contants to false
+ */
+ public FlowLayoutAdvancedConstraint() {
+ super();
+ fill = false;
+ full = false;
+ hasMinsize = false;
+ }
+
+ /**
+ * {@link #fill}
+ *
+ * @param fill
+ */
+ public void setFill(boolean fill) {
+ if (fill) {
+ full = false;
+ }
+ this.fill = fill;
+ }
+
+ /**
+ * {@link #fill}
+ *
+ * @return
+ */
+ public boolean isFull() {
+ return full;
+ }
+
+ /**
+ * {@link #full}
+ *
+ * @param full
+ */
+ public void setFull(boolean full) {
+ if (full) {
+ fill = false;
+ }
+ this.full = full;
+ }
+
+ /**
+ * {@link #full}
+ *
+ * @return
+ */
+ public boolean isFill() {
+ return fill;
+ }
+
+ /**
+ * {@link #hasMinsize}
+ *
+ * @return
+ */
+ public boolean isHasMinsize() {
+ return hasMinsize;
+ }
+
+ /**
+ * {@link #hasMinsize}
+ *
+ * @param hasMinsize
+ */
+ public void setHasMinsize(boolean hasMinsize) {
+ this.hasMinsize = hasMinsize;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/GravityConstrainedFlowLayoutConstraint.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/GravityConstrainedFlowLayoutConstraint.java
index effd4533f50..d0323afd05a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/GravityConstrainedFlowLayoutConstraint.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/draw2d/GravityConstrainedFlowLayoutConstraint.java
@@ -1,39 +1,39 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.draw2d;
-
-import org.eclipse.gmf.runtime.draw2d.ui.figures.GravityConstrainedFlowLayout;
-
-/**
- * This class is used to pass a Constraint to a {@link GravityConstrainedFlowLayout}. This is a workaround to allow this
- * constraint in a generate way
- *
- * @author adaussy
- *
- */
-public class GravityConstrainedFlowLayoutConstraint {
-
- /**
- * Constraint use by {@link GravityConstrainedFlowLayout}
- */
- private Integer align = new Integer(GravityConstrainedFlowLayout.ALIGN_TOPLEFT);
-
- public int getAlign() {
- return align;
- }
-
- public void setAlign(int align) {
- this.align = align;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.draw2d;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.GravityConstrainedFlowLayout;
+
+/**
+ * This class is used to pass a Constraint to a {@link GravityConstrainedFlowLayout}. This is a workaround to allow this
+ * constraint in a generate way
+ *
+ * @author adaussy
+ *
+ */
+public class GravityConstrainedFlowLayoutConstraint {
+
+ /**
+ * Constraint use by {@link GravityConstrainedFlowLayout}
+ */
+ private Integer align = new Integer(GravityConstrainedFlowLayout.ALIGN_TOPLEFT);
+
+ public int getAlign() {
+ return align;
+ }
+
+ public void setAlign(int align) {
+ this.align = align;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/CallBehaviorActionEditHelperAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/CallBehaviorActionEditHelperAdvice.java
index a7f8258a8ec..f4fabb8e2e8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/CallBehaviorActionEditHelperAdvice.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/CallBehaviorActionEditHelperAdvice.java
@@ -1,100 +1,100 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
-import org.eclipse.papyrus.uml.diagram.activity.edit.dialogs.CreateCallBehaviorActionDialog;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.uml2.uml.Activity;
-import org.eclipse.uml2.uml.Behavior;
-import org.eclipse.uml2.uml.CallBehaviorAction;
-import org.eclipse.uml2.uml.InvocationAction;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Edit helper advice for Call Behavior Action, that pops up a dialog during creation
- */
-public class CallBehaviorActionEditHelperAdvice extends AbstractEditHelperAdvice {
-
- public static String CALL_BEHAVIOR_ACTION = "CallBehaviorAction";
- public static String POPUP_TYPE = "popupType";
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
- // get the activity containing the new element
- Activity parentActivity = null;
- EObject parent = request.getElementToConfigure();
- while (parent != null && parentActivity == null) {
- if (parent instanceof Activity) {
- parentActivity = (Activity) parent;
- }
- parent = parent.eContainer();
- }
- if (CALL_BEHAVIOR_ACTION.equals(request.getParameter(POPUP_TYPE))) {
- CreateCallBehaviorActionDialog dialog = new CreateCallBehaviorActionDialog(Display.getDefault().getActiveShell(), parentActivity, (InvocationAction) request.getElementToConfigure());
- if (IDialogConstants.OK_ID == dialog.open()) {
- // initialize the invoked element (no need to use a command, since action is being created)
- CompositeCommand command = new CompositeCommand("Configure created element");
- IElementEditService service = ElementEditServiceUtils.getCommandProvider(request.getElementToConfigure());
- EObject behavior = dialog.getSelectedInvoked();
- if (behavior instanceof Behavior) {
- SetRequest setBehaviorRequest = new SetRequest(request.getElementToConfigure(), UMLPackage.eINSTANCE.getCallBehaviorAction_Behavior(), behavior);
- command.add(service.getEditCommand(setBehaviorRequest));
- }
- // initialize synchronous
- SetRequest setSynchronousReqest = new SetRequest(request.getElementToConfigure(), UMLPackage.eINSTANCE.getCallAction_IsSynchronous(), dialog.getIsSynchronous());
- command.add(service.getEditCommand(setSynchronousReqest));
- return command;
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void configureRequest(IEditCommandRequest request) {
- request.getParameters().put(POPUP_TYPE, CALL_BEHAVIOR_ACTION);
- }
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
- *
- * @param request
- * @return
- */
- @Override
- protected ICommand getAfterSetCommand(SetRequest request) {
- CallBehaviorAction editedModelElement = (CallBehaviorAction)request.getElementToEdit();
- if(request.getFeature()==UMLPackage.eINSTANCE.getCallBehaviorAction_Behavior()){
- IPinUpdater<CallBehaviorAction> updater = PinUpdaterFactory.getInstance().instantiate(editedModelElement);
- return new PinUpdateCommand<CallBehaviorAction>("Update call behavior action pins", updater, editedModelElement);
- }else{
- return null;
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
+import org.eclipse.papyrus.uml.diagram.activity.edit.dialogs.CreateCallBehaviorActionDialog;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.CallBehaviorAction;
+import org.eclipse.uml2.uml.InvocationAction;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Edit helper advice for Call Behavior Action, that pops up a dialog during creation
+ */
+public class CallBehaviorActionEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ public static String CALL_BEHAVIOR_ACTION = "CallBehaviorAction";
+ public static String POPUP_TYPE = "popupType";
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
+ // get the activity containing the new element
+ Activity parentActivity = null;
+ EObject parent = request.getElementToConfigure();
+ while (parent != null && parentActivity == null) {
+ if (parent instanceof Activity) {
+ parentActivity = (Activity) parent;
+ }
+ parent = parent.eContainer();
+ }
+ if (CALL_BEHAVIOR_ACTION.equals(request.getParameter(POPUP_TYPE))) {
+ CreateCallBehaviorActionDialog dialog = new CreateCallBehaviorActionDialog(Display.getDefault().getActiveShell(), parentActivity, (InvocationAction) request.getElementToConfigure());
+ if (IDialogConstants.OK_ID == dialog.open()) {
+ // initialize the invoked element (no need to use a command, since action is being created)
+ CompositeCommand command = new CompositeCommand("Configure created element");
+ IElementEditService service = ElementEditServiceUtils.getCommandProvider(request.getElementToConfigure());
+ EObject behavior = dialog.getSelectedInvoked();
+ if (behavior instanceof Behavior) {
+ SetRequest setBehaviorRequest = new SetRequest(request.getElementToConfigure(), UMLPackage.eINSTANCE.getCallBehaviorAction_Behavior(), behavior);
+ command.add(service.getEditCommand(setBehaviorRequest));
+ }
+ // initialize synchronous
+ SetRequest setSynchronousReqest = new SetRequest(request.getElementToConfigure(), UMLPackage.eINSTANCE.getCallAction_IsSynchronous(), dialog.getIsSynchronous());
+ command.add(service.getEditCommand(setSynchronousReqest));
+ return command;
+ }
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void configureRequest(IEditCommandRequest request) {
+ request.getParameters().put(POPUP_TYPE, CALL_BEHAVIOR_ACTION);
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ protected ICommand getAfterSetCommand(SetRequest request) {
+ CallBehaviorAction editedModelElement = (CallBehaviorAction)request.getElementToEdit();
+ if(request.getFeature()==UMLPackage.eINSTANCE.getCallBehaviorAction_Behavior()){
+ IPinUpdater<CallBehaviorAction> updater = PinUpdaterFactory.getInstance().instantiate(editedModelElement);
+ return new PinUpdateCommand<CallBehaviorAction>("Update call behavior action pins", updater, editedModelElement);
+ }else{
+ return null;
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/CallOperationActionEditHelperAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/CallOperationActionEditHelperAdvice.java
index dac247e8b07..fbe54c24ca2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/CallOperationActionEditHelperAdvice.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/CallOperationActionEditHelperAdvice.java
@@ -1,88 +1,88 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
-import org.eclipse.papyrus.uml.diagram.activity.edit.dialogs.CreateCallOperationActionDialog;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.uml2.uml.Activity;
-import org.eclipse.uml2.uml.CallOperationAction;
-import org.eclipse.uml2.uml.InvocationAction;
-import org.eclipse.uml2.uml.Operation;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Edit helper advice for {@link CallOperationAction}, that pops up a dialog during creation
- */
-public class CallOperationActionEditHelperAdvice extends AbstractEditHelperAdvice {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
- // get the activity containing the new element
- Activity parentActivity = null;
- EObject parent = request.getElementToConfigure();
- while (parent != null && parentActivity == null) {
- if (parent instanceof Activity) {
- parentActivity = (Activity) parent;
- }
- parent = parent.eContainer();
- }
- CreateCallOperationActionDialog dialog = new CreateCallOperationActionDialog(Display.getDefault().getActiveShell(), parentActivity, (InvocationAction) request.getElementToConfigure());
- if (IDialogConstants.OK_ID == dialog.open()) {
- // initialize the invoked element (no need to use a command, since action is being created)
- CompositeCommand command = new CompositeCommand("Configure created element");
- IElementEditService service = ElementEditServiceUtils.getCommandProvider(request.getElementToConfigure());
- EObject operation = dialog.getSelectedInvoked();
- if (operation instanceof Operation) {
- SetRequest setOperationRequest = new SetRequest(request.getElementToConfigure(), UMLPackage.eINSTANCE.getCallOperationAction_Operation(), operation);
- command.add(service.getEditCommand(setOperationRequest));
- }
- // initialize synchronous
- SetRequest setSynchronousReqest = new SetRequest(request.getElementToConfigure(), UMLPackage.eINSTANCE.getCallAction_IsSynchronous(), dialog.getIsSynchronous());
- command.add(service.getEditCommand(setSynchronousReqest));
- return command;
- }
- return null;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
- *
- * @param request
- * @return
- */
- @Override
- protected ICommand getAfterSetCommand(SetRequest request) {
- CallOperationAction editedModelElement = (CallOperationAction) request.getElementToEdit();
- if(request.getFeature()==UMLPackage.eINSTANCE.getCallOperationAction_Operation()){
- IPinUpdater<CallOperationAction> updater =PinUpdaterFactory.getInstance().instantiate(editedModelElement);
- return new PinUpdateCommand<CallOperationAction>("Update call operation action pins", updater, editedModelElement);
- }else{
- return null;
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
+import org.eclipse.papyrus.uml.diagram.activity.edit.dialogs.CreateCallOperationActionDialog;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.CallOperationAction;
+import org.eclipse.uml2.uml.InvocationAction;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Edit helper advice for {@link CallOperationAction}, that pops up a dialog during creation
+ */
+public class CallOperationActionEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
+ // get the activity containing the new element
+ Activity parentActivity = null;
+ EObject parent = request.getElementToConfigure();
+ while (parent != null && parentActivity == null) {
+ if (parent instanceof Activity) {
+ parentActivity = (Activity) parent;
+ }
+ parent = parent.eContainer();
+ }
+ CreateCallOperationActionDialog dialog = new CreateCallOperationActionDialog(Display.getDefault().getActiveShell(), parentActivity, (InvocationAction) request.getElementToConfigure());
+ if (IDialogConstants.OK_ID == dialog.open()) {
+ // initialize the invoked element (no need to use a command, since action is being created)
+ CompositeCommand command = new CompositeCommand("Configure created element");
+ IElementEditService service = ElementEditServiceUtils.getCommandProvider(request.getElementToConfigure());
+ EObject operation = dialog.getSelectedInvoked();
+ if (operation instanceof Operation) {
+ SetRequest setOperationRequest = new SetRequest(request.getElementToConfigure(), UMLPackage.eINSTANCE.getCallOperationAction_Operation(), operation);
+ command.add(service.getEditCommand(setOperationRequest));
+ }
+ // initialize synchronous
+ SetRequest setSynchronousReqest = new SetRequest(request.getElementToConfigure(), UMLPackage.eINSTANCE.getCallAction_IsSynchronous(), dialog.getIsSynchronous());
+ command.add(service.getEditCommand(setSynchronousReqest));
+ return command;
+ }
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ protected ICommand getAfterSetCommand(SetRequest request) {
+ CallOperationAction editedModelElement = (CallOperationAction) request.getElementToEdit();
+ if(request.getFeature()==UMLPackage.eINSTANCE.getCallOperationAction_Operation()){
+ IPinUpdater<CallOperationAction> updater =PinUpdaterFactory.getInstance().instantiate(editedModelElement);
+ return new PinUpdateCommand<CallOperationAction>("Update call operation action pins", updater, editedModelElement);
+ }else{
+ return null;
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/CreateObjectActionEditHelperAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/CreateObjectActionEditHelperAdvice.java
index 649e25d7a72..5e20227324a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/CreateObjectActionEditHelperAdvice.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/CreateObjectActionEditHelperAdvice.java
@@ -1,86 +1,86 @@
-/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.AutomatedModelCompletionPreferencesInitializer;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.IAutomatedModelCompletionPreferencesConstants;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.uml2.uml.CreateObjectAction;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- *
- * Pins of CreateObjectAction should be create and update automatically
- * @since 3.0
- *
- */
-public class CreateObjectActionEditHelperAdvice extends AbstractEditHelperAdvice {
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
- *
- * @param request
- * @return
- */
- @Override
- protected ICommand getAfterSetCommand(SetRequest request) {
- // 1] check if the setFeature is classifier
- if (request.getFeature().equals(UMLPackage.eINSTANCE.getCreateObjectAction_Classifier())) {
- // 2] get the preference for CreateObjectAction
- final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
- boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.CREATE_OBJECT_ACTION_ACCELERATOR).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
- // 3] check preference
- if (synchronizePin) {
- CreateObjectAction createObjectAction = (CreateObjectAction) request.getElementToEdit();
- if(createObjectAction != null && request.getFeature() == UMLPackage.eINSTANCE.getCreateObjectAction_Classifier()){
- // 4] call the command for the CreateObjectAction
- return new PinUpdateCommand<CreateObjectAction>("Update create object action pins", //$NON-NLS-1$
- PinUpdaterFactory.getInstance().instantiate(createObjectAction), createObjectAction);
- }
- }
- }
- return null;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest)
- *
- * @param request
- * @return
- */
- @Override
- protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
- // 1] get the preference for CreateObjectAction
- final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
- boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.CREATE_OBJECT_ACTION_ACCELERATOR).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
- // 2] check preference
- if (synchronizePin) {
- CreateObjectAction createObjectAction = (CreateObjectAction) request.getElementToConfigure();
- if(createObjectAction != null){
- // 3] call the command for the CreateObjectAction
- return new PinUpdateCommand<CreateObjectAction>("Update create object action pins", //$NON-NLS-1$
- PinUpdaterFactory.getInstance().instantiate(createObjectAction), createObjectAction);
- }
- }
- return null;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2016 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
+
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.AutomatedModelCompletionPreferencesInitializer;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.IAutomatedModelCompletionPreferencesConstants;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.uml2.uml.CreateObjectAction;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ *
+ * Pins of CreateObjectAction should be create and update automatically
+ * @since 3.0
+ *
+ */
+public class CreateObjectActionEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ protected ICommand getAfterSetCommand(SetRequest request) {
+ // 1] check if the setFeature is classifier
+ if (request.getFeature().equals(UMLPackage.eINSTANCE.getCreateObjectAction_Classifier())) {
+ // 2] get the preference for CreateObjectAction
+ final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
+ boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.CREATE_OBJECT_ACTION_ACCELERATOR).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
+ // 3] check preference
+ if (synchronizePin) {
+ CreateObjectAction createObjectAction = (CreateObjectAction) request.getElementToEdit();
+ if(createObjectAction != null && request.getFeature() == UMLPackage.eINSTANCE.getCreateObjectAction_Classifier()){
+ // 4] call the command for the CreateObjectAction
+ return new PinUpdateCommand<CreateObjectAction>("Update create object action pins", //$NON-NLS-1$
+ PinUpdaterFactory.getInstance().instantiate(createObjectAction), createObjectAction);
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
+ // 1] get the preference for CreateObjectAction
+ final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
+ boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.CREATE_OBJECT_ACTION_ACCELERATOR).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
+ // 2] check preference
+ if (synchronizePin) {
+ CreateObjectAction createObjectAction = (CreateObjectAction) request.getElementToConfigure();
+ if(createObjectAction != null){
+ // 3] call the command for the CreateObjectAction
+ return new PinUpdateCommand<CreateObjectAction>("Update create object action pins", //$NON-NLS-1$
+ PinUpdaterFactory.getInstance().instantiate(createObjectAction), createObjectAction);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/InputPinStartObjectBehaviorActionEditHelperAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/InputPinStartObjectBehaviorActionEditHelperAdvice.java
index 7f7d0e5c0f9..c7d53076968 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/InputPinStartObjectBehaviorActionEditHelperAdvice.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/InputPinStartObjectBehaviorActionEditHelperAdvice.java
@@ -1,67 +1,67 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
-
-/**
- *
- * Pins of StartObjectBehaviorAction should be create and update automatically
- *
- */
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.intermediateactions.StartObjectBehaviorActionPinUpdater;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.AutomatedModelCompletionPreferencesInitializer;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.IAutomatedModelCompletionPreferencesConstants;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.uml2.uml.InputPin;
-import org.eclipse.uml2.uml.StartObjectBehaviorAction;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Edit helper advice for {@link StartObjectBehaviorAction}
- * @since 3.0
- */
-public class InputPinStartObjectBehaviorActionEditHelperAdvice extends AbstractEditHelperAdvice {
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
- *
- * @param request
- * @return
- */
- @Override
- protected ICommand getAfterSetCommand(SetRequest request) {
- // 1] check if the setFeature is type
- if (request.getFeature().equals(UMLPackage.eINSTANCE.getTypedElement_Type())) {
- // 2] get the preference for StartObjectBehaviorAction
- final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
- boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.START_OBJECT_BEHAVIOR_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
- // 3] check preference
- if (synchronizePin) {
- if (request.getElementToEdit() instanceof InputPin) {
- InputPin inputPin = (InputPin) request.getElementToEdit();
- if (inputPin.getOwner() instanceof StartObjectBehaviorAction) {
- // 4] call the command for the StartObjectBehaviorAction which owned the current input pin
- IPinUpdater<StartObjectBehaviorAction> updater = new StartObjectBehaviorActionPinUpdater();
- return new PinUpdateCommand<StartObjectBehaviorAction>("Update start object behavior action pins", updater, (StartObjectBehaviorAction) inputPin.getOwner());
- }
- }
- }
- }
- return super.getAfterSetCommand(request);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
+
+/**
+ *
+ * Pins of StartObjectBehaviorAction should be create and update automatically
+ *
+ */
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.intermediateactions.StartObjectBehaviorActionPinUpdater;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.AutomatedModelCompletionPreferencesInitializer;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.IAutomatedModelCompletionPreferencesConstants;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.StartObjectBehaviorAction;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Edit helper advice for {@link StartObjectBehaviorAction}
+ * @since 3.0
+ */
+public class InputPinStartObjectBehaviorActionEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ protected ICommand getAfterSetCommand(SetRequest request) {
+ // 1] check if the setFeature is type
+ if (request.getFeature().equals(UMLPackage.eINSTANCE.getTypedElement_Type())) {
+ // 2] get the preference for StartObjectBehaviorAction
+ final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
+ boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.START_OBJECT_BEHAVIOR_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
+ // 3] check preference
+ if (synchronizePin) {
+ if (request.getElementToEdit() instanceof InputPin) {
+ InputPin inputPin = (InputPin) request.getElementToEdit();
+ if (inputPin.getOwner() instanceof StartObjectBehaviorAction) {
+ // 4] call the command for the StartObjectBehaviorAction which owned the current input pin
+ IPinUpdater<StartObjectBehaviorAction> updater = new StartObjectBehaviorActionPinUpdater();
+ return new PinUpdateCommand<StartObjectBehaviorAction>("Update start object behavior action pins", updater, (StartObjectBehaviorAction) inputPin.getOwner());
+ }
+ }
+ }
+ }
+ return super.getAfterSetCommand(request);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/ReadSelfActionEditHelperAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/ReadSelfActionEditHelperAdvice.java
index e10e20d0bdf..b451e4ea7b2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/ReadSelfActionEditHelperAdvice.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/ReadSelfActionEditHelperAdvice.java
@@ -1,57 +1,57 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.AutomatedModelCompletionPreferencesInitializer;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.IAutomatedModelCompletionPreferencesConstants;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.uml2.uml.ReadSelfAction;
-
-/**
- *
- * Pin of ReadSelfAction should be create and update automatically
- * @since 3.0
- *
- */
-public class ReadSelfActionEditHelperAdvice extends AbstractEditHelperAdvice {
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest)
- *
- * @param request
- * @return
- */
- @Override
- protected ICommand getAfterConfigureCommand(ConfigureRequest request) {
- // 1] get the preference for ReadSelfAction
- final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
- boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.READ_SELF_ACTION_ACCELERATOR).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
- // 2] check preference
- if (synchronizePin) {
- ReadSelfAction editedModelElement = (ReadSelfAction) request.getElementToConfigure();
- if (editedModelElement != null) {
- // 3] call the command for the ReadSelfAction
- IPinUpdater<ReadSelfAction> updater = PinUpdaterFactory.getInstance().instantiate(editedModelElement);
- return new PinUpdateCommand<ReadSelfAction>("Update read self action pins", updater, editedModelElement);
- }
- }
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
+
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.AutomatedModelCompletionPreferencesInitializer;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.IAutomatedModelCompletionPreferencesConstants;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.uml2.uml.ReadSelfAction;
+
+/**
+ *
+ * Pin of ReadSelfAction should be create and update automatically
+ * @since 3.0
+ *
+ */
+public class ReadSelfActionEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ protected ICommand getAfterConfigureCommand(ConfigureRequest request) {
+ // 1] get the preference for ReadSelfAction
+ final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
+ boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.READ_SELF_ACTION_ACCELERATOR).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
+ // 2] check preference
+ if (synchronizePin) {
+ ReadSelfAction editedModelElement = (ReadSelfAction) request.getElementToConfigure();
+ if (editedModelElement != null) {
+ // 3] call the command for the ReadSelfAction
+ IPinUpdater<ReadSelfAction> updater = PinUpdaterFactory.getInstance().instantiate(editedModelElement);
+ return new PinUpdateCommand<ReadSelfAction>("Update read self action pins", updater, editedModelElement);
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/SendSignalActionEditHelperAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/SendSignalActionEditHelperAdvice.java
index 1cb94f12d1e..3dac4db3a52 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/SendSignalActionEditHelperAdvice.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/SendSignalActionEditHelperAdvice.java
@@ -1,88 +1,88 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
-import org.eclipse.papyrus.uml.diagram.activity.edit.dialogs.CreateSendSignalActionDialog;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.uml2.uml.Activity;
-import org.eclipse.uml2.uml.InvocationAction;
-import org.eclipse.uml2.uml.SendSignalAction;
-import org.eclipse.uml2.uml.Signal;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Edit helper advice for {@link SendSignalAction}, that pops up a dialog during creation
- */
-public class SendSignalActionEditHelperAdvice extends AbstractEditHelperAdvice {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
- // get the activity containing the new element
- Activity parentActivity = null;
- EObject parent = request.getElementToConfigure();
- while (parent != null && parentActivity == null) {
- if (parent instanceof Activity) {
- parentActivity = (Activity) parent;
- }
- parent = parent.eContainer();
- }
- CreateSendSignalActionDialog dialog = new CreateSendSignalActionDialog(Display.getDefault().getActiveShell(), parentActivity, (InvocationAction) request.getElementToConfigure());
- if (IDialogConstants.OK_ID == dialog.open()) {
- // initialize the invoked element (no need to use a command, since action is being created)
- CompositeCommand command = new CompositeCommand("Configure created element");
- IElementEditService service = ElementEditServiceUtils.getCommandProvider(request.getElementToConfigure());
- EObject signal = dialog.getSelectedInvoked();
- if (signal instanceof Signal) {
- SetRequest setSignalRequest = new SetRequest(request.getElementToConfigure(), UMLPackage.eINSTANCE.getSendSignalAction_Signal(), signal);
- command.add(service.getEditCommand(setSignalRequest));
- // initialize the action name with the signal
- SetRequest setNameRequest = new SetRequest(request.getElementToConfigure(), UMLPackage.eINSTANCE.getNamedElement_Name(), "Send".concat(((Signal) signal).getName()));
- command.add(service.getEditCommand(setNameRequest));
- }
- return command;
- }
- return null;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
- *
- * @param request
- * @return
- */
- @Override
- protected ICommand getAfterSetCommand(SetRequest request) {
- SendSignalAction editedModelElement = (SendSignalAction) request.getElementToEdit();
- if(request.getFeature()==UMLPackage.eINSTANCE.getSendSignalAction_Signal()){
- IPinUpdater<SendSignalAction > updater = PinUpdaterFactory.getInstance().instantiate(editedModelElement);
- return new PinUpdateCommand<SendSignalAction>("Update send signal action pins", updater, editedModelElement);
- }else{
- return null;
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
+import org.eclipse.papyrus.uml.diagram.activity.edit.dialogs.CreateSendSignalActionDialog;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.InvocationAction;
+import org.eclipse.uml2.uml.SendSignalAction;
+import org.eclipse.uml2.uml.Signal;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Edit helper advice for {@link SendSignalAction}, that pops up a dialog during creation
+ */
+public class SendSignalActionEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
+ // get the activity containing the new element
+ Activity parentActivity = null;
+ EObject parent = request.getElementToConfigure();
+ while (parent != null && parentActivity == null) {
+ if (parent instanceof Activity) {
+ parentActivity = (Activity) parent;
+ }
+ parent = parent.eContainer();
+ }
+ CreateSendSignalActionDialog dialog = new CreateSendSignalActionDialog(Display.getDefault().getActiveShell(), parentActivity, (InvocationAction) request.getElementToConfigure());
+ if (IDialogConstants.OK_ID == dialog.open()) {
+ // initialize the invoked element (no need to use a command, since action is being created)
+ CompositeCommand command = new CompositeCommand("Configure created element");
+ IElementEditService service = ElementEditServiceUtils.getCommandProvider(request.getElementToConfigure());
+ EObject signal = dialog.getSelectedInvoked();
+ if (signal instanceof Signal) {
+ SetRequest setSignalRequest = new SetRequest(request.getElementToConfigure(), UMLPackage.eINSTANCE.getSendSignalAction_Signal(), signal);
+ command.add(service.getEditCommand(setSignalRequest));
+ // initialize the action name with the signal
+ SetRequest setNameRequest = new SetRequest(request.getElementToConfigure(), UMLPackage.eINSTANCE.getNamedElement_Name(), "Send".concat(((Signal) signal).getName()));
+ command.add(service.getEditCommand(setNameRequest));
+ }
+ return command;
+ }
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ protected ICommand getAfterSetCommand(SetRequest request) {
+ SendSignalAction editedModelElement = (SendSignalAction) request.getElementToEdit();
+ if(request.getFeature()==UMLPackage.eINSTANCE.getSendSignalAction_Signal()){
+ IPinUpdater<SendSignalAction > updater = PinUpdaterFactory.getInstance().instantiate(editedModelElement);
+ return new PinUpdateCommand<SendSignalAction>("Update send signal action pins", updater, editedModelElement);
+ }else{
+ return null;
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/StartClassifierBehaviorActionEditHelperAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/StartClassifierBehaviorActionEditHelperAdvice.java
index bdd5fa0a8c3..bbef7930940 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/StartClassifierBehaviorActionEditHelperAdvice.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/StartClassifierBehaviorActionEditHelperAdvice.java
@@ -1,60 +1,60 @@
-/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.AutomatedModelCompletionPreferencesInitializer;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.IAutomatedModelCompletionPreferencesConstants;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.uml2.uml.StartClassifierBehaviorAction;
-
-/**
- *
- * Pin of StartClassifierBehaviorAction should be create and update automatically
- * @since 3.0
- *
- */
-public class StartClassifierBehaviorActionEditHelperAdvice extends AbstractEditHelperAdvice {
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest)
- *
- * @param request
- * @return
- */
- @Override
- protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
- // 1] get the preference for StartClassifierBehaviorAction
- final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
- boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.START_CLASSIFIER_BEHAVIOR_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
- // 2] check preference
- if (synchronizePin) {
- StartClassifierBehaviorAction startClassifierBehaviorAction = (StartClassifierBehaviorAction) request.getElementToConfigure();
- if (startClassifierBehaviorAction != null) {
- // 3] call the command for the StartClassifierBehaviorAction
- IPinUpdater<StartClassifierBehaviorAction> updater = PinUpdaterFactory.getInstance().instantiate(startClassifierBehaviorAction);
- return new PinUpdateCommand<StartClassifierBehaviorAction>("Update pins of start classifier behavior action", //$NON-NLS-1$
- updater, startClassifierBehaviorAction);
- }
- }
- return null;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2016 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
+
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.AutomatedModelCompletionPreferencesInitializer;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.IAutomatedModelCompletionPreferencesConstants;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.uml2.uml.StartClassifierBehaviorAction;
+
+/**
+ *
+ * Pin of StartClassifierBehaviorAction should be create and update automatically
+ * @since 3.0
+ *
+ */
+public class StartClassifierBehaviorActionEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
+ // 1] get the preference for StartClassifierBehaviorAction
+ final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
+ boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.START_CLASSIFIER_BEHAVIOR_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
+ // 2] check preference
+ if (synchronizePin) {
+ StartClassifierBehaviorAction startClassifierBehaviorAction = (StartClassifierBehaviorAction) request.getElementToConfigure();
+ if (startClassifierBehaviorAction != null) {
+ // 3] call the command for the StartClassifierBehaviorAction
+ IPinUpdater<StartClassifierBehaviorAction> updater = PinUpdaterFactory.getInstance().instantiate(startClassifierBehaviorAction);
+ return new PinUpdateCommand<StartClassifierBehaviorAction>("Update pins of start classifier behavior action", //$NON-NLS-1$
+ updater, startClassifierBehaviorAction);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/StartObjectBehaviorActionEditHelperAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/StartObjectBehaviorActionEditHelperAdvice.java
index d2b9d4d0cbd..d459e19ba05 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/StartObjectBehaviorActionEditHelperAdvice.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/StartObjectBehaviorActionEditHelperAdvice.java
@@ -1,83 +1,83 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.AutomatedModelCompletionPreferencesInitializer;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.IAutomatedModelCompletionPreferencesConstants;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.uml2.uml.StartObjectBehaviorAction;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- *
- * Pins of StartObjectBehaviorAction should be create and update automatically
- * @since 3.0
- *
- */
-public class StartObjectBehaviorActionEditHelperAdvice extends AbstractEditHelperAdvice {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ICommand getAfterConfigureCommand(ConfigureRequest request) {
- // 1] get the preference for StartObjectBehaviorAction
- final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
- boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.START_OBJECT_BEHAVIOR_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
- // 2] check preference
- if (synchronizePin) {
- StartObjectBehaviorAction editedModelElement = (StartObjectBehaviorAction) request.getElementToConfigure();
- if (editedModelElement != null) {
- // 3] call the command for the StartObjectBehaviorAction
- IPinUpdater<StartObjectBehaviorAction> updater = PinUpdaterFactory.getInstance().instantiate(editedModelElement);
- return new PinUpdateCommand<StartObjectBehaviorAction>("Update start object behavior action pins", updater, editedModelElement); //$NON-NLS-1$
- }
- }
- return null;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
- *
- * @param request
- * @return
- */
- @Override
- protected ICommand getAfterSetCommand(SetRequest request) {
- // 1] check if the setFeature is object
- if (request.getFeature().equals(UMLPackage.eINSTANCE.getStartObjectBehaviorAction_Object()) ||
- request.getFeature().equals(UMLPackage.eINSTANCE.getCallAction_IsSynchronous())) {
- // 2] get the preference for StartObjectBehaviorAction
- final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
- boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.START_OBJECT_BEHAVIOR_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
- // 3] check preference
- if (synchronizePin) {
- StartObjectBehaviorAction editedModelElement = (StartObjectBehaviorAction) request.getElementToEdit();
- if (editedModelElement != null) {
- // 4] call the command for the StartObjectBehaviorAction
- IPinUpdater<StartObjectBehaviorAction> updater = PinUpdaterFactory.getInstance().instantiate(editedModelElement);
- return new PinUpdateCommand<StartObjectBehaviorAction>("Update start object behavior action pins", updater, editedModelElement); //$NON-NLS-1$
- }
- }
- }
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
+
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.AutomatedModelCompletionPreferencesInitializer;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.IAutomatedModelCompletionPreferencesConstants;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.uml2.uml.StartObjectBehaviorAction;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ *
+ * Pins of StartObjectBehaviorAction should be create and update automatically
+ * @since 3.0
+ *
+ */
+public class StartObjectBehaviorActionEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getAfterConfigureCommand(ConfigureRequest request) {
+ // 1] get the preference for StartObjectBehaviorAction
+ final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
+ boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.START_OBJECT_BEHAVIOR_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
+ // 2] check preference
+ if (synchronizePin) {
+ StartObjectBehaviorAction editedModelElement = (StartObjectBehaviorAction) request.getElementToConfigure();
+ if (editedModelElement != null) {
+ // 3] call the command for the StartObjectBehaviorAction
+ IPinUpdater<StartObjectBehaviorAction> updater = PinUpdaterFactory.getInstance().instantiate(editedModelElement);
+ return new PinUpdateCommand<StartObjectBehaviorAction>("Update start object behavior action pins", updater, editedModelElement); //$NON-NLS-1$
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ protected ICommand getAfterSetCommand(SetRequest request) {
+ // 1] check if the setFeature is object
+ if (request.getFeature().equals(UMLPackage.eINSTANCE.getStartObjectBehaviorAction_Object()) ||
+ request.getFeature().equals(UMLPackage.eINSTANCE.getCallAction_IsSynchronous())) {
+ // 2] get the preference for StartObjectBehaviorAction
+ final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
+ boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.START_OBJECT_BEHAVIOR_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
+ // 3] check preference
+ if (synchronizePin) {
+ StartObjectBehaviorAction editedModelElement = (StartObjectBehaviorAction) request.getElementToEdit();
+ if (editedModelElement != null) {
+ // 4] call the command for the StartObjectBehaviorAction
+ IPinUpdater<StartObjectBehaviorAction> updater = PinUpdaterFactory.getInstance().instantiate(editedModelElement);
+ return new PinUpdateCommand<StartObjectBehaviorAction>("Update start object behavior action pins", updater, editedModelElement); //$NON-NLS-1$
+ }
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/TestIdentityActionEditHelperAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/TestIdentityActionEditHelperAdvice.java
index 3e001542bb1..ca349e1b44f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/TestIdentityActionEditHelperAdvice.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/TestIdentityActionEditHelperAdvice.java
@@ -1,81 +1,81 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.ImportUMLPrimitiveTypePackageCommand;
-import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.UpdaterPinUtils;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.AutomatedModelCompletionPreferencesInitializer;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.IAutomatedModelCompletionPreferencesConstants;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.TestIdentityAction;
-
-/**
- *
- * Pins of TestIdentityAction should be create automatically
- * @since 3.0
- *
- */
-public class TestIdentityActionEditHelperAdvice extends AbstractEditHelperAdvice {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ICommand getAfterConfigureCommand(ConfigureRequest request) {
- // 1] get the preference for TestIdentityAction
- final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
- boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.TEST_IDENTITY_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
- // 2] check preference
- if (synchronizePin) {
- TestIdentityAction testIdentityAction = (TestIdentityAction) request.getElementToConfigure();
- if (testIdentityAction != null) {
- // 3] call the command for the TestIdentityAction
- IPinUpdater<TestIdentityAction> updater = PinUpdaterFactory.getInstance().instantiate(testIdentityAction);
- return new PinUpdateCommand<TestIdentityAction>("Update test identity action pins", updater, testIdentityAction); //$NON-NLS-1$
- }
- }
- return null;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest)
- *
- * @param request
- * @return
- */
- @Override
- protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
- // 1] get the preference for TestIdentityAction
- final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
- boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.TEST_IDENTITY_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
- // 2] check preference
- if (synchronizePin) {
- Package root = PackageUtil.getRootPackage((Element) request.getElementToConfigure());
- if (!UpdaterPinUtils.isPrimitiveTypeLibraryImported(root)) {
- // 3] call the command to import UML primitive types package
- return new ImportUMLPrimitiveTypePackageCommand("Import UML primitive type package", root); //$NON-NLS-1$
- }
- }
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
+
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.ImportUMLPrimitiveTypePackageCommand;
+import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.UpdaterPinUtils;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.AutomatedModelCompletionPreferencesInitializer;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.IAutomatedModelCompletionPreferencesConstants;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.TestIdentityAction;
+
+/**
+ *
+ * Pins of TestIdentityAction should be create automatically
+ * @since 3.0
+ *
+ */
+public class TestIdentityActionEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getAfterConfigureCommand(ConfigureRequest request) {
+ // 1] get the preference for TestIdentityAction
+ final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
+ boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.TEST_IDENTITY_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
+ // 2] check preference
+ if (synchronizePin) {
+ TestIdentityAction testIdentityAction = (TestIdentityAction) request.getElementToConfigure();
+ if (testIdentityAction != null) {
+ // 3] call the command for the TestIdentityAction
+ IPinUpdater<TestIdentityAction> updater = PinUpdaterFactory.getInstance().instantiate(testIdentityAction);
+ return new PinUpdateCommand<TestIdentityAction>("Update test identity action pins", updater, testIdentityAction); //$NON-NLS-1$
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
+ // 1] get the preference for TestIdentityAction
+ final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
+ boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.TEST_IDENTITY_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
+ // 2] check preference
+ if (synchronizePin) {
+ Package root = PackageUtil.getRootPackage((Element) request.getElementToConfigure());
+ if (!UpdaterPinUtils.isPrimitiveTypeLibraryImported(root)) {
+ // 3] call the command to import UML primitive types package
+ return new ImportUMLPrimitiveTypePackageCommand("Import UML primitive type package", root); //$NON-NLS-1$
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/ValueSpecificationActionEditHelperAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/ValueSpecificationActionEditHelperAdvice.java
index f73f81be564..5db48559f4d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/ValueSpecificationActionEditHelperAdvice.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/advices/ValueSpecificationActionEditHelperAdvice.java
@@ -1,113 +1,113 @@
-/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.ImportUMLPrimitiveTypePackageCommand;
-import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.UpdaterPinUtils;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.AutomatedModelCompletionPreferencesInitializer;
-import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.IAutomatedModelCompletionPreferencesConstants;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.ValueSpecificationAction;
-
-/**
- *
- * Pin of ValueSpecificationAction should be create and update automatically
- * @since 3.0
- *
- */
-public class ValueSpecificationActionEditHelperAdvice extends AbstractEditHelperAdvice {
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
- *
- * @param request
- * @return
- */
- @Override
- protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
- // 1] get the preference for ValueSpecificationAction
- final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
- boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.VALUE_SPECIFICATION_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
- // 2] check preference
- if (synchronizePin) {
- Package root = PackageUtil.getRootPackage((Element) request.getElementToConfigure());
- if (!UpdaterPinUtils.isPrimitiveTypeLibraryImported(root)) {
- // 3] call the command to import the UML primitive types package
- return new ImportUMLPrimitiveTypePackageCommand("Import UML primitive type package", root); //$NON-NLS-1$
- }
- }
-
- return null;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
- *
- * @param request
- * @return
- */
- @Override
- protected ICommand getAfterSetCommand(SetRequest request) {
- // 1] check if the setFeature is value
- if (request.getFeature().equals(UMLPackage.eINSTANCE.getValueSpecificationAction_Value())) {
- // 2] get the preference for ValueSpecificationAction
- final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
- boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.VALUE_SPECIFICATION_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
- // 3] check preference
- if (synchronizePin) {
- ValueSpecificationAction valueSpecificationAction = (ValueSpecificationAction) request.getElementToEdit();
- if (valueSpecificationAction != null && request.getFeature() == UMLPackage.eINSTANCE.getValueSpecificationAction_Value()) {
- // 4] call the command for the ValueSpecificationAction
- IPinUpdater<ValueSpecificationAction> updater = PinUpdaterFactory.getInstance().instantiate(valueSpecificationAction);
- return new PinUpdateCommand<ValueSpecificationAction>("Update value specification action pins", updater, valueSpecificationAction); //$NON-NLS-1$
- }
- }
- }
- return null;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest)
- *
- * @param request
- * @return
- */
- @Override
- protected ICommand getAfterConfigureCommand(ConfigureRequest request) {
- // 1] get the preference for ValueSpecificationAction
- final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
- boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.VALUE_SPECIFICATION_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
- // 2] check preference
- if (synchronizePin) {
- ValueSpecificationAction valueSpecificationAction = (ValueSpecificationAction) request.getElementToConfigure();
- if (valueSpecificationAction != null) {
- // 3] call the command for the ValueSpecificationAction
- return new PinUpdateCommand<ValueSpecificationAction>("Update value specification action pins", PinUpdaterFactory.getInstance().instantiate(valueSpecificationAction), valueSpecificationAction); //$NON-NLS-1$
- }
- }
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2016 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.activity.edit.advices;
+
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.ImportUMLPrimitiveTypePackageCommand;
+import org.eclipse.papyrus.uml.diagram.activity.edit.commands.util.PinUpdateCommand;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.PinUpdaterFactory;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.UpdaterPinUtils;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.AutomatedModelCompletionPreferencesInitializer;
+import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.preferences.IAutomatedModelCompletionPreferencesConstants;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.ValueSpecificationAction;
+
+/**
+ *
+ * Pin of ValueSpecificationAction should be create and update automatically
+ * @since 3.0
+ *
+ */
+public class ValueSpecificationActionEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
+ // 1] get the preference for ValueSpecificationAction
+ final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
+ boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.VALUE_SPECIFICATION_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
+ // 2] check preference
+ if (synchronizePin) {
+ Package root = PackageUtil.getRootPackage((Element) request.getElementToConfigure());
+ if (!UpdaterPinUtils.isPrimitiveTypeLibraryImported(root)) {
+ // 3] call the command to import the UML primitive types package
+ return new ImportUMLPrimitiveTypePackageCommand("Import UML primitive type package", root); //$NON-NLS-1$
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ protected ICommand getAfterSetCommand(SetRequest request) {
+ // 1] check if the setFeature is value
+ if (request.getFeature().equals(UMLPackage.eINSTANCE.getValueSpecificationAction_Value())) {
+ // 2] get the preference for ValueSpecificationAction
+ final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
+ boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.VALUE_SPECIFICATION_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
+ // 3] check preference
+ if (synchronizePin) {
+ ValueSpecificationAction valueSpecificationAction = (ValueSpecificationAction) request.getElementToEdit();
+ if (valueSpecificationAction != null && request.getFeature() == UMLPackage.eINSTANCE.getValueSpecificationAction_Value()) {
+ // 4] call the command for the ValueSpecificationAction
+ IPinUpdater<ValueSpecificationAction> updater = PinUpdaterFactory.getInstance().instantiate(valueSpecificationAction);
+ return new PinUpdateCommand<ValueSpecificationAction>("Update value specification action pins", updater, valueSpecificationAction); //$NON-NLS-1$
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ protected ICommand getAfterConfigureCommand(ConfigureRequest request) {
+ // 1] get the preference for ValueSpecificationAction
+ final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
+ boolean synchronizePin = (prefStore.getString(IAutomatedModelCompletionPreferencesConstants.VALUE_SPECIFICATION_ACTION).equals(AutomatedModelCompletionPreferencesInitializer.PIN_SYNCHRONIZATION));
+ // 2] check preference
+ if (synchronizePin) {
+ ValueSpecificationAction valueSpecificationAction = (ValueSpecificationAction) request.getElementToConfigure();
+ if (valueSpecificationAction != null) {
+ // 3] call the command for the ValueSpecificationAction
+ return new PinUpdateCommand<ValueSpecificationAction>("Update value specification action pins", PinUpdaterFactory.getInstance().instantiate(valueSpecificationAction), valueSpecificationAction); //$NON-NLS-1$
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/ActivityNodeCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/ActivityNodeCreateCommand.java
index 4438ebbd0f7..d7c36e9f72c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/ActivityNodeCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/ActivityNodeCreateCommand.java
@@ -1,58 +1,58 @@
-package org.eclipse.papyrus.uml.diagram.activity.edit.commands;
-
-import java.util.Collections;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.edit.command.CreateChildCommand;
-import org.eclipse.gmf.runtime.emf.core.util.PackageUtil;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * initialize the emf command that will add the child element
- * it call the emf command written in the uml plugin. So it called specific code to add nodes into
- * an Activity
- *
- */
-public abstract class ActivityNodeCreateCommand extends EditElementCommand {
-
- protected Command emfcmd;
-
- public ActivityNodeCreateCommand(String label, EObject elementToEdit, IEditCommandRequest request) {
- super(label, elementToEdit, request);
- }
-
- /**
- * initialize the emf command that will add the child element
- *
- * @return the created child
- */
- protected Element initAndExecuteEmfCommand(Element newElement) throws ExecutionException {
- EReference containmentFeature = PackageUtil.findFeature(getElementToEdit().eClass(), newElement.eClass());
- emfcmd = new CreateChildCommand(getEditingDomain(), getElementToEdit(), containmentFeature, newElement, Collections.EMPTY_LIST);
- emfcmd.canExecute();
- emfcmd.execute();
-
- return newElement;
- }
-
- @Override
- protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- emfcmd.undo();
- return super.doUndo(monitor, info);
- }
-
- @Override
- protected IStatus doRedo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IStatus status = super.doRedo(monitor, info);
- emfcmd.redo();
- return status;
- }
-}
+package org.eclipse.papyrus.uml.diagram.activity.edit.commands;
+
+import java.util.Collections;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.edit.command.CreateChildCommand;
+import org.eclipse.gmf.runtime.emf.core.util.PackageUtil;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * initialize the emf command that will add the child element
+ * it call the emf command written in the uml plugin. So it called specific code to add nodes into
+ * an Activity
+ *
+ */
+public abstract class ActivityNodeCreateCommand extends EditElementCommand {
+
+ protected Command emfcmd;
+
+ public ActivityNodeCreateCommand(String label, EObject elementToEdit, IEditCommandRequest request) {
+ super(label, elementToEdit, request);
+ }
+
+ /**
+ * initialize the emf command that will add the child element
+ *
+ * @return the created child
+ */
+ protected Element initAndExecuteEmfCommand(Element newElement) throws ExecutionException {
+ EReference containmentFeature = PackageUtil.findFeature(getElementToEdit().eClass(), newElement.eClass());
+ emfcmd = new CreateChildCommand(getEditingDomain(), getElementToEdit(), containmentFeature, newElement, Collections.EMPTY_LIST);
+ emfcmd.canExecute();
+ emfcmd.execute();
+
+ return newElement;
+ }
+
+ @Override
+ protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ emfcmd.undo();
+ return super.doUndo(monitor, info);
+ }
+
+ @Override
+ protected IStatus doRedo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IStatus status = super.doRedo(monitor, info);
+ emfcmd.redo();
+ return status;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/DeferredInterruptibleEdgeCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/DeferredInterruptibleEdgeCommand.java
index 0cdd6a60d9f..6e59421c35d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/DeferredInterruptibleEdgeCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/DeferredInterruptibleEdgeCommand.java
@@ -1,79 +1,79 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Atos - Initial API and implementation
- * Arthur Daussy Bug 366159 - [ActivityDiagram] Activity Diagram should be able to handle correctly Interruptible Edge
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.edit.commands;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest.ConnectionViewDescriptor;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.activity.edit.part.interfaces.InterruptibleEdge;
-import org.eclipse.papyrus.uml.diagram.activity.request.InterruptibleEdgeRequest;
-import org.eclipse.uml2.uml.ActivityEdge;
-
-/**
- * Command to set an Activity Edge as an Interruptible Edge.
- * This common is deferred this mean that the command will be created and executed in the doExecuteCommand.
- * This can prevent undo however this way drag and drop works
- * In order to make this command to work the target EditPart has to implement {@link InterruptibleEdge}
- *
- * @author adaussy
- *
- */
-public class DeferredInterruptibleEdgeCommand extends AbstractTransactionalCommand {
-
- /**
- * {@link IGraphicalEditPart} of the {@link ActivityEdge} which implements {@link InterruptibleEdge}
- */
- private EditPart hostEditPart;
-
- /**
- * {@link ConnectionViewDescriptor} from creation mechanism
- */
- private ConnectionViewDescriptor descriptor;
-
- /**
- * Constructor {@link DeferredInterruptibleEdgeCommand#descriptor} and {@link DeferredInterruptibleEdgeCommand#hostEditPart}
- */
- public DeferredInterruptibleEdgeCommand(TransactionalEditingDomain domain, String label, List affectedFiles, EditPart hostEditPart, ConnectionViewDescriptor descriptor) {
- super(domain, label, affectedFiles);
- this.hostEditPart = hostEditPart;
- this.descriptor = descriptor;
- }
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- Object connectionEditPart = hostEditPart.getViewer().getEditPartRegistry().get(descriptor.getAdapter(View.class));
- if (connectionEditPart instanceof IGraphicalEditPart && connectionEditPart instanceof InterruptibleEdge) {
- InterruptibleEdgeRequest request = new InterruptibleEdgeRequest();
- request.setType(InterruptibleEdgeRequest.SET_INTERRUPTIBLE_EDGE);
- Command cmd = ((IGraphicalEditPart) connectionEditPart).getCommand(request);
- if (cmd != null && cmd.canExecute()) {
- cmd.execute();
- } else {
- return CommandResult.newErrorCommandResult("Unable to the the target Editpart as Interruptible Edge");//
- }
- }
- return CommandResult.newOKCommandResult();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * 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:
+ * Atos - Initial API and implementation
+ * Arthur Daussy Bug 366159 - [ActivityDiagram] Activity Diagram should be able to handle correctly Interruptible Edge
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.activity.edit.commands;
+
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest.ConnectionViewDescriptor;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.activity.edit.part.interfaces.InterruptibleEdge;
+import org.eclipse.papyrus.uml.diagram.activity.request.InterruptibleEdgeRequest;
+import org.eclipse.uml2.uml.ActivityEdge;
+
+/**
+ * Command to set an Activity Edge as an Interruptible Edge.
+ * This common is deferred this mean that the command will be created and executed in the doExecuteCommand.
+ * This can prevent undo however this way drag and drop works
+ * In order to make this command to work the target EditPart has to implement {@link InterruptibleEdge}
+ *
+ * @author adaussy
+ *
+ */
+public class DeferredInterruptibleEdgeCommand extends AbstractTransactionalCommand {
+
+ /**
+ * {@link IGraphicalEditPart} of the {@link ActivityEdge} which implements {@link InterruptibleEdge}
+ */
+ private EditPart hostEditPart;
+
+ /**
+ * {@link ConnectionViewDescriptor} from creation mechanism
+ */
+ private ConnectionViewDescriptor descriptor;
+
+ /**
+ * Constructor {@link DeferredInterruptibleEdgeCommand#descriptor} and {@link DeferredInterruptibleEdgeCommand#hostEditPart}
+ */
+ public DeferredInterruptibleEdgeCommand(TransactionalEditingDomain domain, String label, List affectedFiles, EditPart hostEditPart, ConnectionViewDescriptor descriptor) {
+ super(domain, label, affectedFiles);
+ this.hostEditPart = hostEditPart;
+ this.descriptor = descriptor;
+ }
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ Object connectionEditPart = hostEditPart.getViewer().getEditPartRegistry().get(descriptor.getAdapter(View.class));
+ if (connectionEditPart instanceof IGraphicalEditPart && connectionEditPart instanceof InterruptibleEdge) {
+ InterruptibleEdgeRequest request = new InterruptibleEdgeRequest();
+ request.setType(InterruptibleEdgeRequest.SET_INTERRUPTIBLE_EDGE);
+ Command cmd = ((IGraphicalEditPart) connectionEditPart).getCommand(request);
+ if (cmd != null && cmd.canExecute()) {
+ cmd.execute();
+ } else {
+ return CommandResult.newErrorCommandResult("Unable to the the target Editpart as Interruptible Edge");//
+ }
+ }
+ return CommandResult.newOKCommandResult();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/util/CreateCommandUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/util/CreateCommandUtil.java
index ac634f166af..5149f6f3ea4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/util/CreateCommandUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/commands/util/CreateCommandUtil.java
@@ -1,183 +1,183 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.edit.commands.util;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.uml2.uml.Activity;
-import org.eclipse.uml2.uml.ActivityNode;
-import org.eclipse.uml2.uml.ActivityPartition;
-import org.eclipse.uml2.uml.StructuredActivi