Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreperico2010-01-26 14:13:57 +0000
committereperico2010-01-26 14:13:57 +0000
commite5534b086bb140547fa7719df050b01d84e6008b (patch)
tree4fc7a0c75498ff161b8320b95c3f791931bb2707
parenta15eeb9e7ee1a72769aeb039f3ac0931697a7f86 (diff)
downloadorg.eclipse.papyrus-e5534b086bb140547fa7719df050b01d84e6008b.tar.gz
org.eclipse.papyrus-e5534b086bb140547fa7719df050b01d84e6008b.tar.xz
org.eclipse.papyrus-e5534b086bb140547fa7719df050b01d84e6008b.zip
NEW - bug 297809: [Activity Diagram] Provide an activity diagram based on Papyrus generator
https://bugs.eclipse.org/bugs/show_bug.cgi?id=297809 - Add features: Actions (CallOperation, Opaque and CallBehavior) Pins: Input, Output, Value, ActionsInput Edges: ControlFlow, ObjectFlow Local Pre and Post condition CallOperation and CallBehavior: pin synchronization
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/.settings/activityDiagram.gmfgen.prefs4
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/META-INF/MANIFEST.MF3
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/build.properties3
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/commands/CreateActionLocalConditionViewCommand.java178
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/commands/CreateObjectFlowBehaviorViewCommand.java178
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/commands/SetValueSpecificationValueCommand.java51
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/actions/RestoreRelatedLinksAction.java78
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/commands/RestoreRelatedLinksCommand.java335
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/ConfirmPinAndParameterSyncDialog.java69
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/CreateCallActionDialog.java688
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/CreateCallBehaviorActionDialog.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/CreateCallOperationActionDialog.java151
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/WarningAndLinkDialog.java104
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/policies/CreateActionLocalConditionEditPolicy.java57
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/policies/CreateObjectFlowBehaviorEditPolicy.java57
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/policies/CustomDiagramDragDropEditPolicy.java291
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/figures/CenteredWrappedLabel.java34
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/figures/WrappedLabel.java34
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/helper/ActivityFigureDrawer.java248
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/helper/ActivityLinkMappingHelper.java36
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/helper/PinAndParameterSynchronizer.java1260
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/locator/PinPositionLocator.java247
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/ActivityEdgeWeightParser.java188
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/CallBehaviorActionParser.java144
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/CallOperationActionParser.java194
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/ExceptionPinTriangleParser.java157
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/PinParser.java157
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/PinValueParser.java244
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/providers/ActivityDiagramContributionItemProvider.java36
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/messages.properties164
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfgen4689
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfgraph221
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfmap1020
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmftool376
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.trace210
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/plugin.properties29
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/plugin.xml744
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInCallBeActCreateCommand.java134
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInCallOpActAsTargetCreateCommand.java138
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInCallOpActCreateCommand.java134
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInOpaqueActCreateCommand.java134
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPostconditionCreateCommand.java109
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPostconditionReorientCommand.java161
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPreconditionCreateCommand.java109
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPreconditionReorientCommand.java161
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActivityAsSelectionCreateCommand.java136
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActivityAsTransformationCreateCommand.java136
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActivityFinalNodeCreateCommand.java2
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/CallBehaviorActionCreateCommand.java151
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/CallOperationActionCreateCommand.java151
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintAsLocalPostcondCreateCommand.java134
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintAsLocalPrecondCreateCommand.java134
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintInActivityAsPostcondCreateCommand.java137
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintInActivityAsPrecondCreateCommand.java137
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ControlFlowCreateCommand.java171
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ControlFlowReorientCommand.java170
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/FlowFinalNodeCreateCommand.java2
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InitialNodeCreateCommand.java2
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInCallBeActCreateCommand.java134
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInCallOpActAsTargetCreateCommand.java138
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInCallOpActCreateCommand.java134
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInOpaqueActCreateCommand.java134
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowCreateCommand.java171
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowReorientCommand.java170
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowSelectionCreateCommand.java109
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowSelectionReorientCommand.java160
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowTransformationCreateCommand.java109
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowTransformationReorientCommand.java160
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OpaqueActionCreateCommand.java134
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInCallBeActCreateCommand.java134
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInCallOpActCreateCommand.java134
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInOpaqueActCreateCommand.java134
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ParameterCreateCommand.java2
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInCallBeActCreateCommand.java134
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInCallOpActAsTargetCreateCommand.java138
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInCallOpActCreateCommand.java134
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInOpaqueActCreateCommand.java134
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ActionInputPinEditHelper.java20
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/CallBehaviorActionEditHelper.java20
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/CallOperationActionEditHelper.java20
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ControlFlowEditHelper.java20
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/InputPinEditHelper.java20
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ObjectFlowEditHelper.java20
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/OpaqueActionEditHelper.java20
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/OutputPinEditHelper.java20
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ValuePinEditHelper.java20
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCBActLabelEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCBActValueEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActAsTargetLabelEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActAsTargetValueEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActLabelEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActValueEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCallBeActEditPart.java792
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCallOpActAsTargetEditPart.java792
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCallOpActEditPart.java792
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInOActLabelEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInOActValueEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInOpaqueActEditPart.java792
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionLocalPostconditionEditPart.java101
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionLocalPreconditionEditPart.java101
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsSelectionEditPart.java387
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsSelectionNameEditPart.java768
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsTransformationEditPart.java387
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsTransformationNameEditPart.java768
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityFinalNodeEditPart.java428
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallBehaviorActionEditPart.java1012
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallBehaviorActionNameEditPart.java768
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallOperationActionEditPart.java1012
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallOperationActionNameEditPart.java768
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPostcondEditPart.java432
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPostcondNameEditPart.java768
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPrecondEditPart.java432
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPrecondNameEditPart.java768
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintInActivityAsPostcondEditPart.java750
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintInActivityAsPrecondEditPart.java750
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ControlFlowEditPart.java178
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ControlFlowNameEditPart.java743
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ControlFlowWeightEditPart.java746
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/FlowFinalNodeEditPart.java428
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InitialNodeEditPart.java442
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCBActLabelEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCOActAsTargetLabelEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCOActLabelEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCallBeActEditPart.java791
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCallOpActAsTargetEditPart.java791
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCallOpActEditPart.java791
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInOActLabelEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInOpaqueActEditPart.java791
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinNameEditPart.java806
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowEditPart.java181
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowNameEditPart.java743
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowSelectionEditPart.java101
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowTransformationEditPart.java101
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowWeightEditPart.java746
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OpaqueActionEditPart.java964
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OpaqueActionNameEditPart.java768
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCBActLabelEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCOActLabelEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCallBeActEditPart.java791
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCallOpActEditPart.java791
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInOActLabelEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInOpaqueActEditPart.java791
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinNameEditPart.java806
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ParameterEditPart.java13
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/UMLEditPartFactory.java200
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCBActLabelEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCBActValueEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActAsTargetLabelEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActAsTargetValueEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActLabelEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActValueEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCallBeActEditPart.java792
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCallOpActAsTargetEditPart.java792
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCallOpActEditPart.java792
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInOActLabelEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInOActValueEditPart.java755
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInOpaqueActEditPart.java792
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInCallBeActItemSemanticEditPolicy.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInCallOpActAsTargetItemSemanticEditPolicy.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInCallOpActItemSemanticEditPolicy.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInOpaqueActItemSemanticEditPolicy.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionLocalPostconditionItemSemanticEditPolicy.java57
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionLocalPreconditionItemSemanticEditPolicy.java57
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityContentCompartmentCanonicalEditPolicy.java75
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityContentCompartmentItemSemanticEditPolicy.java27
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPostConditionsCompartmentCanonicalEditPolicy.java4
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPostConditionsCompartmentItemSemanticEditPolicy.java4
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPreConditionsCompartmentCanonicalEditPolicy.java4
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPreConditionsCompartmentItemSemanticEditPolicy.java4
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityAsSelectionItemSemanticEditPolicy.java136
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityAsTransformationItemSemanticEditPolicy.java136
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityCanonicalEditPolicy.java422
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityFinalNodeItemSemanticEditPolicy.java92
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityItemSemanticEditPolicy.java524
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallBehaviorActionCanonicalEditPolicy.java93
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallBehaviorActionItemSemanticEditPolicy.java416
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallOperationActionCanonicalEditPolicy.java158
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallOperationActionItemSemanticEditPolicy.java536
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintAsLocalPostcondItemSemanticEditPolicy.java164
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintAsLocalPrecondItemSemanticEditPolicy.java164
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintInActivityAsPostcondItemSemanticEditPolicy.java57
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintInActivityAsPrecondItemSemanticEditPolicy.java57
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ControlFlowItemSemanticEditPolicy.java40
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/FlowFinalNodeItemSemanticEditPolicy.java92
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InitialNodeItemSemanticEditPolicy.java92
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInCallBeActItemSemanticEditPolicy.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInCallOpActAsTargetItemSemanticEditPolicy.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInCallOpActItemSemanticEditPolicy.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInOpaqueActItemSemanticEditPolicy.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ObjectFlowItemSemanticEditPolicy.java98
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ObjectFlowSelectionItemSemanticEditPolicy.java40
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ObjectFlowTransformationItemSemanticEditPolicy.java40
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OpaqueActionCanonicalEditPolicy.java93
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OpaqueActionItemSemanticEditPolicy.java416
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OutputPinInCallBeActItemSemanticEditPolicy.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OutputPinInCallOpActItemSemanticEditPolicy.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OutputPinInOpaqueActItemSemanticEditPolicy.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/UMLBaseItemSemanticEditPolicy.java120
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInCallBeActItemSemanticEditPolicy.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInCallOpActAsTargetItemSemanticEditPolicy.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInCallOpActItemSemanticEditPolicy.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInOpaqueActItemSemanticEditPolicy.java153
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/navigator/UMLNavigatorContentProvider.java1449
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/navigator/UMLNavigatorLabelProvider.java520
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/Messages.java547
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/UMLDiagramUpdater.java1500
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/UMLPaletteFactory.java256
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/UMLVisualIDRegistry.java615
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ActionInputPinPreferencePage.java52
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/CallBehaviorActionPreferencePage.java52
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/CallOperationActionPreferencePage.java52
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ControlFlowPreferencePage.java40
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/DiagramPreferenceInitializer.java30
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/InputPinPreferencePage.java52
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ObjectFlowPreferencePage.java40
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/OpaqueActionPreferencePage.java52
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/OutputPinPreferencePage.java52
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ValuePinPreferencePage.java52
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/ElementInitializers.java596
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLElementTypes.java340
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLModelingAssistantProvider.java386
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLParserProvider.java651
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLViewProvider.java991
223 files changed, 79701 insertions, 793 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/.settings/activityDiagram.gmfgen.prefs b/plugins/uml/org.eclipse.papyrus.diagram.activity/.settings/activityDiagram.gmfgen.prefs
index d676d4c93ea..00b447d3038 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/.settings/activityDiagram.gmfgen.prefs
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/.settings/activityDiagram.gmfgen.prefs
@@ -1,7 +1,7 @@
-#Mon Nov 30 12:01:01 CET 2009
+#Tue Dec 15 15:15:45 CET 2009
eclipse.preferences.version=1
generate_rcp=false
ignore_gmfgen_validation=true
-ignore_mapmodel_validation=false
+ignore_mapmodel_validation=true
use_map_mode=true
use_runtime_figures=true
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/META-INF/MANIFEST.MF b/plugins/uml/org.eclipse.papyrus.diagram.activity/META-INF/MANIFEST.MF
index 790b4fedc14..c733c27d305 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/META-INF/MANIFEST.MF
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.papyrus.diagram.activity; singleton:=true
-Bundle-Version: 0.7.0.vqualifier
+Bundle-Version: 0.0.1.qualifier
Require-Bundle: org.eclipse.emf.ecore,
org.eclipse.core.runtime,
org.eclipse.core.resources,
@@ -47,3 +47,4 @@ Export-Package: org.eclipse.papyrus.diagram.activity.edit.parts,
org.eclipse.papyrus.diagram.activity.providers
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Eclipse-LazyStart: true
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/build.properties b/plugins/uml/org.eclipse.papyrus.diagram.activity/build.properties
index 22645ebec8a..162d13adf7d 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/build.properties
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/build.properties
@@ -6,6 +6,5 @@ bin.includes = .,\
messages.properties,\
.options
jars.compile.order = .
-source.. = src/,\
- custom-src/
+source.. = src/
output.. = bin/
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/commands/CreateActionLocalConditionViewCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/commands/CreateActionLocalConditionViewCommand.java
new file mode 100644
index 00000000000..4ae0eb2a859
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/commands/CreateActionLocalConditionViewCommand.java
@@ -0,0 +1,178 @@
+/*****************************************************************************
+ * 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.diagram.activity.commands;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.papyrus.core.utils.EditorUtils;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ConstraintAsLocalPostcondCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ConstraintAsLocalPrecondCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityContentCompartmentEditPart;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.common.commands.CommonDeferredCreateConnectionViewCommand;
+import org.eclipse.papyrus.diagram.common.commands.SemanticAdapter;
+import org.eclipse.uml2.uml.Constraint;
+
+/**
+ * This command creates an action's local condition, then the corresponding edit part and the link between the condition and the action.
+ */
+public class CreateActionLocalConditionViewCommand extends Command {
+
+ /** The compartment which graphically contains the Constraint to create */
+ private ActivityActivityContentCompartmentEditPart compartment = null;
+
+ /** The command to create the Constraint element */
+ private ICommandProxy elementCreationCommand = null;
+
+ /** The command to create corresponding views (constraint view and link view) */
+ private CompoundCommand viewsCreationCommand = null;
+
+ /** The edit part of the action containing the Constraint element */
+ private EditPart linkedActionEditPart;
+
+ /** The type of local condition to create */
+ private IHintedType type;
+
+ /**
+ * Constructor a new action to create the local condition and corresponding views.
+ *
+ * @param conditionType
+ * the type of the local condition : precondition (Constraint_3011) or postcondition (Constraint_3012)
+ * @param graphicalParent
+ * the parent edit part which graphically contains the condition
+ * @param containerAction
+ * the action which owns the local condition to create
+ * @param actionPart
+ * the part of the action owning the condition
+ */
+ public CreateActionLocalConditionViewCommand(IHintedType conditionType, ActivityActivityContentCompartmentEditPart graphicalParent, EObject containerAction, EditPart actionPart) {
+ elementCreationCommand = getElementCreationCommand(containerAction, conditionType);
+ compartment = graphicalParent;
+ linkedActionEditPart = actionPart;
+ type = conditionType;
+ }
+
+ /**
+ * Get the Command to create the constraint element
+ *
+ * @param containerAction
+ * the action which owns the local condition to create
+ * @param conditionType
+ * the type of the local condition : precondition (Constraint_3011) or postcondition (Constraint_3012)
+ * @return the command to create model element or null
+ */
+ private static ICommandProxy getElementCreationCommand(EObject containerAction, IHintedType conditionType) {
+ CreateElementRequest createElementReq = new CreateElementRequest(containerAction, conditionType);
+ if(UMLElementTypes.Constraint_3011.equals(conditionType)) {
+ ConstraintAsLocalPrecondCreateCommand cmd = new ConstraintAsLocalPrecondCreateCommand(createElementReq);
+ return new ICommandProxy(cmd);
+ } else if(UMLElementTypes.Constraint_3012.equals(conditionType)) {
+ ConstraintAsLocalPostcondCreateCommand cmd = new ConstraintAsLocalPostcondCreateCommand(createElementReq);
+ return new ICommandProxy(cmd);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Get the corresponding local condition link type
+ *
+ * @return link type or null
+ */
+ private IHintedType getLinkType() {
+ if(UMLElementTypes.Constraint_3011.equals(type)) {
+ return (IHintedType)UMLElementTypes.ActionLocalPrecondition_4001;
+ } else if(UMLElementTypes.Constraint_3012.equals(type)) {
+ return (IHintedType)UMLElementTypes.ActionLocalPostcondition_4002;
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public boolean canExecute() {
+ return elementCreationCommand != null && elementCreationCommand.canExecute();
+ }
+
+ /**
+ * Execute the command : create the model element, then the corresponding views
+ *
+ * @see org.eclipse.gef.commands.Command#execute()
+ */
+ @Override
+ public void execute() {
+ Object constraint = null;
+ if(elementCreationCommand != null) {
+ elementCreationCommand.execute();
+ constraint = elementCreationCommand.getICommand().getCommandResult().getReturnValue();
+ }
+ if(constraint instanceof Constraint && compartment != null && type != null) {
+ // construct the complete command for views creation and execute it.
+ viewsCreationCommand = new CompoundCommand();
+ // creation of the node by the compartment
+ ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(new EObjectAdapter((EObject)constraint), Node.class, type.getSemanticHint(), compartment.getDiagramPreferencesHint());
+ CreateViewRequest request = new CreateViewRequest(descriptor);
+ Command nodeCreationCommand = compartment.getCommand(request);
+ viewsCreationCommand.add(nodeCreationCommand);
+
+ // try and recover the created edit part, then create the link
+ if(nodeCreationCommand instanceof CompoundCommand && linkedActionEditPart != null && getLinkType() != null) {
+ Object[] childrenCmd = ((CompoundCommand)nodeCreationCommand).getChildren();
+ if(childrenCmd.length > 0 && childrenCmd[0] instanceof ICommandProxy) {
+ ICommand createConstraintNodeCommand = ((ICommandProxy)childrenCmd[0]).getICommand();
+ // creation of the link between edit parts
+ IAdaptable targetAdapter = (IAdaptable)createConstraintNodeCommand.getCommandResult().getReturnValue();
+ IAdaptable sourceAdapter = new SemanticAdapter(null, linkedActionEditPart.getModel());
+ // descriptor of the link
+ CreateConnectionViewRequest.ConnectionViewDescriptor linkdescriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(getLinkType(), getLinkType().getSemanticHint(), compartment.getDiagramPreferencesHint());
+ CommonDeferredCreateConnectionViewCommand aLinkCommand = new CommonDeferredCreateConnectionViewCommand(EditorUtils.getTransactionalEditingDomain(), getLinkType().getSemanticHint(), sourceAdapter, targetAdapter, compartment.getViewer(), compartment.getDiagramPreferencesHint(), linkdescriptor, null);
+ aLinkCommand.setElement((EObject)constraint);
+ viewsCreationCommand.add(new ICommandProxy(aLinkCommand));
+ }
+ }
+
+ viewsCreationCommand.execute();
+ }
+ }
+
+ /**
+ * Undo model and views creation
+ *
+ * @see org.eclipse.gef.commands.Command#undo()
+ */
+ @Override
+ public void undo() {
+ if(viewsCreationCommand != null) {
+ viewsCreationCommand.undo();
+ }
+ if(elementCreationCommand != null) {
+ elementCreationCommand.undo();
+ }
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/commands/CreateObjectFlowBehaviorViewCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/commands/CreateObjectFlowBehaviorViewCommand.java
new file mode 100644
index 00000000000..d1b5d0b2818
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/commands/CreateObjectFlowBehaviorViewCommand.java
@@ -0,0 +1,178 @@
+/*****************************************************************************
+ * 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.diagram.activity.commands;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.papyrus.core.utils.EditorUtils;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ConstraintAsLocalPostcondCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ConstraintAsLocalPrecondCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityContentCompartmentEditPart;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.common.commands.CommonDeferredCreateConnectionViewCommand;
+import org.eclipse.papyrus.diagram.common.commands.SemanticAdapter;
+import org.eclipse.uml2.uml.Constraint;
+
+/**
+ * This command creates an action's local condition, then the corresponding edit part and the link between the condition and the action.
+ */
+public class CreateObjectFlowBehaviorViewCommand extends Command {
+
+ /** The compartment which graphically contains the Constraint to create */
+ private ActivityActivityContentCompartmentEditPart compartment = null;
+
+ /** The command to create the Constraint element */
+ private ICommandProxy elementCreationCommand = null;
+
+ /** The command to create corresponding views (constraint view and link view) */
+ private CompoundCommand viewsCreationCommand = null;
+
+ /** The edit part of the action containing the Constraint element */
+ private EditPart linkedActionEditPart;
+
+ /** The type of local condition to create */
+ private IHintedType type;
+
+ /**
+ * Constructor a new action to create the local condition and corresponding views.
+ *
+ * @param conditionType
+ * the type of the local condition : precondition (Constraint_3011) or postcondition (Constraint_3012)
+ * @param graphicalParent
+ * the parent edit part which graphically contains the condition
+ * @param containerAction
+ * the action which owns the local condition to create
+ * @param actionPart
+ * the part of the action owning the condition
+ */
+ public CreateObjectFlowBehaviorViewCommand(IHintedType conditionType, ActivityActivityContentCompartmentEditPart graphicalParent, EObject containerAction, EditPart actionPart) {
+ elementCreationCommand = getElementCreationCommand(containerAction, conditionType);
+ compartment = graphicalParent;
+ linkedActionEditPart = actionPart;
+ type = conditionType;
+ }
+
+ /**
+ * Get the Command to create the constraint element
+ *
+ * @param containerAction
+ * the action which owns the local condition to create
+ * @param conditionType
+ * the type of the local condition : precondition (Constraint_3011) or postcondition (Constraint_3012)
+ * @return the command to create model element or null
+ */
+ private static ICommandProxy getElementCreationCommand(EObject containerAction, IHintedType conditionType) {
+ CreateElementRequest createElementReq = new CreateElementRequest(containerAction, conditionType);
+ if(UMLElementTypes.Constraint_3011.equals(conditionType)) {
+ ConstraintAsLocalPrecondCreateCommand cmd = new ConstraintAsLocalPrecondCreateCommand(createElementReq);
+ return new ICommandProxy(cmd);
+ } else if(UMLElementTypes.Constraint_3012.equals(conditionType)) {
+ ConstraintAsLocalPostcondCreateCommand cmd = new ConstraintAsLocalPostcondCreateCommand(createElementReq);
+ return new ICommandProxy(cmd);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Get the corresponding local condition link type
+ *
+ * @return link type or null
+ */
+ private IHintedType getLinkType() {
+ if(UMLElementTypes.Constraint_3011.equals(type)) {
+ return (IHintedType)UMLElementTypes.ActionLocalPrecondition_4001;
+ } else if(UMLElementTypes.Constraint_3012.equals(type)) {
+ return (IHintedType)UMLElementTypes.ActionLocalPostcondition_4002;
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public boolean canExecute() {
+ return elementCreationCommand != null && elementCreationCommand.canExecute();
+ }
+
+ /**
+ * Execute the command : create the model element, then the corresponding views
+ *
+ * @see org.eclipse.gef.commands.Command#execute()
+ */
+ @Override
+ public void execute() {
+ Object constraint = null;
+ if(elementCreationCommand != null) {
+ elementCreationCommand.execute();
+ constraint = elementCreationCommand.getICommand().getCommandResult().getReturnValue();
+ }
+ if(constraint instanceof Constraint && compartment != null && type != null) {
+ // construct the complete command for views creation and execute it.
+ viewsCreationCommand = new CompoundCommand();
+ // creation of the node by the compartment
+ ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(new EObjectAdapter((EObject)constraint), Node.class, type.getSemanticHint(), compartment.getDiagramPreferencesHint());
+ CreateViewRequest request = new CreateViewRequest(descriptor);
+ Command nodeCreationCommand = compartment.getCommand(request);
+ viewsCreationCommand.add(nodeCreationCommand);
+
+ // try and recover the created edit part, then create the link
+ if(nodeCreationCommand instanceof CompoundCommand && linkedActionEditPart != null && getLinkType() != null) {
+ Object[] childrenCmd = ((CompoundCommand)nodeCreationCommand).getChildren();
+ if(childrenCmd.length > 0 && childrenCmd[0] instanceof ICommandProxy) {
+ ICommand createConstraintNodeCommand = ((ICommandProxy)childrenCmd[0]).getICommand();
+ // creation of the link between edit parts
+ IAdaptable targetAdapter = (IAdaptable)createConstraintNodeCommand.getCommandResult().getReturnValue();
+ IAdaptable sourceAdapter = new SemanticAdapter(null, linkedActionEditPart.getModel());
+ // descriptor of the link
+ CreateConnectionViewRequest.ConnectionViewDescriptor linkdescriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(getLinkType(), getLinkType().getSemanticHint(), compartment.getDiagramPreferencesHint());
+ CommonDeferredCreateConnectionViewCommand aLinkCommand = new CommonDeferredCreateConnectionViewCommand(EditorUtils.getTransactionalEditingDomain(), getLinkType().getSemanticHint(), sourceAdapter, targetAdapter, compartment.getViewer(), compartment.getDiagramPreferencesHint(), linkdescriptor, null);
+ aLinkCommand.setElement((EObject)constraint);
+ viewsCreationCommand.add(new ICommandProxy(aLinkCommand));
+ }
+ }
+
+ viewsCreationCommand.execute();
+ }
+ }
+
+ /**
+ * Undo model and views creation
+ *
+ * @see org.eclipse.gef.commands.Command#undo()
+ */
+ @Override
+ public void undo() {
+ if(viewsCreationCommand != null) {
+ viewsCreationCommand.undo();
+ }
+ if(elementCreationCommand != null) {
+ elementCreationCommand.undo();
+ }
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/commands/SetValueSpecificationValueCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/commands/SetValueSpecificationValueCommand.java
new file mode 100644
index 00000000000..85c8baa8630
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/commands/SetValueSpecificationValueCommand.java
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * 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.diagram.activity.commands;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.papyrus.umlutils.ValueSpecificationUtil;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+
+public class SetValueSpecificationValueCommand extends Command {
+
+ private ValueSpecification targetElement;
+
+ private String newValue;
+
+ private String oldValue;
+
+ public SetValueSpecificationValueCommand(ValueSpecification valueSpec, String newString) {
+ super("Set value");
+ targetElement = valueSpec;
+ newValue = newString;
+ oldValue = null;
+ }
+
+ @Override
+ public boolean canExecute() {
+ return targetElement != null && newValue != null;
+ }
+
+ @Override
+ public void execute() {
+ ValueSpecificationUtil.restoreSpecificationValue(targetElement, newValue);
+ }
+
+ @Override
+ public void undo() {
+ ValueSpecificationUtil.restoreSpecificationValue(targetElement, oldValue);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/actions/RestoreRelatedLinksAction.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/actions/RestoreRelatedLinksAction.java
new file mode 100644
index 00000000000..2c0ccb60cbc
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/actions/RestoreRelatedLinksAction.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.diagram.activity.edit.actions;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.RestoreRelatedLinksCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityDiagramEditPart;
+import org.eclipse.papyrus.diagram.common.actions.AbstractAction;
+
+/**
+ * Restore related links to selected element
+ *
+ * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a>
+ */
+public class RestoreRelatedLinksAction extends AbstractAction {
+
+ public static String ID = "papyrus.restoreRelatedLinksAction";
+
+ public RestoreRelatedLinksAction() {
+ setId(ID);
+ setText("Restore Related Elements");
+ setToolTipText("Restore Related Elements");
+ // setImageDescriptor(Plugin.getBundledImageDescriptor("icons/*.gif"));
+ }
+
+ /**
+ * @return
+ */
+ protected String getDiagramNotationID() {
+ return ActivityDiagramEditPart.MODEL_ID;
+ }
+
+ /**
+ * @see org.eclipse.jface.action.Action#isEnabled()
+ */
+ @Override
+ public boolean isEnabled() {
+ return (!getSelection().isEmpty() && getDiagramNotationID().equals(getCurrentDiagram().getType()));
+ }
+
+ /**
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ List<View> selection = getSelection();
+
+ if(selection.isEmpty()) {
+ return;
+ }
+
+ if(false == getHost() instanceof DiagramEditPart) {
+ return;
+ }
+ DiagramEditPart diagramEditPart = (DiagramEditPart)getHost();
+
+ final DiagramCommandStack commandStack = getHost().getDiagramEditDomain().getDiagramCommandStack();
+ CompoundCommand cmd = new CompoundCommand("Restore Related Links");
+ cmd.add(new ICommandProxy(new RestoreRelatedLinksCommand(diagramEditPart, selection)));
+ commandStack.execute(cmd, new NullProgressMonitor());
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/commands/RestoreRelatedLinksCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/commands/RestoreRelatedLinksCommand.java
new file mode 100644
index 00000000000..43e22eb9e1c
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/commands/RestoreRelatedLinksCommand.java
@@ -0,0 +1,335 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.diagram.activity.edit.commands;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+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.core.commands.SetPropertyCommand;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.internal.properties.Properties;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityDiagramEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramUpdater;
+import org.eclipse.papyrus.diagram.activity.part.UMLLinkDescriptor;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.common.util.CommandUtil;
+
+/**
+ * Restore related links to selected element
+ *
+ * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a>
+ */
+// Inspired from EcoreTools source code
+public class RestoreRelatedLinksCommand extends AbstractTransactionalCommand {
+
+ protected List<?> adapters;
+
+ protected Diagram diagram;
+
+ protected DiagramEditPart host;
+
+ public RestoreRelatedLinksCommand(DiagramEditPart diagramEditPart, List<?> selection) {
+ super(diagramEditPart.getEditingDomain(), "Restore related links", null);
+ this.host = diagramEditPart;
+ this.diagram = host.getDiagramView();
+ this.adapters = selection;
+ }
+
+ private void cleanAdd(Collection<UMLLinkDescriptor> result, View view, List<?> descriptors) {
+ for(Object object : descriptors) {
+ if(false == object instanceof UMLLinkDescriptor) {
+ continue;
+ }
+ UMLLinkDescriptor descriptor = (UMLLinkDescriptor)object;
+ if(cleanContains(result, descriptor)) {
+ continue;
+ }
+ // check owner
+ if(!isOwner(view, descriptor)) {
+ continue;
+ }
+ result.add(descriptor);
+ }
+ }
+
+ /**
+ * Detect if similar descriptor already exist in given collection.
+ *
+ * @param collection
+ * the collection of unique ingoing and outgoing links descriptors
+ * @param umlLinkDescriptor
+ * the descriptor to search
+ * @return true if already exist
+ */
+ private boolean cleanContains(Collection<? extends UMLLinkDescriptor> collection, UMLLinkDescriptor umlLinkDescriptor) {
+ for(Object object : collection) {
+ if(object instanceof UMLLinkDescriptor) {
+ UMLLinkDescriptor descriptor = (UMLLinkDescriptor)object;
+ if(descriptor.getModelElement() == umlLinkDescriptor.getModelElement() && descriptor.getSource() == umlLinkDescriptor.getSource() && descriptor.getDestination() == umlLinkDescriptor.getDestination() && descriptor.getVisualID() == umlLinkDescriptor.getVisualID()) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Collects all related links for view
+ *
+ * @param view
+ * @param domain2NotationMap
+ *
+ * @return linkdescriptors
+ */
+ protected Collection<? extends UMLLinkDescriptor> collectPartRelatedLinks(View view, Map<EObject, View> domain2NotationMap) {
+ Collection<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ // We must prevent duplicate descriptors
+ List<?> outgoingDescriptors = UMLDiagramUpdater.getOutgoingLinks(view);
+ cleanAdd(result, view, outgoingDescriptors);
+
+ List<?> incomingDescriptors = UMLDiagramUpdater.getIncomingLinks(view);
+ cleanAdd(result, view, incomingDescriptors);
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ return result;
+ }
+
+ /**
+ * Create related links corresponding to linkDescriptions
+ *
+ * @param linkDescriptors
+ * @param domain2NotationMap
+ */
+ protected void createRelatedLinks(Collection<? extends UMLLinkDescriptor> linkDescriptors, Map<EObject, View> domain2NotationMap) {
+ // map diagram
+ mapModel(diagram, domain2NotationMap);
+
+ for(UMLLinkDescriptor nextLinkDescriptor : linkDescriptors) {
+ EditPart sourceEditPart = getEditPart(nextLinkDescriptor.getSource(), domain2NotationMap);
+ EditPart targetEditPart = getEditPart(nextLinkDescriptor.getDestination(), domain2NotationMap);
+
+ // If the parts are still null...
+ if(sourceEditPart == null || targetEditPart == null) {
+ continue;
+ }
+ CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(nextLinkDescriptor.getSemanticAdapter(), null, ViewUtil.APPEND, false, host.getDiagramPreferencesHint());
+ CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(descriptor);
+ ccr.setType(RequestConstants.REQ_CONNECTION_START);
+ ccr.setSourceEditPart(sourceEditPart);
+ sourceEditPart.getCommand(ccr);
+ ccr.setTargetEditPart(targetEditPart);
+ ccr.setType(RequestConstants.REQ_CONNECTION_END);
+ Command cmd = targetEditPart.getCommand(ccr);
+ if(cmd != null && cmd.canExecute()) {
+ CommandUtil.executeCommand(cmd, host);
+ }
+ }
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
+ * org.eclipse.core.runtime.IAdaptable)
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ // To register all EditPart in the global visualIDRegistry
+ host().refresh();
+
+ for(Object object : adapters) {
+ if(object instanceof IAdaptable) {
+ IAdaptable ad = (IAdaptable)object;
+ View view = (View)ad.getAdapter(View.class);
+ if(view != null) {
+ refreshRelatedLinks(view);
+ }
+ } else if(object instanceof View) {
+ refreshRelatedLinks((View)object);
+ }
+
+ }
+
+ return CommandResult.newOKCommandResult();
+ }
+
+ /**
+ * Retrieves editpart corresponding to domainModelElement
+ *
+ * @param domainModelElement
+ * @param domain2NotationMap
+ */
+ protected EditPart getEditPart(EObject domainModelElement, Map<? extends EObject, ? extends View> domain2NotationMap) {
+ View view = domain2NotationMap.get(domainModelElement);
+ if(view != null) {
+ return (EditPart)host.getViewer().getEditPartRegistry().get(view);
+ }
+ return null;
+ }
+
+ /**
+ * Get linkdescriptors of the related links for graphicalEditPart
+ *
+ * @param graphicalEditPart
+ * @param domain2NotationMap
+ *
+ * @return linkDescritors
+ */
+ protected Collection<? extends UMLLinkDescriptor> getLinkDescriptorToProcess(View notationView, Map<EObject, View> domain2NotationMap) {
+ // Collect all related link from semantic model
+ Collection<? extends UMLLinkDescriptor> linkDescriptors = collectPartRelatedLinks(notationView, domain2NotationMap);
+
+ // Collect all related link from graphical model
+ Collection<Edge> existingLinks = new LinkedList<Edge>();
+ for(Object edge : notationView.getTargetEdges()) {
+ if(edge instanceof Edge && false == existingLinks.contains(edge)) {
+ existingLinks.add((Edge)edge);
+ }
+ }
+ for(Object edge : notationView.getSourceEdges()) {
+ if(edge instanceof Edge && false == existingLinks.contains(edge)) {
+ existingLinks.add((Edge)edge);
+ }
+ }
+
+ // Set all existing related link visible
+ setViewVisible(existingLinks);
+
+ // Remove already existing links
+ for(Iterator<Edge> linksIterator = existingLinks.iterator(); linksIterator.hasNext();) {
+ Edge nextDiagramLink = linksIterator.next();
+ int diagramLinkVisualID = UMLVisualIDRegistry.getVisualID(nextDiagramLink);
+ if(diagramLinkVisualID == -1) {
+ if(nextDiagramLink.getSource() != null && nextDiagramLink.getTarget() != null) {
+ linksIterator.remove();
+ }
+ continue;
+ }
+ EObject diagramLinkObject = nextDiagramLink.getElement();
+ EObject diagramLinkSrc = nextDiagramLink.getSource().getElement();
+ EObject diagramLinkDst = nextDiagramLink.getTarget().getElement();
+ for(Iterator<? extends UMLLinkDescriptor> LinkDescriptorsIterator = linkDescriptors.iterator(); LinkDescriptorsIterator.hasNext();) {
+ UMLLinkDescriptor nextLinkDescriptor = LinkDescriptorsIterator.next();
+ if(diagramLinkObject == nextLinkDescriptor.getModelElement() && diagramLinkSrc == nextLinkDescriptor.getSource() && diagramLinkDst == nextLinkDescriptor.getDestination() && diagramLinkVisualID == nextLinkDescriptor.getVisualID()) {
+ linksIterator.remove();
+ LinkDescriptorsIterator.remove();
+ }
+ }
+ }
+ return linkDescriptors;
+ }
+
+ /**
+ * @return <code>(IGraphicalEditPart)host()</code>.
+ */
+ protected final IGraphicalEditPart host() {
+ return host;
+ }
+
+ private boolean isOwner(View view, UMLLinkDescriptor descriptor) {
+ EObject source = descriptor.getSource();
+ EObject dest = descriptor.getDestination();
+ if(source != null && source.equals(view.getElement())) {
+ return true;
+ }
+ if(dest != null && dest.equals(view.getElement())) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Maps view
+ *
+ * @param view
+ * @param domain2NotationMap
+ */
+ protected void mapModel(View view, Map<EObject, View> domain2NotationMap) {
+ if(!ActivityDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view))) {
+ return;
+ }
+
+ // register the view if its type allows incoming or outgoing links
+ if(!UMLDiagramUpdater.getOutgoingLinks(view).isEmpty() || !UMLDiagramUpdater.getIncomingLinks(view).isEmpty()) {
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) {
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ EList<View> children = view.getChildren();
+ for(View child : children) {
+ mapModel(child, domain2NotationMap);
+ }
+ @SuppressWarnings("unchecked")
+ EList<View> sourceEdges = view.getSourceEdges();
+ for(View edge : sourceEdges) {
+ mapModel(edge, domain2NotationMap);
+ }
+ }
+
+ /**
+ * Refresh related links for graphicalEditPart
+ *
+ * @param graphicalEditPart
+ */
+ protected void refreshRelatedLinks(View notationView) {
+ Map<EObject, View> domain2NotationMap = new HashMap<EObject, View>();
+
+ // Create related links
+ Collection<? extends UMLLinkDescriptor> linkDescriptors = getLinkDescriptorToProcess(notationView, domain2NotationMap);
+ createRelatedLinks(linkDescriptors, domain2NotationMap);
+ }
+
+ /**
+ * Set view visible
+ *
+ * @param part
+ * @param views
+ */
+ protected void setViewVisible(Collection<? extends View> views) {
+ for(View view : views) {
+ if(view.isVisible()) {
+ continue;
+ }
+ SetPropertyCommand cmd = new SetPropertyCommand(host.getEditingDomain(), "Restore related linksCommand show view", new EObjectAdapter(view), Properties.ID_ISVISIBLE, Boolean.TRUE);
+ if(cmd != null && cmd.canExecute()) {
+ CommandUtil.executeCommand(new ICommandProxy(cmd), host);
+ }
+ }
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/ConfirmPinAndParameterSyncDialog.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/ConfirmPinAndParameterSyncDialog.java
new file mode 100644
index 00000000000..581aabdb78d
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/ConfirmPinAndParameterSyncDialog.java
@@ -0,0 +1,69 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.dialogs;
+
+import java.util.List;
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.diagram.activity.part.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * This class enables to open a dialog to ask the user to confirm he wants to update a Parameter and associated Pins
+ *
+ */
+public class ConfirmPinAndParameterSyncDialog extends MessageDialog {
+
+ /**
+ * Protected constructor. Use {@link #openConfirmFromParameter(Shell)} or {@link #openConfirmFromPin(Shell)}
+ *
+ * @param parentShell
+ * the parent shell
+ * @param dialogMessage
+ * the message
+ */
+ protected ConfirmPinAndParameterSyncDialog(Shell parentShell, String dialogMessage) {
+ super(parentShell, Messages.ConfirmPinAndParameterSync_Title, null, dialogMessage, CONFIRM, new String[]{ IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0);
+ }
+
+ /**
+ * Open a confirmation dialog for a modification from a parameter
+ *
+ * @param parentShell
+ * the parent shell
+ * @param listOfActions
+ * the list of impacted actions
+ * @param labelprovider
+ * the label provider to read actions
+ * @return the user confirmation
+ */
+ public static boolean openConfirmFromParameter(Shell parentShell, List<? extends NamedElement> listOfActions, ILabelProvider labelprovider) {
+ StringBuffer parsedList = new StringBuffer();
+ for(NamedElement element : listOfActions) {
+ parsedList.append(labelprovider.getText(element));
+ parsedList.append("\n");
+ }
+ String message = NLS.bind(Messages.ConfirmPinAndParameterSync_FromParameterMsg, parsedList.toString());
+ ConfirmPinAndParameterSyncDialog dialog = new ConfirmPinAndParameterSyncDialog(parentShell, message);
+ dialog.setShellStyle(dialog.getShellStyle() | SWT.SHEET);
+ return dialog.open() == 0;
+ }
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/CreateCallActionDialog.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/CreateCallActionDialog.java
new file mode 100644
index 00000000000..1699a1a416f
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/CreateCallActionDialog.java
@@ -0,0 +1,688 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.dialogs;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Set;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ComboViewer;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.core.utils.EditorUtils;
+import org.eclipse.papyrus.diagram.activity.part.Messages;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.common.actions.LabelHelper;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+import org.eclipse.ui.forms.FormDialog;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.edit.providers.UMLItemPropertyDescriptor;
+
+/**
+ * This class provides a dialog to initialize a CallAction at its creation.
+ */
+public abstract class CreateCallActionDialog extends FormDialog {
+
+ private Button creationRadio;
+
+ private Button selectionRadio;
+
+ private Text selectionText;
+
+ private Button selectionButton;
+
+ private Text creationNameText;
+
+ private Text creationParentText;
+
+ private Button creationParentButton;
+
+ private EObject selectedInvoked = null;
+
+ private EObject selectedParent = null;
+
+ private Button isSynchronousButton;
+
+ private Activity actionParent;
+
+ private EClass selectedType = null;
+
+ private String selectedName = null;
+
+ private ComboViewer typeComboViewer = null;
+
+ private Combo creationTypeCombo = null;
+
+ private ILabelProvider labelProvider;
+
+ private boolean synchronous = false;
+
+ /**
+ * Create a new dialog to initialize a CallAction.
+ *
+ * @param shell
+ * parent shell
+ * @param owner
+ * the activity that owns the action
+ */
+ public CreateCallActionDialog(Shell shell, Activity owner) {
+ super(shell);
+ actionParent = owner;
+ selectedParent = owner;
+ labelProvider = new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
+
+ }
+
+ /**
+ * Create the form to :
+ *
+ * - ask the user to choose or create an invoked element.
+ *
+ * - decide whether the action is synchronous.
+ *
+ * @see org.eclipse.ui.forms.FormDialog#createFormContent(org.eclipse.ui.forms.IManagedForm)
+ */
+ @Override
+ protected void createFormContent(IManagedForm pForm) {
+ pForm.getForm().setText(getTitle());
+ ScrolledForm scrolledForm = pForm.getForm();
+ FormToolkit toolkit = pForm.getToolkit();
+ Composite parent = scrolledForm.getBody();
+ parent.setLayout(new GridLayout());
+
+ createInvocationSelectionSection(scrolledForm.getBody(), toolkit);
+ createInvocationCreationSection(scrolledForm.getBody(), toolkit);
+ createIsSynchronousSection(scrolledForm.getBody(), toolkit);
+
+ refreshSectionsEnable(true);
+ setInvokedName(null);
+ refreshOkButton();
+ hookListeners();
+
+ scrolledForm.reflow(true);
+ }
+
+ /**
+ * Create the section to ask the user to choose or create an invoked element.
+ *
+ * @param pParent
+ * the section's parent widget
+ * @param pToolkit
+ * the form toolkit
+ */
+ private void createInvocationSelectionSection(Composite pParent, FormToolkit pToolkit) {
+ // create the section
+ String lSectionTitle = getInvocationSectionTitle();
+ Section lSection = pToolkit.createSection(pParent, Section.EXPANDED | Section.TITLE_BAR);
+ if(lSectionTitle != null) {
+ lSection.setText(lSectionTitle);
+ }
+
+ ScrolledForm lInsideScrolledForm = pToolkit.createScrolledForm(lSection);
+ lInsideScrolledForm.setExpandHorizontal(true);
+ lInsideScrolledForm.setExpandVertical(true);
+ Composite lBody = lInsideScrolledForm.getBody();
+
+ GridLayout lLayout = new GridLayout();
+ lLayout.numColumns = 3;
+ lBody.setLayout(lLayout);
+
+ // content of the section
+ selectionRadio = pToolkit.createButton(lBody, getSelectionLabel(), SWT.RADIO);
+ selectionRadio.setSelection(true);
+ selectionRadio.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
+
+ pToolkit.createLabel(lBody, getInvokedObjectLabel(), SWT.NONE);
+ selectionText = pToolkit.createText(lBody, "", SWT.BORDER | SWT.READ_ONLY);
+ selectionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ selectionButton = pToolkit.createButton(lBody, "...", SWT.FLAT);
+ Image image = UMLElementTypes.getImage(getInvocationFeature());
+ selectionButton.setImage(image);
+ selectionButton.setLayoutData(new GridData(SWT.NONE));
+
+ lInsideScrolledForm.reflow(true);
+ lSection.setClient(lInsideScrolledForm);
+ }
+
+ /**
+ * Create the section to ask the user to choose or create an invoked element.
+ *
+ * @param pParent
+ * the section's parent widget
+ * @param pToolkit
+ * the form toolkit
+ */
+ private void createInvocationCreationSection(Composite pParent, FormToolkit pToolkit) {
+ // create the section
+ String lSectionTitle = getInvocationSectionTitle();
+ Section lSection = pToolkit.createSection(pParent, Section.EXPANDED | Section.TITLE_BAR);
+ if(lSectionTitle != null) {
+ lSection.setText(lSectionTitle);
+ }
+
+ ScrolledForm lInsideScrolledForm = pToolkit.createScrolledForm(lSection);
+ lInsideScrolledForm.setExpandHorizontal(true);
+ lInsideScrolledForm.setExpandVertical(true);
+ Composite lBody = lInsideScrolledForm.getBody();
+
+ GridLayout lLayout = new GridLayout();
+ lLayout.numColumns = 3;
+ lBody.setLayout(lLayout);
+
+ // content of the section
+ creationRadio = pToolkit.createButton(lBody, getCreationLabel(), SWT.RADIO);
+ creationRadio.setSelection(false);
+ creationRadio.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
+
+ if(getPossibleInvokedTypes().length == 1) {
+ selectedType = getPossibleInvokedTypes()[0];
+ } else {
+ pToolkit.createLabel(lBody, getInvokedTypeLabel(), SWT.NONE);
+ creationTypeCombo = new Combo(lBody, SWT.DROP_DOWN | SWT.READ_ONLY);
+ typeComboViewer = new ComboViewer(creationTypeCombo);
+ pToolkit.adapt(creationTypeCombo);
+ creationTypeCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ typeComboViewer.setLabelProvider(labelProvider);
+ typeComboViewer.add(getPossibleInvokedTypes());
+ if(getPossibleInvokedTypes().length > 1) {
+ // initialize selection
+ typeComboViewer.setSelection(new StructuredSelection(getPossibleInvokedTypes()[0]));
+ selectedType = getPossibleInvokedTypes()[0];
+ }
+ }
+
+ pToolkit.createLabel(lBody, getInvokedNameLabel(), SWT.NONE);
+ creationNameText = pToolkit.createText(lBody, "", SWT.BORDER);
+ creationNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+
+ pToolkit.createLabel(lBody, getInvokedParentLabel(), SWT.NONE);
+ creationParentText = pToolkit.createText(lBody, labelProvider.getText(selectedParent), SWT.BORDER | SWT.READ_ONLY);
+ creationParentText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ creationParentButton = pToolkit.createButton(lBody, "...", SWT.FLAT);
+ Image image = getParentImage();
+ creationParentButton.setImage(image);
+ creationParentButton.setLayoutData(new GridData(SWT.NONE));
+
+ lInsideScrolledForm.reflow(true);
+ lSection.setClient(lInsideScrolledForm);
+ }
+
+ /**
+ * Create the section to ask whether the action must be synchronous.
+ *
+ * @param pParent
+ * the section's parent widget
+ * @param pToolkit
+ * the form toolkit
+ */
+ private void createIsSynchronousSection(Composite pParent, FormToolkit pToolkit) {
+ // create the section
+ String lSectionTitle = getIsSynchronousSectionTitle();
+ Section lSection = pToolkit.createSection(pParent, Section.EXPANDED | Section.TITLE_BAR);
+ if(lSectionTitle != null) {
+ lSection.setText(lSectionTitle);
+ }
+
+ ScrolledForm lInsideScrolledForm = pToolkit.createScrolledForm(lSection);
+ lInsideScrolledForm.setExpandHorizontal(true);
+ lInsideScrolledForm.setExpandVertical(true);
+ Composite lBody = lInsideScrolledForm.getBody();
+
+ GridLayout lLayout = new GridLayout();
+ lLayout.numColumns = 1;
+ lBody.setLayout(lLayout);
+
+ // content of the section
+ isSynchronousButton = pToolkit.createButton(lBody, Messages.CreateCallActionDialog_IsSynchronous, SWT.CHECK | SWT.WRAP);
+ isSynchronousButton.setSelection(true);
+
+ lInsideScrolledForm.reflow(true);
+ lSection.setClient(lInsideScrolledForm);
+ }
+
+ /**
+ * Set correctly the invoked object, by creating it if needed.
+ * Then, notifies that the ok button of this dialog has been pressed.
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#okPressed()
+ *
+ */
+ @Override
+ protected void okPressed() {
+ boolean isSelectionSelected = selectionRadio.getSelection();
+ // create element if needed
+ if(!isSelectionSelected) {
+ selectedInvoked = UMLFactory.eINSTANCE.create(selectedType);
+ if(selectedInvoked instanceof NamedElement) {
+ ((NamedElement)selectedInvoked).setName(selectedName);
+ }
+ addInvokedInParent(selectedParent, selectedInvoked);
+ }
+ // register synchronous
+ synchronous = isSynchronousButton.getSelection();
+ super.okPressed();
+ }
+
+ /**
+ * Get the invoked object that have been selected or created.
+ *
+ * @return the invoked object to use.
+ */
+ public EObject getSelectedInvoked() {
+ return selectedInvoked;
+ }
+
+ /**
+ * Get whether the CallAction must be synchronous.
+ *
+ * @return the invoked object to use.
+ */
+ public boolean getIsSynchronous() {
+ return synchronous;
+ }
+
+ /**
+ * Add listeners to widgets
+ */
+ private void hookListeners() {
+ // listener to choose active section
+ SelectionListener selectCreateListener = new SelectionAdapter() {
+
+ /**
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if(creationRadio.equals(e.getSource())) {
+ refreshSectionsEnable(false);
+ } else {
+ refreshSectionsEnable(true);
+ }
+ refreshOkButton();
+ }
+ };
+ selectionRadio.addSelectionListener(selectCreateListener);
+ creationRadio.addSelectionListener(selectCreateListener);
+
+ // listener to select existing element
+ SelectionListener selectBtnListener = new SelectionAdapter() {
+
+ /**
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleChooseInvoked();
+ refreshOkButton();
+ }
+ };
+ selectionButton.addSelectionListener(selectBtnListener);
+
+ if(creationTypeCombo != null && typeComboViewer != null) {
+ // listener to select invocation type
+ ModifyListener lTypeListener = new ModifyListener() {
+
+ /**
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ public void modifyText(ModifyEvent e) {
+ ISelection sel = typeComboViewer.getSelection();
+ if(sel instanceof StructuredSelection) {
+ Object type = ((StructuredSelection)sel).getFirstElement();
+ if(type instanceof EClass) {
+ selectedType = (EClass)type;
+ } else {
+ selectedType = null;
+ }
+ // reset name
+ setInvokedName(null);
+ refreshOkButton();
+ }
+ }
+ };
+ creationTypeCombo.addModifyListener(lTypeListener);
+ }
+
+ // listener to invocation element name
+ ModifyListener lNameListener = new ModifyListener() {
+
+ /**
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ public void modifyText(ModifyEvent e) {
+ setInvokedName(creationNameText.getText());
+ }
+ };
+ creationNameText.addModifyListener(lNameListener);
+
+ // listener to select new element parent
+ SelectionListener selectParentBtnListener = new SelectionAdapter() {
+
+ /**
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleChooseParent();
+ // reset name if not set
+ if(selectedName == null) {
+ setInvokedName(null);
+ }
+ refreshOkButton();
+ }
+ };
+ creationParentButton.addSelectionListener(selectParentBtnListener);
+ }
+
+ /**
+ * Set the name chosen for the invoked element
+ *
+ * @param text
+ * the text string or null for auto-initialization
+ */
+ private void setInvokedName(String text) {
+ String name = text;
+ if(text == null && selectedParent != null && selectedType != null) {
+ name = LabelHelper.INSTANCE.findName(selectedParent, selectedType);
+ // the name assignment will be performed by listener's call
+ creationNameText.setText(name);
+ } else if(name != null && !"".equals(name.trim())) {
+ selectedName = name.trim();
+ Color black = creationNameText.getDisplay().getSystemColor(SWT.COLOR_BLACK);
+ creationNameText.setForeground(black);
+ refreshOkButton();
+ } else {
+ selectedName = null;
+ Color red = creationNameText.getDisplay().getSystemColor(SWT.COLOR_RED);
+ creationNameText.setForeground(red);
+ refreshOkButton();
+ }
+ }
+
+ /**
+ * Open the dialog to choose the existing element to select
+ *
+ */
+ private void handleChooseInvoked() {
+ Collection<EObject> elements = UMLItemPropertyDescriptor.getReachableObjectsOfType(actionParent, getInvocationFeature().getEType());
+ ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
+ dialog.setMessage(Messages.UMLModelingAssistantProviderMessage);
+ dialog.setTitle(Messages.UMLModelingAssistantProviderTitle);
+ dialog.setMultipleSelection(false);
+ dialog.setElements(elements.toArray(new EObject[elements.size()]));
+ if(dialog.open() == Window.OK) {
+ setInvokedSelection((EObject)dialog.getFirstResult());
+ }
+ }
+
+ /**
+ * Define the object that will be invoked by the action (if selection mode is chosen)
+ *
+ * @param invokedElement
+ * the selected element
+ */
+ private void setInvokedSelection(EObject invokedElement) {
+ selectedInvoked = invokedElement;
+ if(selectedInvoked instanceof NamedElement) {
+ selectionText.setText(labelProvider.getText(selectedInvoked));
+ } else {
+ selectionText.setText("");
+ }
+ updateSynchronous(selectedInvoked);
+ }
+
+ /**
+ * Open the dialog to choose the parent of element to create
+ *
+ */
+ private void handleChooseParent() {
+ Set<EObject> elements = getPossibleInvokedParents(actionParent);
+ ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
+ dialog.setMessage(Messages.UMLModelingAssistantProviderMessage);
+ dialog.setTitle(Messages.UMLModelingAssistantProviderTitle);
+ dialog.setMultipleSelection(false);
+ dialog.setElements(elements.toArray(new EObject[elements.size()]));
+ if(dialog.open() == Window.OK) {
+ setInvokedParent((EObject)dialog.getFirstResult());
+ }
+ }
+
+ /**
+ * Define the object in which invoked object will be created (if creation mode is chosen)
+ *
+ * @param invokedParent
+ * the selected parent
+ */
+ private void setInvokedParent(EObject invokedParent) {
+ selectedParent = invokedParent;
+ if(selectedParent instanceof NamedElement) {
+ creationParentText.setText(labelProvider.getText(selectedParent));
+ } else {
+ creationParentText.setText("");
+ }
+ }
+
+ /**
+ * Refresh the enabled and disabled elements in various sections
+ *
+ * @param isSelectionSelected
+ * true if we choose to select an existing element, false if we choose to create an element
+ */
+ private void refreshSectionsEnable(boolean isSelectionSelected) {
+ // handle radio button value
+ if(isSelectionSelected) {
+ creationRadio.setSelection(false);
+ } else {
+ selectionRadio.setSelection(false);
+ }
+ // handle disabled section
+ selectionText.setEnabled(isSelectionSelected);
+ selectionButton.setEnabled(isSelectionSelected);
+ if(creationTypeCombo != null) {
+ creationTypeCombo.setEnabled(!isSelectionSelected);
+ }
+ creationNameText.setEnabled(!isSelectionSelected);
+ creationParentText.setEnabled(!isSelectionSelected);
+ creationParentButton.setEnabled(!isSelectionSelected);
+ // handle synchronization constraint
+ if(isSelectionSelected) {
+ updateSynchronous(selectedInvoked);
+ } else {
+ updateSynchronous(null);
+ }
+ }
+
+ /**
+ * Refresh the OK button activation
+ */
+ private void refreshOkButton() {
+ boolean isSelectionSelected = selectionRadio.getSelection();
+ if(getButton(IDialogConstants.OK_ID) != null && !getButton(IDialogConstants.OK_ID).isDisposed()) {
+ if(isSelectionSelected) {
+ getButton(IDialogConstants.OK_ID).setEnabled(selectedInvoked != null);
+ } else {
+ getButton(IDialogConstants.OK_ID).setEnabled(selectedParent != null && selectedType != null && selectedName != null);
+ }
+ }
+ }
+
+ /**
+ *
+ * @param selectedInvoked
+ * the invoked object selected
+ */
+ private void updateSynchronous(EObject selectedInvoked) {
+ if(hasOutParameters(selectedInvoked)) {
+ isSynchronousButton.setSelection(true);
+ isSynchronousButton.setEnabled(false);
+ } else {
+ isSynchronousButton.setEnabled(true);
+ }
+ }
+
+ /**
+ * Add the created invoked object to its selected parent
+ */
+ protected void addInvokedInParent(EObject selectedParent, EObject createdInvoked) {
+ TransactionalEditingDomain editingdomain = EditorUtils.getTransactionalEditingDomain();
+ // Let the command find the relation on its own.
+ Command addCmd = AddCommand.create(editingdomain, selectedParent, null, Collections.singleton(createdInvoked));
+ addCmd.execute();
+ }
+
+ /**
+ * Get the possible types for creating a new invoked element
+ *
+ * @return array of EClasses
+ */
+ abstract protected EClass[] getPossibleInvokedTypes();
+
+ /**
+ * Get the possible parents of the new invoked element
+ *
+ * @param actionParent
+ * the parent of the action
+ * @return collection of EObject possible owners
+ */
+ abstract protected Set<EObject> getPossibleInvokedParents(EObject actionParent);
+
+ /**
+ * Get feature referencing the invoked object
+ *
+ * @return invocation feature
+ */
+ abstract protected EReference getInvocationFeature();
+
+ /**
+ * Test is the invoked object has parameters which will generate output pins
+ *
+ * @param invokedObject
+ * the object whose parameters must be inspected
+ * @return true if there are parameters which will be mapped with output pins
+ */
+ abstract protected boolean hasOutParameters(EObject invokedObject);
+
+ /**
+ * Get the image for the parent selection button
+ *
+ * @return image
+ */
+ abstract protected Image getParentImage();
+
+ /**
+ * Get the title of the is synchronous section
+ *
+ * @return section title
+ */
+ protected String getIsSynchronousSectionTitle() {
+ return Messages.CreateCallActionDialog_IsSynchronousTitle;
+ }
+
+ /**
+ * Get the label to present the name of the invoked object
+ *
+ * @return label
+ */
+ protected String getInvokedNameLabel() {
+ return Messages.CreateCallActionDialog_NameLabel;
+ }
+
+ /**
+ * Get the label to present the type of the invoked object
+ *
+ * @return label
+ */
+ protected String getInvokedTypeLabel() {
+ return Messages.CreateCallActionDialog_TypeLabel;
+ }
+
+ /**
+ * Get the label to present parent of the invoked object
+ *
+ * @return label
+ */
+ protected String getInvokedParentLabel() {
+ return Messages.CreateCallActionDialog_ParentLabel;
+ }
+
+ /**
+ * Get the label to present the invoked object
+ *
+ * @return label
+ */
+ protected String getInvokedObjectLabel() {
+ return getInvocationFeature().getEReferenceType().getName() + ":";
+ }
+
+ /**
+ * Get the title of the dialog
+ *
+ * @return dialog title
+ */
+ abstract protected String getTitle();
+
+ /**
+ * Get the title of the invocation section
+ *
+ * @return section title
+ */
+ abstract protected String getInvocationSectionTitle();
+
+ /**
+ * Get the label to choose to select an existing element
+ *
+ * @return label
+ */
+ abstract protected String getSelectionLabel();
+
+ /**
+ * Get the label to choose to create a new element
+ *
+ * @return label
+ */
+ abstract protected String getCreationLabel();
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/CreateCallBehaviorActionDialog.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/CreateCallBehaviorActionDialog.java
new file mode 100644
index 00000000000..7ffba3031df
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/CreateCallBehaviorActionDialog.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.dialogs;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.papyrus.diagram.activity.part.Messages;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.ParameterDirectionKind;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.edit.providers.UMLItemPropertyDescriptor;
+
+
+/**
+ * This class provides a dialog to initialize a CallBehaviorAction at its creation.
+ */
+public class CreateCallBehaviorActionDialog extends CreateCallActionDialog {
+
+ /**
+ * Create a new dialog to initialize a CallBehaviorAction.
+ *
+ * @param shell
+ * parent shell
+ * @param owner
+ * the activity that owns the action
+ */
+ public CreateCallBehaviorActionDialog(Shell shell, Activity owner) {
+ super(shell, owner);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getInvocationSectionTitle()
+ */
+ @Override
+ protected String getInvocationSectionTitle() {
+ return Messages.CreateCallActionDialog_BehaviorInvocationTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getTitle()
+ */
+ @Override
+ protected String getTitle() {
+ return Messages.CreateCallActionDialog_BehaviorTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getInvocationFeature()
+ */
+ @Override
+ protected EReference getInvocationFeature() {
+ return UMLPackage.eINSTANCE.getCallBehaviorAction_Behavior();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#hasOutParameters(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ protected boolean hasOutParameters(EObject invokedObject) {
+ if(invokedObject instanceof Behavior) {
+ for(Parameter param : ((Behavior)invokedObject).getOwnedParameters()) {
+ if(ParameterDirectionKind.INOUT_LITERAL.equals(param.getDirection()) || ParameterDirectionKind.OUT_LITERAL.equals(param.getDirection())) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getPossibleInvokedParents()
+ */
+ @Override
+ protected Set<EObject> getPossibleInvokedParents(EObject actionParent) {
+ Collection<EObject> packages = UMLItemPropertyDescriptor.getReachableObjectsOfType(actionParent, UMLPackage.eINSTANCE.getPackage());
+ Collection<EObject> behavioredClassifiers = UMLItemPropertyDescriptor.getReachableObjectsOfType(actionParent, UMLPackage.eINSTANCE.getBehavioredClassifier());
+ Set<EObject> result = new HashSet<EObject>(packages);
+ result.addAll(behavioredClassifiers);
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getPossibleInvokedTypes()
+ */
+ @Override
+ protected EClass[] getPossibleInvokedTypes() {
+ return new EClass[]{ UMLPackage.eINSTANCE.getActivity(), UMLPackage.eINSTANCE.getInteraction(), UMLPackage.eINSTANCE.getOpaqueBehavior(), UMLPackage.eINSTANCE.getFunctionBehavior(), UMLPackage.eINSTANCE.getStateMachine(), UMLPackage.eINSTANCE.getProtocolStateMachine() };
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getCreationLabel()
+ */
+ @Override
+ protected String getCreationLabel() {
+ return Messages.CreateCallActionDialog_CreateBehavior;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getSelectionLabel()
+ */
+ @Override
+ protected String getSelectionLabel() {
+ return Messages.CreateCallActionDialog_SelectBehavior;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getParentImage()
+ */
+ @Override
+ protected Image getParentImage() {
+ return UMLElementTypes.getImage(UMLPackage.eINSTANCE.getPackage());
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/CreateCallOperationActionDialog.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/CreateCallOperationActionDialog.java
new file mode 100644
index 00000000000..9ad61c8b332
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/CreateCallOperationActionDialog.java
@@ -0,0 +1,151 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.dialogs;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.papyrus.diagram.activity.part.Messages;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.ParameterDirectionKind;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.edit.providers.UMLItemPropertyDescriptor;
+
+
+/**
+ * This class provides a dialog to initialize a CallOperationAction at its creation.
+ */
+public class CreateCallOperationActionDialog extends CreateCallActionDialog {
+
+ /**
+ * Create a new dialog to initialize a CallOperationAction.
+ *
+ * @param shell
+ * parent shell
+ * @param owner
+ * the activity that owns the action
+ */
+ public CreateCallOperationActionDialog(Shell shell, Activity owner) {
+ super(shell, owner);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getInvocationFeature()
+ */
+ @Override
+ protected EReference getInvocationFeature() {
+ return UMLPackage.eINSTANCE.getCallOperationAction_Operation();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getPossibleInvokedTypes()
+ */
+ @Override
+ protected EClass[] getPossibleInvokedTypes() {
+ return new EClass[]{ UMLPackage.eINSTANCE.getOperation() };
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#hasOutParameters(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ protected boolean hasOutParameters(EObject invokedObject) {
+ if(invokedObject instanceof Operation) {
+ for(Parameter param : ((Operation)invokedObject).getOwnedParameters()) {
+ if(ParameterDirectionKind.INOUT_LITERAL.equals(param.getDirection()) || ParameterDirectionKind.OUT_LITERAL.equals(param.getDirection())) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getPossibleInvokedParents()
+ */
+ @Override
+ protected Set<EObject> getPossibleInvokedParents(EObject actionParent) {
+ Collection<EObject> classes = UMLItemPropertyDescriptor.getReachableObjectsOfType(actionParent, UMLPackage.eINSTANCE.getClass_());
+ Set<EObject> result = new HashSet<EObject>(classes);
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getInvocationSectionTitle()
+ */
+ @Override
+ protected String getInvocationSectionTitle() {
+ return Messages.CreateCallActionDialog_OperationInvocationTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getTitle()
+ */
+ @Override
+ protected String getTitle() {
+ return Messages.CreateCallActionDialog_OperationTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getCreationLabel()
+ */
+ @Override
+ protected String getCreationLabel() {
+ return Messages.CreateCallActionDialog_CreateOperation;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getSelectionLabel()
+ */
+ @Override
+ protected String getSelectionLabel() {
+ return Messages.CreateCallActionDialog_SelectOperation;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallActionDialog#getParentImage()
+ */
+ @Override
+ protected Image getParentImage() {
+ return UMLElementTypes.getImage(UMLPackage.eINSTANCE.getClass_());
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/WarningAndLinkDialog.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/WarningAndLinkDialog.java
new file mode 100644
index 00000000000..b039e5602f1
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/dialogs/WarningAndLinkDialog.java
@@ -0,0 +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.diagram.activity.edit.dialogs;
+
+import org.eclipse.gmf.runtime.common.ui.util.PropertySheetUtil;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.papyrus.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.core.utils.EditorUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.navigator.CommonNavigator;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * This dialog provide a message and a link to navigate to a model element.
+ */
+public class WarningAndLinkDialog extends MessageDialog {
+
+ /** The element to link */
+ private NamedElement element;
+
+ /** The label of the link */
+ private String label;
+
+ /**
+ * Construct a new dialog to open a warning message and a link to an element.
+ *
+ * @param parentShell
+ * @param dialogTitle
+ * @param dialogMessage
+ * @param linkElement
+ */
+ public WarningAndLinkDialog(Shell parentShell, String dialogTitle, String dialogMessage, NamedElement linkElement, String linkLabel) {
+ super(parentShell, dialogTitle, null, dialogMessage, WARNING, new String[]{ IDialogConstants.OK_LABEL }, 0);
+ element = linkElement;
+ label = linkLabel;
+ }
+
+ /**
+ * Create the link to the element
+ *
+ * @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
+ *
+ * @param parent
+ * the parent composite
+ * @return the hyperlink control
+ */
+ @Override
+ protected Control createCustomArea(Composite parent) {
+ FormToolkit toolkit = new FormToolkit(parent.getDisplay());
+ Hyperlink hyperLink = toolkit.createHyperlink(parent, label, SWT.UNDERLINE_LINK);
+ hyperLink.setBackground(parent.getBackground());
+ hyperLink.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
+ hyperLink.addHyperlinkListener(new HyperlinkAdapter() {
+
+ @Override
+ public void linkActivated(HyperlinkEvent e) {
+ navigateToElement();
+ okPressed();
+ }
+
+
+ });
+ return hyperLink;
+ }
+
+ /**
+ * Navigate to the linked element. Open it in model editor and print its properties.
+ */
+ protected void navigateToElement() {
+ IMultiDiagramEditor editor = EditorUtils.getMultiDiagramEditor();
+ IViewReference[] views = editor.getSite().getPage().getViewReferences();
+ for(IViewReference view : views) {
+ IWorkbenchPart part = view.getPart(false);
+ if(part instanceof CommonNavigator) {
+ CommonNavigator navigator = (CommonNavigator)part;
+ navigator.selectReveal(new StructuredSelection(element));
+ }
+ }
+ PropertySheetUtil.setCurrentPageSelection(editor, new StructuredSelection(element));
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/policies/CreateActionLocalConditionEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/policies/CreateActionLocalConditionEditPolicy.java
new file mode 100644
index 00000000000..1b7db3fafcd
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/policies/CreateActionLocalConditionEditPolicy.java
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.AbstractEditPolicy;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest;
+import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.commands.CreateActionLocalConditionViewCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityContentCompartmentEditPart;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * This Edit Policy applies on an action. It enables to create a local condition linked with this action, in the parent compartment.
+ */
+public class CreateActionLocalConditionEditPolicy extends AbstractEditPolicy {
+
+
+ public CreateActionLocalConditionEditPolicy() {
+ super();
+ }
+
+ @Override
+ public Command getCommand(Request request) {
+ if(RequestConstants.REQ_CREATE.equals(request.getType()) && request instanceof CreateUnspecifiedTypeRequest) {
+ CreateUnspecifiedTypeRequest creationRequest = (CreateUnspecifiedTypeRequest)request;
+ EditPart parentEditPart = getHost().getParent();
+ if(parentEditPart instanceof ActivityActivityContentCompartmentEditPart) {
+ ActivityActivityContentCompartmentEditPart compartementPart = (ActivityActivityContentCompartmentEditPart)parentEditPart;
+ EObject action = ViewUtil.resolveSemanticElement((View)getHost().getModel());
+ if(UMLElementTypes.Constraint_3011.equals((creationRequest).getElementTypes().get(0))) {
+ return new CreateActionLocalConditionViewCommand((IHintedType)UMLElementTypes.Constraint_3011, compartementPart, action, getHost());
+ } else if(UMLElementTypes.Constraint_3012.equals((creationRequest).getElementTypes().get(0))) {
+ return new CreateActionLocalConditionViewCommand((IHintedType)UMLElementTypes.Constraint_3012, compartementPart, action, getHost());
+ }
+ }
+ }
+ return super.getCommand(request);
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/policies/CreateObjectFlowBehaviorEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/policies/CreateObjectFlowBehaviorEditPolicy.java
new file mode 100644
index 00000000000..d80240d280e
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/policies/CreateObjectFlowBehaviorEditPolicy.java
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.AbstractEditPolicy;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest;
+import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.commands.CreateObjectFlowBehaviorViewCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityContentCompartmentEditPart;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * This Edit Policy applies on an action. It enables to create a local condition linked with this action, in the parent compartment.
+ */
+public class CreateObjectFlowBehaviorEditPolicy extends AbstractEditPolicy {
+
+
+ public CreateObjectFlowBehaviorEditPolicy() {
+ super();
+ }
+
+ @Override
+ public Command getCommand(Request request) {
+ if(RequestConstants.REQ_CREATE.equals(request.getType()) && request instanceof CreateUnspecifiedTypeRequest) {
+ CreateUnspecifiedTypeRequest creationRequest = (CreateUnspecifiedTypeRequest)request;
+ EditPart parentEditPart = getHost().getParent();
+ if(parentEditPart instanceof ActivityActivityContentCompartmentEditPart) {
+ ActivityActivityContentCompartmentEditPart compartementPart = (ActivityActivityContentCompartmentEditPart)parentEditPart;
+ EObject action = ViewUtil.resolveSemanticElement((View)getHost().getModel());
+ if(UMLElementTypes.Activity_3028.equals((creationRequest).getElementTypes().get(0))) {
+ return new CreateObjectFlowBehaviorViewCommand((IHintedType)UMLElementTypes.Activity_3028, compartementPart, action, getHost());
+ } else if(UMLElementTypes.Activity_3029.equals((creationRequest).getElementTypes().get(0))) {
+ return new CreateObjectFlowBehaviorViewCommand((IHintedType)UMLElementTypes.Activity_3029, compartementPart, action, getHost());
+ }
+ }
+ }
+ return super.getCommand(request);
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/policies/CustomDiagramDragDropEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/policies/CustomDiagramDragDropEditPolicy.java
index 29db226b99b..ea8e316cd7a 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/policies/CustomDiagramDragDropEditPolicy.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/edit/policies/CustomDiagramDragDropEditPolicy.java
@@ -13,16 +13,57 @@
*****************************************************************************/
package org.eclipse.papyrus.diagram.activity.edit.policies;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPostconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPreconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsTransformationEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowTransformationEditPart;
import org.eclipse.papyrus.diagram.activity.helper.ActivityLinkMappingHelper;
import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.common.commands.CommonDeferredCreateConnectionViewCommand;
+import org.eclipse.papyrus.diagram.common.commands.SemanticAdapter;
import org.eclipse.papyrus.diagram.common.editpolicies.CommonDiagramDragDropEditPolicy;
+import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.ActivityEdge;
+import org.eclipse.uml2.uml.ActivityNode;
+import org.eclipse.uml2.uml.Behavior;
import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.ObjectFlow;
/**
* This class is used to execute the drag and drop from the outline. It can manage the drop of nodes
@@ -32,7 +73,7 @@ import org.eclipse.uml2.uml.Element;
public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPolicy {
/** The specific drop node. */
- public int[] secificDropNode = {};
+ public int[] secificDropNode = { ConstraintAsLocalPrecondEditPart.VISUAL_ID, ConstraintAsLocalPostcondEditPart.VISUAL_ID, ActivityAsSelectionEditPart.VISUAL_ID, ActivityAsTransformationEditPart.VISUAL_ID, ObjectFlowEditPart.VISUAL_ID, ControlFlowEditPart.VISUAL_ID };
/**
* Instantiates a new custom diagram drag drop edit policy with the right link mapping helper
@@ -70,11 +111,253 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
* {@inheritDoc}
*/
@Override
- protected Command getSpecificDropCommand(DropObjectsRequest dropRequest, Element semanticLink, int nodeVISUALID, int linkVISUALID) {
+ protected Command getSpecificDropCommand(DropObjectsRequest dropRequest, Element semanticElement, int nodeVISUALID, int linkVISUALID) {
+ switch(nodeVISUALID) {
+ case ConstraintAsLocalPrecondEditPart.VISUAL_ID:
+ case ConstraintAsLocalPostcondEditPart.VISUAL_ID:
+ return dropActionLocalCondition(dropRequest, semanticElement, nodeVISUALID);
+ case ActivityAsSelectionEditPart.VISUAL_ID:
+ case ActivityAsTransformationEditPart.VISUAL_ID:
+ return dropObjectFlowBehavior(dropRequest, semanticElement, nodeVISUALID);
+ }
switch(linkVISUALID) {
- default:
- return super.getSpecificDropCommand(dropRequest, semanticLink, nodeVISUALID, linkVISUALID);
+ case ObjectFlowEditPart.VISUAL_ID:
+ case ControlFlowEditPart.VISUAL_ID:
+ return dropActivityEdge(dropRequest, semanticElement, linkVISUALID);
+ }
+ return super.getSpecificDropCommand(dropRequest, semanticElement, nodeVISUALID, linkVISUALID);
+ }
+
+ /**
+ * Specific drop action for an action's local condition
+ *
+ * @param dropRequest
+ * the drop request
+ * @param semanticElement
+ * the semantic link
+ * @param nodeVISUALID
+ * the node visual id
+ *
+ * @return the command for local condition
+ */
+ protected Command dropActionLocalCondition(DropObjectsRequest dropRequest, Element semanticElement, int nodeVISUALID) {
+ if(getHost() instanceof GraphicalEditPart) {
+ // Adapt the location
+ Point location = dropRequest.getLocation().getCopy();
+ ((GraphicalEditPart)getHost()).getContentPane().translateToRelative(location);
+ ((GraphicalEditPart)getHost()).getContentPane().translateFromParent(location);
+ location.translate(((GraphicalEditPart)getHost()).getContentPane().getClientArea().getLocation().getNegated());
+ location.y += 100;
+ // Retrieve expected graphical parent
+ EObject graphicalParent = ((GraphicalEditPart)getHost()).resolveSemanticElement();
+ // verification of container differs from usually, condition is graphically contained by the activity
+ if(graphicalParent instanceof Activity) {
+ // drop the constraint and its link to the action
+ Element linkSource = semanticElement.getOwner();
+ Element linkTarget = semanticElement;
+ // check for existing link part
+ for(Object targetView : DiagramEditPartsUtil.getEObjectViews(linkTarget)) {
+ if(targetView instanceof View) {
+ EditPart targetEditpart = DiagramEditPartsUtil.getEditPartFromView((View)targetView, getHost());
+ if(targetEditpart instanceof ActionLocalPreconditionEditPart || targetEditpart instanceof ActionLocalPostconditionEditPart) {
+ // condition link is already drawn.
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+ }
+
+ if(ConstraintAsLocalPrecondEditPart.VISUAL_ID == nodeVISUALID) {
+ return new ICommandProxy(dropBinaryLink(new CompositeCommand("drop Local Precondition link"), linkSource, linkTarget, ActionLocalPreconditionEditPart.VISUAL_ID, location, semanticElement));
+ } else if(ConstraintAsLocalPostcondEditPart.VISUAL_ID == nodeVISUALID) {
+ return new ICommandProxy(dropBinaryLink(new CompositeCommand("drop Local Postcondition link"), linkSource, linkTarget, ActionLocalPostconditionEditPart.VISUAL_ID, location, semanticElement));
+ }
+ }
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * Specific drop action for an object flow's transformation or selection behavior
+ *
+ * @param dropRequest
+ * the drop request
+ * @param semanticElement
+ * the semantic link
+ * @param nodeVISUALID
+ * the node visual id
+ *
+ * @return the command for behavior
+ */
+ protected Command dropObjectFlowBehavior(DropObjectsRequest dropRequest, Element semanticElement, int nodeVISUALID) {
+ if(getHost() instanceof GraphicalEditPart) {
+ // Adapt the location
+ Point location = dropRequest.getLocation().getCopy();
+ ((GraphicalEditPart)getHost()).getContentPane().translateToRelative(location);
+ ((GraphicalEditPart)getHost()).getContentPane().translateFromParent(location);
+ location.translate(((GraphicalEditPart)getHost()).getContentPane().getClientArea().getLocation().getNegated());
+ location.y += 100;
+ // Retrieve expected graphical parent
+ EObject graphicalParent = ((GraphicalEditPart)getHost()).resolveSemanticElement();
+ // verification of container differs from usually, condition is graphically contained by the activity
+ if(graphicalParent instanceof Activity) {
+ CompoundCommand globalCmd = new CompoundCommand();
+ // inspect the activity for Object Flows specified by the semanticLink behavior
+ for(ActivityEdge edge : ((Activity)graphicalParent).getEdges()) {
+ if(edge instanceof ObjectFlow) {
+ ObjectFlow objectFlow = (ObjectFlow)edge;
+ if(semanticElement.equals(objectFlow.getSelection())) {
+ // drop the selection behavior and its link to the object flow
+ ObjectFlow linkSource = objectFlow;
+ Behavior linkTarget = (Behavior)semanticElement;
+ // there is no way to distinguish VISUAL_ID of a selection from a transformation, since the element can be both at the same time
+ if(ActivityAsSelectionEditPart.VISUAL_ID == nodeVISUALID || ActivityAsTransformationEditPart.VISUAL_ID == nodeVISUALID) {
+ ICommandProxy localCmd = new ICommandProxy(dropObjectFlowSpecification(new CompositeCommand("drop Selection link"), linkSource, linkTarget, ObjectFlowSelectionEditPart.VISUAL_ID, ActivityAsSelectionEditPart.VISUAL_ID, location, semanticElement));
+ globalCmd.add(localCmd);
+ }
+ }
+ if(semanticElement.equals(objectFlow.getTransformation())) {
+ // drop the transformation behavior and its link to the object flow
+ ObjectFlow linkSource = objectFlow;
+ Behavior linkTarget = (Behavior)semanticElement;
+ // there is no way to distinguish VISUAL_ID of a selection from a transformation, since the element can be both at the same time
+ if(ActivityAsSelectionEditPart.VISUAL_ID == nodeVISUALID || ActivityAsTransformationEditPart.VISUAL_ID == nodeVISUALID) {
+ ICommandProxy localCmd = new ICommandProxy(dropObjectFlowSpecification(new CompositeCommand("drop Transformation link"), linkSource, linkTarget, ObjectFlowTransformationEditPart.VISUAL_ID, ActivityAsTransformationEditPart.VISUAL_ID, location, semanticElement));
+ globalCmd.add(localCmd);
+ }
+ }
+ }
+ }
+ return globalCmd;
+ }
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * the method provides command to create the binary link into the diagram. If the source and the
+ * target views do not exist, these views will be created.
+ *
+ * @param cc
+ * the composite command that will contain the set of command to create the binary
+ * link
+ * @param source
+ * the source the element source of the link
+ * @param target
+ * the target the element target of the link
+ * @param linkVISUALID
+ * the link VISUALID used to create the view
+ * @param location
+ * the location the location where the view will be be created
+ * @param semanticLink
+ * the semantic link that will be attached to the view
+ *
+ * @return the composite command
+ */
+ public CompositeCommand dropObjectFlowSpecification(CompositeCommand cc, ObjectFlow source, Behavior target, int linkVISUALID, int specificationVISUALID, Point location, Element semanticLink) {
+ // look for editpart
+ ObjectFlowEditPart sourceEditPart = lookForEdgePart(source);
+ // look for editpart linked with the object flow
+ GraphicalEditPart targetEditPart = null;
+ if(sourceEditPart != null) {
+ //TODO check that there is not already a representation linked to the source object flow
+ }
+
+ // descriptor of the link
+ CreateConnectionViewRequest.ConnectionViewDescriptor linkdescriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(getUMLElementType(linkVISUALID), ((IHintedType)getUMLElementType(linkVISUALID)).getSemanticHint(), getDiagramPreferencesHint());
+
+ IAdaptable sourceAdapter = null;
+ IAdaptable targetAdapter = null;
+ if(sourceEditPart == null) {
+ // creation of the node
+ ViewDescriptor descriptor = new ViewDescriptor(new EObjectAdapter(source), Edge.class, null, ViewUtil.APPEND, false, ((IGraphicalEditPart)getHost()).getDiagramPreferencesHint());
+
+ // get the command and execute it.
+ CreateCommand nodeCreationCommand = new CreateCommand(((IGraphicalEditPart)getHost()).getEditingDomain(), descriptor, ((View)getHost().getModel()));
+ cc.compose(nodeCreationCommand);
+ SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), "move", (IAdaptable)nodeCreationCommand.getCommandResult().getReturnValue(), new Point(location.x, location.y + 100));
+ cc.compose(setBoundsCommand);
+
+ sourceAdapter = (IAdaptable)nodeCreationCommand.getCommandResult().getReturnValue();
+ } else {
+ sourceAdapter = new SemanticAdapter(null, sourceEditPart.getModel());
+ }
+ if(targetEditPart == null) {
+ // creation of the node
+ String nodeSemanticHint = ((IHintedType)getUMLElementType(specificationVISUALID)).getSemanticHint();
+ ViewDescriptor descriptor = new ViewDescriptor(new EObjectAdapter(target), Node.class, nodeSemanticHint, ViewUtil.APPEND, false, ((IGraphicalEditPart)getHost()).getDiagramPreferencesHint());
+
+ // get the command and execute it.
+ CreateCommand nodeCreationCommand = new CreateCommand(((IGraphicalEditPart)getHost()).getEditingDomain(), descriptor, ((View)getHost().getModel()));
+ cc.compose(nodeCreationCommand);
+ SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), "move", (IAdaptable)nodeCreationCommand.getCommandResult().getReturnValue(), new Point(location.x, location.y - 100));
+ cc.compose(setBoundsCommand);
+ targetAdapter = (IAdaptable)nodeCreationCommand.getCommandResult().getReturnValue();
+
+ } else {
+ targetAdapter = new SemanticAdapter(null, targetEditPart.getModel());
}
+
+ CommonDeferredCreateConnectionViewCommand aLinkCommand = new CommonDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType)getUMLElementType(linkVISUALID)).getSemanticHint(), sourceAdapter, targetAdapter, getViewer(), getDiagramPreferencesHint(), linkdescriptor, null);
+ aLinkCommand.setElement(semanticLink);
+ cc.compose(aLinkCommand);
+ return cc;
+
}
+ /**
+ * Look for editPart from its semantic.
+ *
+ * @param semantic
+ * the semantic
+ *
+ * @return the edits the part or null if not found
+ */
+ private ObjectFlowEditPart lookForEdgePart(EObject semantic) {
+ Collection<EditPart> editPartSet = getHost().getViewer().getEditPartRegistry().values();
+ Iterator<EditPart> editPartIterator = editPartSet.iterator();
+ ObjectFlowEditPart existedEditPart = null;
+ while(editPartIterator.hasNext() && existedEditPart == null) {
+ EditPart currentEditPart = editPartIterator.next();
+ if(currentEditPart instanceof ObjectFlowEditPart && semantic.equals(((ObjectFlowEditPart)currentEditPart).resolveSemanticElement())) {
+ existedEditPart = (ObjectFlowEditPart)currentEditPart;
+ }
+ }
+ return existedEditPart;
+ }
+
+ /**
+ * Specific drop action for an activity edge
+ *
+ * @param dropRequest
+ * the drop request
+ * @param semanticLink
+ * the semantic link
+ * @param linkVISUALID
+ * the link visual id
+ *
+ * @return the command for association
+ */
+ protected Command dropActivityEdge(DropObjectsRequest dropRequest, Element semanticLink, int linkVISUALID) {
+ Collection<?> sources = ActivityLinkMappingHelper.getInstance().getSource(semanticLink);
+ Collection<?> targets = ActivityLinkMappingHelper.getInstance().getTarget(semanticLink);
+ if(sources.size() == 1 && targets.size() == 1) {
+ ActivityNode source = (ActivityNode)sources.toArray()[0];
+ ActivityNode target = (ActivityNode)targets.toArray()[0];
+ return new ICommandProxy(dropBinaryLink(new CompositeCommand("drop Activity Edge"), source, target, linkVISUALID, dropRequest.getLocation(), semanticLink));
+ } else {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+
+ /**
+ * Avoid selection of label edit parts
+ *
+ * @see org.eclipse.papyrus.diagram.common.editpolicies.CommonDiagramDragDropEditPolicy#isEditPartTypeSuitableForEClass(java.lang.Class,
+ * org.eclipse.emf.ecore.EClass)
+ */
+ @Override
+ protected boolean isEditPartTypeSuitableForEClass(Class<? extends GraphicalEditPart> editPartClass, EClass eClass) {
+ // avoid selecting a label instead of the activity node
+ return !LabelEditPart.class.isAssignableFrom(editPartClass);
+ }
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/figures/CenteredWrappedLabel.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/figures/CenteredWrappedLabel.java
new file mode 100644
index 00000000000..27f08ebbe6a
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/figures/CenteredWrappedLabel.java
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * 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.diagram.activity.figures;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+
+/**
+ * This class is a {@link WrappingLabel}, which default behavior is set differently :
+ *
+ * The text is centered and automatically wraps on several lines.
+ */
+public class CenteredWrappedLabel extends WrappingLabel {
+
+ /**
+ * Construct an empty wrapping label with customized alignment.
+ */
+ public CenteredWrappedLabel() {
+ super();
+ setTextJustification(WrappingLabel.CENTER);
+ setAlignment(WrappingLabel.CENTER);
+ setTextWrap(true);
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/figures/WrappedLabel.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/figures/WrappedLabel.java
new file mode 100644
index 00000000000..f73f9d19882
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/figures/WrappedLabel.java
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * 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.diagram.activity.figures;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+
+/**
+ * This class is a {@link WrappingLabel}, which default behavior is set differently :
+ *
+ * The text is left aligned and automatically wraps on several lines.
+ */
+public class WrappedLabel extends WrappingLabel {
+
+ /**
+ * Construct an empty wrapping label with customized alignment.
+ */
+ public WrappedLabel() {
+ super();
+ setTextJustification(WrappingLabel.LEFT);
+ setAlignment(WrappingLabel.LEFT);
+ setTextWrap(true);
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/helper/ActivityFigureDrawer.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/helper/ActivityFigureDrawer.java
new file mode 100644
index 00000000000..4e8ad3d9326
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/helper/ActivityFigureDrawer.java
@@ -0,0 +1,248 @@
+/*****************************************************************************
+ * 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.diagram.activity.helper;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.Polygon;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+import org.eclipse.gmf.runtime.notation.Bounds;
+import org.eclipse.gmf.runtime.notation.Shape;
+
+/**
+ * The ActivityFigureDrawer helps drawing representations for activity diagram out of a Polyline figure
+ */
+public class ActivityFigureDrawer {
+
+ /**
+ * The template for drawing a triangle figure
+ */
+ private static final List<Point> TRIANGLE_FIGURE = new ArrayList<Point>(3);
+ static {
+ TRIANGLE_FIGURE.add(new Point(0, 5));
+ TRIANGLE_FIGURE.add(new Point(5, 5));
+ TRIANGLE_FIGURE.add(new Point(3, 0));
+ }
+
+ /**
+ * The template size point for translating a pin arrow figure
+ */
+ private static final Point TRIANGLE_FIGURE_SIZE = new Point(5, 5);
+
+ /**
+ * The template for drawing a rake figure
+ */
+ private static final List<Point> RAKE_FIGURE = new ArrayList<Point>(8);
+ static {
+ RAKE_FIGURE.add(new Point(0, 16));
+ RAKE_FIGURE.add(new Point(0, 7));
+ RAKE_FIGURE.add(new Point(8, 7));
+ RAKE_FIGURE.add(new Point(8, 0));
+ RAKE_FIGURE.add(new Point(8, 16));
+ RAKE_FIGURE.add(new Point(8, 7));
+ RAKE_FIGURE.add(new Point(16, 7));
+ RAKE_FIGURE.add(new Point(16, 16));
+ }
+
+ /**
+ * The template point for translating a rake figure
+ */
+ private static final Point RAKE_FIGURE_TRANSLATION = new Point(-22, -22);
+
+ /**
+ * The template for drawing an pin arrow figure turned right
+ */
+ private static final List<Point> RIGHT_PIN_ARROW_FIGURE = new ArrayList<Point>(8);
+ static {
+ RIGHT_PIN_ARROW_FIGURE.add(new Point(4, 2));
+ RIGHT_PIN_ARROW_FIGURE.add(new Point(7, 4));
+ RIGHT_PIN_ARROW_FIGURE.add(new Point(1, 4));
+ RIGHT_PIN_ARROW_FIGURE.add(new Point(7, 4));
+ RIGHT_PIN_ARROW_FIGURE.add(new Point(4, 6));
+ }
+
+ /**
+ * The template for drawing a pin arrow figure turned left
+ */
+ private static final List<Point> LEFT_PIN_ARROW_FIGURE = new ArrayList<Point>(8);
+ static {
+ LEFT_PIN_ARROW_FIGURE.add(new Point(4, 2));
+ LEFT_PIN_ARROW_FIGURE.add(new Point(1, 4));
+ LEFT_PIN_ARROW_FIGURE.add(new Point(7, 4));
+ LEFT_PIN_ARROW_FIGURE.add(new Point(1, 4));
+ LEFT_PIN_ARROW_FIGURE.add(new Point(4, 6));
+ }
+
+ /**
+ * The template for drawing a pin arrow figure turned up
+ */
+ private static final List<Point> UP_PIN_ARROW_FIGURE = new ArrayList<Point>(8);
+ static {
+ UP_PIN_ARROW_FIGURE.add(new Point(2, 4));
+ UP_PIN_ARROW_FIGURE.add(new Point(4, 1));
+ UP_PIN_ARROW_FIGURE.add(new Point(4, 7));
+ UP_PIN_ARROW_FIGURE.add(new Point(4, 1));
+ UP_PIN_ARROW_FIGURE.add(new Point(6, 4));
+ }
+
+ /**
+ * The template for drawing a pin arrow figure turned down
+ */
+ private static final List<Point> DOWN_PIN_ARROW_FIGURE = new ArrayList<Point>(8);
+ static {
+ DOWN_PIN_ARROW_FIGURE.add(new Point(2, 4));
+ DOWN_PIN_ARROW_FIGURE.add(new Point(4, 7));
+ DOWN_PIN_ARROW_FIGURE.add(new Point(4, 1));
+ DOWN_PIN_ARROW_FIGURE.add(new Point(4, 7));
+ DOWN_PIN_ARROW_FIGURE.add(new Point(6, 4));
+ }
+
+ /**
+ * The template size point for translating a pin arrow figure
+ */
+ private static final Point PIN_ARROW_FIGURE_SIZE = new Point(8, 8);
+
+ /**
+ * Draw the triangle or refresh it
+ *
+ * @param triangle
+ * figure which contains the triangle
+ * @param iMapMode
+ * the map mode to translate points
+ * @param parentDimension
+ * the dimension of the parent
+ */
+ public static void redrawTriangle(Polygon triangle, IMapMode iMapMode, Dimension parentDimension) {
+ triangle.removeAllPoints();
+ double xScale = parentDimension.preciseWidth() / TRIANGLE_FIGURE_SIZE.x;
+ double yScale = parentDimension.preciseHeight() / TRIANGLE_FIGURE_SIZE.y;
+ for(Point refPoint : TRIANGLE_FIGURE) {
+ Point translatedPoint = new Point(refPoint).scale(xScale, yScale);
+ iMapMode.DPtoLP(translatedPoint);
+ triangle.addPoint(translatedPoint);
+ }
+ }
+
+ /**
+ * Draw the rake or refresh it
+ *
+ * @param rake
+ * figure which contains the rake
+ * @param iMapMode
+ * the map mode to translate points
+ * @param parentDimension
+ * the dimension of the parent
+ */
+ public static void redrawRake(Polyline rake, IMapMode iMapMode, Dimension parentDimension) {
+ rake.removeAllPoints();
+ Point translationPoint = new Point(RAKE_FIGURE_TRANSLATION);
+ translationPoint.translate(parentDimension);
+ for(Point refPoint : RAKE_FIGURE) {
+ Point translatedPoint = new Point(refPoint).translate(translationPoint);
+ iMapMode.DPtoLP(translatedPoint);
+ rake.addPoint(translatedPoint);
+ }
+ }
+
+ /**
+ * Draw the pin arrow or refresh it
+ *
+ * @param arrow
+ * figure which contains the arrow
+ * @param iMapMode
+ * the map mode to translate points
+ * @param parentDimension
+ * the dimension of the parent
+ * @param direction
+ * the direction to which the arrow is directed : {@link PositionConstants#SOUTH}, {@link PositionConstants#NORTH},
+ * {@link PositionConstants#EAST}, {@link PositionConstants#WEST}
+ */
+ public static void redrawPinArrow(Polyline arrow, IMapMode iMapMode, Dimension parentDimension, int direction) {
+ arrow.removeAllPoints();
+ List<Point> template;
+ switch(direction) {
+ case PositionConstants.NORTH:
+ template = UP_PIN_ARROW_FIGURE;
+ break;
+ case PositionConstants.SOUTH:
+ template = DOWN_PIN_ARROW_FIGURE;
+ break;
+ case PositionConstants.WEST:
+ template = LEFT_PIN_ARROW_FIGURE;
+ break;
+ case PositionConstants.EAST:
+ default:
+ template = RIGHT_PIN_ARROW_FIGURE;
+ break;
+ }
+ double xScale = parentDimension.preciseWidth() / PIN_ARROW_FIGURE_SIZE.x;
+ double yScale = parentDimension.preciseHeight() / PIN_ARROW_FIGURE_SIZE.y;
+ for(Point refPoint : template) {
+ Point translatedPoint = new Point(refPoint).scale(xScale, yScale);
+ iMapMode.DPtoLP(translatedPoint);
+ arrow.addPoint(translatedPoint);
+ }
+ }
+
+ /**
+ * Undraw the polyline figure
+ *
+ * @param figure
+ * figure to undraw
+ */
+ public static void undrawFigure(Polyline figure) {
+ figure.removeAllPoints();
+ }
+
+ /**
+ * Get the size of the edit part node
+ *
+ * @param editPart
+ * edit part
+ * @param dimensionChangeEvent
+ * the change dimension event or null
+ * @return the node size
+ */
+ public static Dimension getNodeSize(AbstractGraphicalEditPart editPart, Notification dimensionChangeEvent) {
+ Bounds bounds = null;
+ // if a bounds change is notified, size may have changed, otherwise, get size from model shape
+ if(dimensionChangeEvent != null && dimensionChangeEvent.getNotifier() instanceof Bounds) {
+ bounds = (Bounds)dimensionChangeEvent.getNotifier();
+ } else if(editPart.getModel() instanceof Shape) {
+ Shape shape = (Shape)editPart.getModel();
+ if(shape.getLayoutConstraint() instanceof Bounds) {
+ bounds = (Bounds)shape.getLayoutConstraint();
+ }
+ }
+ Dimension size = null;
+ if(bounds != null) {
+ size = new Dimension(bounds.getWidth(), bounds.getHeight());
+ }
+ if(size == null || size.isEmpty()) {
+ // recover the size from the figure
+ size = editPart.getFigure().getSize();
+ if(size == null || size.isEmpty()) {
+ size = editPart.getFigure().getPreferredSize();
+ }
+ }
+ return size;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/helper/ActivityLinkMappingHelper.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/helper/ActivityLinkMappingHelper.java
index 5600c9923f9..d68cae47f4b 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/helper/ActivityLinkMappingHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/helper/ActivityLinkMappingHelper.java
@@ -14,12 +14,16 @@
package org.eclipse.papyrus.diagram.activity.helper;
import java.util.Collection;
+import java.util.Collections;
import org.eclipse.papyrus.diagram.common.helper.ILinkMappingHelper;
import org.eclipse.papyrus.diagram.common.helper.LinkMappingHelper;
import org.eclipse.papyrus.diagram.common.helper.LinkMappingHelper.CommonSourceUMLSwitch;
import org.eclipse.papyrus.diagram.common.helper.LinkMappingHelper.CommonTargetUMLSwitch;
+import org.eclipse.uml2.uml.ActivityEdge;
+import org.eclipse.uml2.uml.ControlFlow;
import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.ObjectFlow;
/**
* Specialization of the link mapping helper for the Activity diagram
@@ -56,13 +60,17 @@ public class ActivityLinkMappingHelper implements ILinkMappingHelper {
public Collection<?> getSource(Element link) {
return LinkMappingHelper.getSource(link, new CommonSourceUMLSwitch() {
- public java.util.Collection<?> caseInclude(org.eclipse.uml2.uml.Include object) {
- return object.getSources();
- };
+ public Collection<?> caseActivityEdge(ActivityEdge object) {
+ return Collections.singleton(object.getSource());
+ }
- public java.util.Collection<?> caseExtend(org.eclipse.uml2.uml.Extend object) {
- return object.getSources();
- };
+ public Collection<?> caseObjectFlow(ObjectFlow object) {
+ return caseActivityEdge(object);
+ }
+
+ public Collection<?> caseControlFlow(ControlFlow object) {
+ return caseActivityEdge(object);
+ }
});
}
@@ -72,13 +80,17 @@ public class ActivityLinkMappingHelper implements ILinkMappingHelper {
public Collection<?> getTarget(Element link) {
return LinkMappingHelper.getTarget(link, new CommonTargetUMLSwitch() {
- public java.util.Collection<?> caseInclude(org.eclipse.uml2.uml.Include object) {
- return object.getTargets();
- };
+ public Collection<?> caseActivityEdge(ActivityEdge object) {
+ return Collections.singleton(object.getTarget());
+ }
+
+ public Collection<?> caseObjectFlow(ObjectFlow object) {
+ return caseActivityEdge(object);
+ }
- public java.util.Collection<?> caseExtend(org.eclipse.uml2.uml.Extend object) {
- return object.getTargets();
- };
+ public Collection<?> caseControlFlow(ControlFlow object) {
+ return caseActivityEdge(object);
+ }
});
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/helper/PinAndParameterSynchronizer.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/helper/PinAndParameterSynchronizer.java
new file mode 100644
index 00000000000..ad2f1f96d28
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/helper/PinAndParameterSynchronizer.java
@@ -0,0 +1,1260 @@
+/*****************************************************************************
+ * 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.diagram.activity.helper;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.CopyCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.validation.AbstractModelConstraint;
+import org.eclipse.emf.validation.EMFEventType;
+import org.eclipse.emf.validation.IValidationContext;
+import org.eclipse.gmf.runtime.common.core.util.Log;
+import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIPlugin;
+import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIStatusCodes;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.core.utils.EditorUtils;
+import org.eclipse.papyrus.diagram.activity.edit.dialogs.ConfirmPinAndParameterSyncDialog;
+import org.eclipse.papyrus.diagram.activity.edit.dialogs.WarningAndLinkDialog;
+import org.eclipse.papyrus.diagram.activity.part.Messages;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.common.util.CacheAdapter;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.CallAction;
+import org.eclipse.uml2.uml.CallBehaviorAction;
+import org.eclipse.uml2.uml.CallOperationAction;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.OutputPin;
+import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.ParameterDirectionKind;
+import org.eclipse.uml2.uml.Pin;
+import org.eclipse.uml2.uml.Type;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+/**
+ * The PinAndParameterSynchronizer is a validator which ensure Pins and their corresponding (if a correspondence can be established) Parameters are
+ * correctly synchronized
+ *
+ */
+public class PinAndParameterSynchronizer extends AbstractModelConstraint {
+
+ /** The label provider */
+ private static final ILabelProvider labelProvider = new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
+
+ /** The constant to initialize target pin name */
+ private static final String TARGET_PIN_INITIALIZATION_NAME = "target";
+
+ /**
+ * Validate modification and update associated elements if necessary
+ *
+ * @see org.eclipse.emf.validation.AbstractModelConstraint#validate(org.eclipse.emf.validation.IValidationContext)
+ *
+ * @param ctx
+ * validation context
+ * @return status
+ */
+ @Override
+ public IStatus validate(IValidationContext ctx) {
+ try {
+ EObject eObject = ctx.getTarget();
+ // handle action creation separately not to confuse with case when Behavior is modified
+ if((EMFEventType.ADD.equals(ctx.getEventType()) || EMFEventType.ADD_MANY.equals(ctx.getEventType())) && ctx.getFeatureNewValue() instanceof CallBehaviorAction) {
+ // CallBehaviorAction created
+ CompoundCommand cmd = getResetPinsCmd((CallAction)ctx.getFeatureNewValue());
+ if(!cmd.isEmpty() && cmd.canExecute()) {
+ cmd.execute();
+ }
+ } else if((EMFEventType.ADD.equals(ctx.getEventType()) || EMFEventType.ADD_MANY.equals(ctx.getEventType())) && ctx.getFeatureNewValue() instanceof CallOperationAction) {
+ // CallOperationAction created
+ CompoundCommand cmd = getResetPinsCmd((CallAction)ctx.getFeatureNewValue());
+ if(!cmd.isEmpty() && cmd.canExecute()) {
+ cmd.execute();
+ }
+ }
+ // handle Operation move for redefining target pin type
+ if((EMFEventType.SET.equals(ctx.getEventType()) || EMFEventType.UNSET.equals(ctx.getEventType())) && UMLPackage.eINSTANCE.getOperation_Class().equals(ctx.getFeature()) && eObject instanceof Operation) {
+ // Operation moved
+ CompoundCommand cmd = getUpdateTargetPinsType((Operation)eObject);
+ if(!cmd.isEmpty() && cmd.canExecute()) {
+ if(askForValidation(getCallingActions((Operation)eObject))) {
+ cmd.execute();
+ } else {
+ return ctx.createFailureStatus();
+ }
+ }
+ }
+
+ if(eObject instanceof ValueSpecification) {
+ // the value specification may be in an upperValue or lowerValue
+ // replace values with appropriate ones
+ EObject topValueSpec = eObject;
+ while(topValueSpec.eContainer() instanceof ValueSpecification) {
+ topValueSpec = topValueSpec.eContainer();
+ }
+ eObject = topValueSpec.eContainer();
+ }
+ if(eObject instanceof Pin) {
+ // special case for target pin : no synchronization, but type
+ Element owner = ((Pin)eObject).getOwner();
+ Pin target = null;
+ if(owner instanceof CallOperationAction) {
+ target = ((CallOperationAction)owner).getTarget();
+ }
+ if(target != null && target.equals(eObject)) {
+ return handleTargetPinModification((Pin)eObject, ctx);
+ } else {
+ // Pin is modified, report modification on Parameter
+ return handlePinModification((Pin)eObject, ctx);
+ }
+ } else if(eObject instanceof Parameter) {
+ // Parameter is modified, report modification on Pins
+ return handleParameterModification((Parameter)eObject, ctx);
+ } else if(eObject instanceof CallOperationAction) {
+ // action is modified, ensure deleted/added Pin impact a Parameter
+ return handleCallOperationActionModification((CallOperationAction)eObject, ctx);
+ } else if(eObject instanceof Operation) {
+ // Operation is modified, ensure deleted/added Parameter impact Pins
+ return handleOperationModification((Operation)eObject, ctx);
+ } else if(eObject instanceof CallBehaviorAction) {
+ // action is modified, ensure deleted/added Pin impact a Parameter
+ return handleCallBehaviorActionModification((CallBehaviorAction)eObject, ctx);
+ } else if(eObject instanceof Behavior) {
+ // Behavior is modified, ensure deleted/added Parameter impact Pins
+ return handleBehaviorModification((Behavior)eObject, ctx);
+ }
+ return ctx.createSuccessStatus();
+ } catch (RuntimeException rte) {
+ // avoid throwing uncaught exception which would disable the constraint
+ Log.warning(DiagramUIPlugin.getInstance(), DiagramUIStatusCodes.IGNORED_EXCEPTION_WARNING, "Unexpected exception during Pin and Parameter synchronization : ", rte);
+ // ensure that the constraint's failure does not prevent modification
+ return ctx.createSuccessStatus();
+ }
+ }
+
+ /**
+ * Test if the Pin feature impacts the parameter or if the Parameter feature impacts pins
+ *
+ * @param modifiedFeature
+ * the feature to test
+ * @return true if the feature impacts the associated Parameter or Pin objects
+ */
+ private boolean testPinOrParameterFeature(EStructuralFeature modifiedFeature) {
+ boolean type = UMLPackage.eINSTANCE.getTypedElement_Type().equals(modifiedFeature);
+ boolean ordering = UMLPackage.eINSTANCE.getMultiplicityElement_IsOrdered().equals(modifiedFeature);
+ boolean multiplicity = UMLPackage.eINSTANCE.getMultiplicityElement_IsUnique().equals(modifiedFeature) || UMLPackage.eINSTANCE.getMultiplicityElement_Lower().equals(modifiedFeature) || UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue().equals(modifiedFeature) || UMLPackage.eINSTANCE.getMultiplicityElement_Upper().equals(modifiedFeature) || UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue().equals(modifiedFeature);
+ boolean inAValueSpecification = ValueSpecification.class.isAssignableFrom(modifiedFeature.getContainerClass());
+ return type || ordering || multiplicity || inAValueSpecification;
+ }
+
+ /**
+ * Test if the Action feature impacts the number of Pins and Parameters
+ *
+ * @param modifiedFeature
+ * the feature to test
+ * @return true if the feature impacts the number of Parameters or Pins
+ */
+ private boolean testActionFeature(EStructuralFeature modifiedFeature) {
+ boolean input = UMLPackage.eINSTANCE.getInvocationAction_Argument().equals(modifiedFeature) || UMLPackage.eINSTANCE.getCallOperationAction_Target().equals(modifiedFeature);
+ boolean output = UMLPackage.eINSTANCE.getCallAction_Result().equals(modifiedFeature);
+ return input || output;
+ }
+
+ /**
+ * Ensure target Pin modification is correct
+ *
+ * @param pin
+ * modified pin
+ * @param ctx
+ * validation context
+ * @return status
+ */
+ private IStatus handleTargetPinModification(Pin pin, IValidationContext ctx) {
+ // the type of the target pin can not be modified.
+ if(UMLPackage.eINSTANCE.getTypedElement_Type().equals(ctx.getFeature())) {
+ Element owner = pin.getOwner();
+ if(owner instanceof CallOperationAction) {
+ proposeNavigation(((CallOperationAction)owner).getOperation());
+ }
+ return ctx.createFailureStatus();
+ }
+ return ctx.createSuccessStatus();
+ }
+
+ /**
+ * Propose the user to navigate to the given element
+ *
+ * @param element
+ * element to navigate to
+ */
+ private void proposeNavigation(NamedElement element) {
+ String elementLabel = labelProvider.getText(element);
+ String message = NLS.bind(Messages.PinAndParameterSynchronizer_UnauthorizedModificationRedirection, elementLabel);
+ WarningAndLinkDialog dialog = new WarningAndLinkDialog(Display.getDefault().getActiveShell(), Messages.PinAndParameterSynchronizer_UnauthorizedModificationTitle, message, element, elementLabel);
+ dialog.open();
+ }
+
+ /**
+ * Ensure Pin modification is in accordance with associated Parameter
+ *
+ * @param pin
+ * modified pin (not a target pin)
+ * @param ctx
+ * validation context
+ * @return status
+ */
+ private IStatus handlePinModification(Pin pin, IValidationContext ctx) {
+ if(EMFEventType.SET.equals(ctx.getEventType()) || EMFEventType.UNSET.equals(ctx.getEventType())) {
+ if(testPinOrParameterFeature(ctx.getFeature())) {
+ NamedElement invoked = getInvokedObject(pin);
+ if(invoked != null) {
+ proposeNavigation(invoked);
+ return ctx.createFailureStatus();
+ }
+ }
+ }
+ return ctx.createSuccessStatus();
+ }
+
+ /**
+ * Ensure Parameter modification is reported on associated Pins
+ *
+ * @param parameter
+ * modified parameter
+ * @param ctx
+ * validation context
+ * @return status
+ */
+ private IStatus handleParameterModification(Parameter parameter, IValidationContext ctx) {
+ if(EMFEventType.SET.equals(ctx.getEventType()) || EMFEventType.UNSET.equals(ctx.getEventType())) {
+ if(testPinOrParameterFeature(ctx.getFeature())) {
+ // Update corresponding pins
+ CompoundCommand cmd = getUpdatePinsCmd(getPins(parameter), parameter.getType(), parameter.isOrdered(), parameter.isUnique(), parameter.getLower(), parameter.getLowerValue(), parameter.getUpper(), parameter.getUpperValue());
+ if(!cmd.isEmpty() && cmd.canExecute()) {
+ if(askForValidation(getCallingActions(parameter.getOwner()))) {
+ cmd.execute();
+ } else {
+ return ctx.createFailureStatus();
+ }
+ }
+ } else if(UMLPackage.eINSTANCE.getParameter_Direction().equals(ctx.getFeature())) {
+ // Remove/Add corresponding pins with type in accordance to direction
+ for(Notification event : ctx.getAllEvents()) {
+ if(UMLPackage.eINSTANCE.getParameter_Direction().equals(event.getFeature()) || UMLPackage.eINSTANCE.getBehavioralFeature_OwnedParameter().equals(event.getFeature())) {
+ return changePinsBecauseOfParameterDirection(parameter, event, ctx);
+ }
+ }
+ }
+ }
+ return ctx.createSuccessStatus();
+ }
+
+ /**
+ * Change the Pins because parameter's direction has changed
+ *
+ * @param parameter
+ * the modified parameter
+ * @param event
+ * the direction change event
+ * @param ctx
+ * validation context
+ * @return status
+ */
+ private IStatus changePinsBecauseOfParameterDirection(Parameter parameter, Notification event, IValidationContext ctx) {
+ // constants used for type safety
+ List<Integer> emptyList = Collections.emptyList();
+ Map<Integer, Parameter> emptyMap = Collections.emptyMap();
+
+ Object oldDir = event.getOldValue();
+ Object newDir = event.getNewValue();
+ int inIndex = getIndex(parameter, true);
+ int outIndex = getIndex(parameter, false);
+ CompoundCommand globalCmd = new CompoundCommand();
+ List<CallAction> callingActions = getCallingActions(parameter.getOwner());
+ if(ParameterDirectionKind.IN_LITERAL.equals(oldDir)) {
+ if(ParameterDirectionKind.OUT_LITERAL.equals(newDir) || ParameterDirectionKind.RETURN_LITERAL.equals(newDir)) {
+ // explore referencing actions to remove in and add out
+ for(CallAction action : callingActions) {
+ CompoundCommand cmd = getRemovePinsCmd(action, Collections.singletonList(inIndex), emptyList);
+ globalCmd.append(cmd);
+ cmd = getAddPinsCmd(action, emptyMap, Collections.singletonMap(outIndex, parameter));
+ globalCmd.append(cmd);
+ }
+ } else if(ParameterDirectionKind.INOUT_LITERAL.equals(newDir)) {
+ // explore referencing actions to add out
+ for(CallAction action : callingActions) {
+ CompoundCommand cmd = getAddPinsCmd(action, emptyMap, Collections.singletonMap(outIndex, parameter));
+ globalCmd.append(cmd);
+ }
+ }
+ } else if(ParameterDirectionKind.OUT_LITERAL.equals(oldDir) || ParameterDirectionKind.RETURN_LITERAL.equals(oldDir)) {
+ if(ParameterDirectionKind.IN_LITERAL.equals(newDir)) {
+ // explore referencing actions to remove out and add in
+ for(CallAction action : callingActions) {
+ CompoundCommand cmd = getRemovePinsCmd((CallAction)action, emptyList, Collections.singletonList(outIndex));
+ globalCmd.append(cmd);
+ cmd = getAddPinsCmd(action, Collections.singletonMap(inIndex, parameter), emptyMap);
+ globalCmd.append(cmd);
+ }
+ } else if(ParameterDirectionKind.INOUT_LITERAL.equals(newDir)) {
+ // explore referencing actions to add in
+ for(CallAction action : callingActions) {
+ CompoundCommand cmd = getAddPinsCmd(action, Collections.singletonMap(inIndex, parameter), emptyMap);
+ globalCmd.append(cmd);
+ }
+ }
+ } else if(ParameterDirectionKind.INOUT_LITERAL.equals(oldDir)) {
+ if(ParameterDirectionKind.IN_LITERAL.equals(newDir)) {
+ // explore referencing actions to remove out
+ for(CallAction action : callingActions) {
+ CompoundCommand cmd = getRemovePinsCmd((CallAction)action, emptyList, Collections.singletonList(outIndex));
+ globalCmd.append(cmd);
+ }
+ } else if(ParameterDirectionKind.OUT_LITERAL.equals(newDir) || ParameterDirectionKind.RETURN_LITERAL.equals(newDir)) {
+ // explore referencing actions to remove in
+ for(CallAction action : callingActions) {
+ CompoundCommand cmd = getRemovePinsCmd((CallAction)action, Collections.singletonList(inIndex), emptyList);
+ globalCmd.append(cmd);
+ }
+ }
+ }
+ if(!globalCmd.isEmpty() && globalCmd.canExecute()) {
+ if(askForValidation(callingActions)) {
+ globalCmd.execute();
+ } else {
+ return ctx.createFailureStatus();
+ }
+ }
+ return ctx.createSuccessStatus();
+ }
+
+ /**
+ * Get the list of actions calling this element
+ *
+ * @param element
+ * an Operation of a Behavior
+ * @return list of CallAction
+ */
+ private static List<CallAction> getCallingActions(Element element) {
+ // explore referencing actions
+ Set<CallAction> callingActions = new HashSet<CallAction>();
+ if(element instanceof Behavior || element instanceof Operation) {
+ Collection<Setting> references = CacheAdapter.INSTANCE.getNonNavigableInverseReferences(element);
+ for(Setting ref : references) {
+ EObject action = ref.getEObject();
+ // parameter's owner is action's called Operation
+ boolean operationCase = UMLPackage.eINSTANCE.getCallOperationAction_Operation().equals(ref.getEStructuralFeature());
+ // parameter's owner is action's called Behavior
+ boolean behaviorCase = UMLPackage.eINSTANCE.getCallBehaviorAction_Behavior().equals(ref.getEStructuralFeature());
+ if((operationCase || behaviorCase) && action instanceof CallAction && action.eContainer() != null) {
+ callingActions.add((CallAction)action);
+ }
+ }
+ }
+ return new ArrayList<CallAction>(callingActions);
+ }
+
+ /**
+ * Ensure CallOperationAction modification is reported on associated Operation
+ *
+ * @param action
+ * modified action
+ * @param ctx
+ * validation context
+ * @return status
+ */
+ private IStatus handleCallOperationActionModification(CallOperationAction action, IValidationContext ctx) {
+ if(EMFEventType.ADD.equals(ctx.getEventType()) || EMFEventType.ADD_MANY.equals(ctx.getEventType())) {
+ if(testActionFeature(ctx.getFeature()) && action.getOperation() != null) {
+ /*
+ * Yet, no modification of parameters is allowed from the CallOperationAction.
+ * This means we can not add Pins
+ */
+ proposeNavigation(action.getOperation());
+ return ctx.createFailureStatus();
+ }
+ } else if(EMFEventType.REMOVE.equals(ctx.getEventType()) || EMFEventType.REMOVE_MANY.equals(ctx.getEventType())) {
+ if(testActionFeature(ctx.getFeature()) && action.getOperation() != null) {
+ /*
+ * Yet, no modification of parameters is allowed from the CallOperationAction.
+ * This means we can not remove Pins
+ */
+ proposeNavigation(action.getOperation());
+ return ctx.createFailureStatus();
+ }
+ } else if(EMFEventType.SET.equals(ctx.getEventType()) || EMFEventType.UNSET.equals(ctx.getEventType())) {
+ if(UMLPackage.eINSTANCE.getCallOperationAction_Operation().equals(ctx.getFeature())) {
+ CompoundCommand cmd = getResetPinsCmd(action);
+ if(!cmd.isEmpty() && cmd.canExecute()) {
+ cmd.execute();
+ }
+ }
+ }
+ return ctx.createSuccessStatus();
+ }
+
+ /**
+ * Ensure CallBehaviorAction modification is reported on associated Behavior
+ *
+ * @param action
+ * modified action
+ * @param ctx
+ * validation context
+ * @return status
+ */
+ private IStatus handleCallBehaviorActionModification(CallBehaviorAction action, IValidationContext ctx) {
+ if(EMFEventType.ADD.equals(ctx.getEventType()) || EMFEventType.ADD_MANY.equals(ctx.getEventType())) {
+ if(testActionFeature(ctx.getFeature()) && action.getBehavior() != null) {
+ /*
+ * Yet, no modification of parameters is allowed from the CallBehaviorAction.
+ * This means we can not add Pins
+ */
+ proposeNavigation(action.getBehavior());
+ return ctx.createFailureStatus();
+ }
+ } else if(EMFEventType.REMOVE.equals(ctx.getEventType()) || EMFEventType.REMOVE_MANY.equals(ctx.getEventType())) {
+ if(testActionFeature(ctx.getFeature()) && action.getBehavior() != null) {
+ /*
+ * Yet, no modification of parameters is allowed from the CallBehaviorAction.
+ * This means we can not remove Pins
+ */
+ proposeNavigation(action.getBehavior());
+ return ctx.createFailureStatus();
+ }
+ } else if(EMFEventType.SET.equals(ctx.getEventType()) || EMFEventType.UNSET.equals(ctx.getEventType())) {
+ if(UMLPackage.eINSTANCE.getCallBehaviorAction_Behavior().equals(ctx.getFeature())) {
+ CompoundCommand cmd = getResetPinsCmd(action);
+ if(!cmd.isEmpty() && cmd.canExecute()) {
+ cmd.execute();
+ }
+ }
+ }
+ return ctx.createSuccessStatus();
+ }
+
+ /**
+ * Ensure Operation modification is reported on associated actions
+ *
+ * @param operation
+ * modified operation
+ * @param ctx
+ * validation context
+ * @return status
+ */
+ private IStatus handleOperationModification(Operation operation, IValidationContext ctx) {
+ if(EMFEventType.ADD.equals(ctx.getEventType()) || EMFEventType.ADD_MANY.equals(ctx.getEventType())) {
+ if(UMLPackage.eINSTANCE.getBehavioralFeature_OwnedParameter().equals(ctx.getFeature())) {
+ return handleParametersAdded(operation, ctx);
+ }
+ } else if(EMFEventType.REMOVE.equals(ctx.getEventType()) || EMFEventType.REMOVE_MANY.equals(ctx.getEventType())) {
+ if(UMLPackage.eINSTANCE.getBehavioralFeature_OwnedParameter().equals(ctx.getFeature())) {
+ return handleParametersRemoved(operation, ctx);
+ }
+ }
+ return ctx.createSuccessStatus();
+ }
+
+ /**
+ * Ensure Behavior modification is reported on associated actions
+ *
+ * @param behavior
+ * modified behavior
+ * @param ctx
+ * validation context
+ * @return status
+ */
+ private IStatus handleBehaviorModification(Behavior behavior, IValidationContext ctx) {
+ if(EMFEventType.ADD.equals(ctx.getEventType()) || EMFEventType.ADD_MANY.equals(ctx.getEventType())) {
+ if(UMLPackage.eINSTANCE.getBehavior_OwnedParameter().equals(ctx.getFeature())) {
+ return handleParametersAdded(behavior, ctx);
+ }
+ } else if(EMFEventType.REMOVE.equals(ctx.getEventType()) || EMFEventType.REMOVE_MANY.equals(ctx.getEventType())) {
+ if(UMLPackage.eINSTANCE.getBehavior_OwnedParameter().equals(ctx.getFeature())) {
+ return handleParametersRemoved(behavior, ctx);
+ }
+ }
+ return ctx.createSuccessStatus();
+ }
+
+ /**
+ * Ensure Pins corresponding to parameters are removed
+ *
+ * @param element
+ * modified operation or behavior
+ * @param ctx
+ * validation context
+ * @return status
+ */
+ private IStatus handleParametersRemoved(NamedElement element, IValidationContext ctx) {
+ // construct the list of removed indexes and their direction
+ Map<Integer, ParameterDirectionKind> removedParameterIndexes = new HashMap<Integer, ParameterDirectionKind>();
+ for(Notification event : ctx.getAllEvents()) {
+ if(UMLPackage.eINSTANCE.getBehavior_OwnedParameter().equals(event.getFeature()) || UMLPackage.eINSTANCE.getBehavioralFeature_OwnedParameter().equals(event.getFeature())) {
+ Object removedValue = event.getOldValue();
+ if(removedValue instanceof Parameter) {
+ // handle parameter direction
+ ParameterDirectionKind dir = ((Parameter)removedValue).getDirection();
+ removedParameterIndexes.put(event.getPosition(), dir);
+ }
+ }
+ }
+ List<Parameter> newParameters = Collections.emptyList();
+ if(element instanceof Behavior) {
+ newParameters = ((Behavior)element).getOwnedParameters();
+ } else if(element instanceof Operation) {
+ newParameters = ((Operation)element).getOwnedParameters();
+ }
+ List<Integer> removedInputPinIndexes = new LinkedList<Integer>();
+ List<Integer> removedOutputPinIndexes = new LinkedList<Integer>();
+ Iterator<Parameter> parametersIterator = newParameters.iterator();
+ // iterate on the virtual list of old parameters (correspondingParameterIndex) to deduce pins indexes
+ int correspondingParameterIndex = 0;
+ int correspondingInputPinIndex = 0;
+ int correspondingOutputPinIndex = 0;
+ while(removedParameterIndexes.containsKey(correspondingParameterIndex) || parametersIterator.hasNext()) {
+ if(removedParameterIndexes.containsKey(correspondingParameterIndex)) {
+ // parameter removed, pin(s) removed
+ switch(removedParameterIndexes.get(correspondingParameterIndex)) {
+ case IN_LITERAL:
+ removedInputPinIndexes.add(correspondingInputPinIndex);
+ correspondingInputPinIndex++;
+ break;
+ case OUT_LITERAL:
+ case RETURN_LITERAL:
+ removedOutputPinIndexes.add(correspondingOutputPinIndex);
+ correspondingOutputPinIndex++;
+ break;
+ case INOUT_LITERAL:
+ // in-out parameter has two pins
+ removedInputPinIndexes.add(correspondingInputPinIndex);
+ correspondingInputPinIndex++;
+ removedOutputPinIndexes.add(correspondingOutputPinIndex);
+ correspondingOutputPinIndex++;
+ break;
+ }
+ } else {
+ // parameter not removed, pin(s) not removed
+ Parameter nextParam = parametersIterator.next();
+ switch(nextParam.getDirection()) {
+ case IN_LITERAL:
+ correspondingInputPinIndex++;
+ break;
+ case OUT_LITERAL:
+ case RETURN_LITERAL:
+ correspondingOutputPinIndex++;
+ break;
+ case INOUT_LITERAL:
+ // in-out parameter has two pins
+ correspondingInputPinIndex++;
+ correspondingOutputPinIndex++;
+ break;
+ }
+ }
+ // explore next parameter
+ correspondingParameterIndex++;
+ }
+
+ CompoundCommand globalCmd = new CompoundCommand();
+ // explore referencing actions
+ List<CallAction> callingActions = getCallingActions(element);
+ for(CallAction action : callingActions) {
+ CompoundCommand cmd = getRemovePinsCmd(action, removedInputPinIndexes, removedOutputPinIndexes);
+ globalCmd.append(cmd);
+ }
+ if(!globalCmd.isEmpty() && globalCmd.canExecute()) {
+ if(askForValidation(callingActions)) {
+ globalCmd.execute();
+ } else {
+ return ctx.createFailureStatus();
+ }
+ }
+ return ctx.createSuccessStatus();
+ }
+
+ /**
+ * Ensure Pins corresponding to parameters are added
+ *
+ * @param element
+ * modified operation or behavior
+ * @param ctx
+ * validation context
+ * @return status
+ */
+ private IStatus handleParametersAdded(NamedElement element, IValidationContext ctx) {
+ // construct the list of added indexes and their direction
+ List<Parameter> addedParameters = new LinkedList<Parameter>();
+ for(Notification event : ctx.getAllEvents()) {
+ if(UMLPackage.eINSTANCE.getBehavior_OwnedParameter().equals(event.getFeature()) || UMLPackage.eINSTANCE.getBehavioralFeature_OwnedParameter().equals(event.getFeature())) {
+ Object addedValue = event.getNewValue();
+ if(addedValue instanceof Parameter) {
+ addedParameters.add((Parameter)addedValue);
+ }
+ }
+ }
+ List<Parameter> newParameters = Collections.emptyList();
+ if(element instanceof Behavior) {
+ newParameters = ((Behavior)element).getOwnedParameters();
+ } else if(element instanceof Operation) {
+ newParameters = ((Operation)element).getOwnedParameters();
+ }
+ Map<Integer, Parameter> addedInputPinMap = new HashMap<Integer, Parameter>();
+ Map<Integer, Parameter> addedOutputPinMap = new HashMap<Integer, Parameter>();
+ // iterate on the list of new parameters to deduce pins indexes
+ int correspondingInputPinIndex = 0;
+ int correspondingOutputPinIndex = 0;
+ for(Parameter param : newParameters) {
+ if(addedParameters.contains(param)) {
+ // parameter added, pin(s) to add
+ switch(param.getDirection()) {
+ case IN_LITERAL:
+ addedInputPinMap.put(correspondingInputPinIndex, param);
+ correspondingInputPinIndex++;
+ break;
+ case OUT_LITERAL:
+ case RETURN_LITERAL:
+ addedOutputPinMap.put(correspondingOutputPinIndex, param);
+ correspondingOutputPinIndex++;
+ break;
+ case INOUT_LITERAL:
+ // in-out parameter has two pins
+ addedInputPinMap.put(correspondingInputPinIndex, param);
+ correspondingInputPinIndex++;
+ addedOutputPinMap.put(correspondingOutputPinIndex, param);
+ correspondingOutputPinIndex++;
+ break;
+ }
+ } else {
+ // parameter not added, pin already exists
+ switch(param.getDirection()) {
+ case IN_LITERAL:
+ correspondingInputPinIndex++;
+ break;
+ case OUT_LITERAL:
+ case RETURN_LITERAL:
+ correspondingOutputPinIndex++;
+ break;
+ case INOUT_LITERAL:
+ // in-out parameter has two pins
+ correspondingInputPinIndex++;
+ correspondingOutputPinIndex++;
+ break;
+ }
+ }
+ // explore next parameter
+ }
+
+ CompoundCommand globalCmd = new CompoundCommand();
+ // explore referencing actions
+ List<CallAction> callingActions = getCallingActions(element);
+ for(CallAction action : callingActions) {
+ CompoundCommand cmd = getAddPinsCmd(action, addedInputPinMap, addedOutputPinMap);
+ globalCmd.append(cmd);
+ }
+ if(!globalCmd.isEmpty() && globalCmd.canExecute()) {
+ if(askForValidation(callingActions)) {
+ globalCmd.execute();
+ } else {
+ return ctx.createFailureStatus();
+ }
+ }
+ return ctx.createSuccessStatus();
+ }
+
+ /**
+ * Get the command to update type of target input pins referring the operation
+ *
+ * @param operation
+ * the operation which parent type has changed
+ * @return the command
+ */
+ private CompoundCommand getUpdateTargetPinsType(Operation operation) {
+ CompoundCommand globalCmd = new CompoundCommand();
+ // get operation parent type
+ Type type = null;
+ Element owner = operation.getOwner();
+ if(owner instanceof Type) {
+ type = (Type)owner;
+ }
+ if(type != null) {// Get the editing domain
+ TransactionalEditingDomain editingdomain = EditorUtils.getTransactionalEditingDomain();
+ // explore referencing actions
+ for(CallAction action : getCallingActions(operation)) {// operation is action's called Operation
+ InputPin targetPin = ((CallOperationAction)action).getTarget();
+ if(targetPin != null) {
+ Command cmd = SetCommand.create(editingdomain, targetPin, UMLPackage.eINSTANCE.getTypedElement_Type(), type);
+ globalCmd.append(cmd);
+ }
+ }
+ }
+ return globalCmd;
+ }
+
+ /**
+ * Get the command to remove pins linked with parameter at the given indexes
+ *
+ * @param action
+ * the CallOperationAction or CallBehaviorAction (no effect otherwise)
+ * @param removedPinsIndexes
+ * the indexes of input pins to remove (except target)
+ * @param removedOutputPinsIndexes
+ * the indexes of output pins to remove
+ * @return the command to remove corresponding Pins
+ */
+ private CompoundCommand getRemovePinsCmd(CallAction action, List<Integer> removedIntputPinsIndexes, List<Integer> removedOutputPinsIndexes) {
+ CompoundCommand globalCmd = new CompoundCommand();
+ // Get the editing domain
+ TransactionalEditingDomain editingdomain = EditorUtils.getTransactionalEditingDomain();
+ if(action instanceof CallBehaviorAction || action instanceof CallOperationAction) {
+ ArrayList<InputPin> removedIn = new ArrayList<InputPin>(removedIntputPinsIndexes.size());
+ for(int i : removedIntputPinsIndexes) {
+ if(i < action.getArguments().size()) {
+ removedIn.add(action.getArguments().get(i));
+ }
+ }
+ if(!removedIn.isEmpty()) {
+ Command cmd = RemoveCommand.create(editingdomain, action, UMLPackage.eINSTANCE.getInvocationAction_Argument(), removedIn);
+ globalCmd.append(cmd);
+ }
+ ArrayList<OutputPin> removedOut = new ArrayList<OutputPin>(removedIntputPinsIndexes.size());
+ for(int i : removedOutputPinsIndexes) {
+ if(i < action.getResults().size()) {
+ removedOut.add(action.getResults().get(i));
+ }
+ }
+ if(!removedOut.isEmpty()) {
+ Command cmd = RemoveCommand.create(editingdomain, action, UMLPackage.eINSTANCE.getCallAction_Result(), removedOut);
+ globalCmd.append(cmd);
+ }
+ }
+ return globalCmd;
+ }
+
+ /**
+ * Get the command to add pins linked with parameter at the given indexes
+ *
+ * @param action
+ * the CallBehaviorAction or CallOperationAction (no effect otherwise)
+ * @param addedInputPinMap
+ * the indexes of input pins to add and parameters to copy
+ * @param addedOutputPinMap
+ * the indexes of output pins to add and parameters to copy
+ * @return the command to add corresponding Pins
+ */
+ private CompoundCommand getAddPinsCmd(CallAction action, Map<Integer, Parameter> addedInputPinMap, Map<Integer, Parameter> addedOutputPinMap) {
+ CompoundCommand globalCmd = new CompoundCommand();
+ // Get the editing domain
+ TransactionalEditingDomain editingdomain = EditorUtils.getTransactionalEditingDomain();
+ if(action instanceof CallBehaviorAction || action instanceof CallOperationAction) {
+ /*
+ * An element can not be added at an index bigger than the size.
+ * Hence, add commands must be sorted according to the decreasing index
+ * and the index must be adapted taking in account elements that will be added.
+ * We use a bucket sort on indexes of both maps.
+ */
+ int nextKey = addedInputPinMap.size() + action.getArguments().size();
+ int numberOfPinsToAdd = addedInputPinMap.size();
+ while(numberOfPinsToAdd > 0) {
+ if(addedInputPinMap.containsKey(nextKey)) {
+ numberOfPinsToAdd--;
+ InputPin pin = createInputPin(addedInputPinMap.get(nextKey));
+ // index at which pin is added must take in account other pins added after
+ int addIndex = nextKey - numberOfPinsToAdd;
+ Command cmd = AddCommand.create(editingdomain, action, UMLPackage.eINSTANCE.getInvocationAction_Argument(), pin, addIndex);
+ globalCmd.append(cmd);
+ }
+ nextKey--;
+ }
+ nextKey = addedOutputPinMap.size() + action.getResults().size();
+ numberOfPinsToAdd = addedOutputPinMap.size();
+ while(numberOfPinsToAdd > 0) {
+ if(addedOutputPinMap.containsKey(nextKey)) {
+ numberOfPinsToAdd--;
+ OutputPin pin = createOutputPin(addedOutputPinMap.get(nextKey));
+ // index at which pin is added must take in account other pins added after
+ int addIndex = nextKey - numberOfPinsToAdd;
+ Command cmd = AddCommand.create(editingdomain, action, UMLPackage.eINSTANCE.getCallAction_Result(), pin, addIndex);
+ globalCmd.append(cmd);
+ }
+ nextKey--;
+ }
+ }
+ return globalCmd;
+ }
+
+ /**
+ * Create an output pin with valued copied from the parameter
+ *
+ * @param parameter
+ * the reference parameter
+ */
+ private OutputPin createOutputPin(Parameter parameter) {
+ OutputPin pin = UMLFactory.eINSTANCE.createOutputPin();
+ // Initialize name
+ pin.setName(parameter.getName());
+ // Synchronize type
+ pin.setType(parameter.getType());
+ // Synchronize is ordered
+ pin.setIsOrdered(parameter.isOrdered());
+ // Synchronize mutliplicity : is unique
+ pin.setIsUnique(parameter.isUnique());
+ // Synchronize mutliplicity : lower value
+ ValueSpecification lowerValue = parameter.getLowerValue();
+ if(lowerValue != null) {
+ // use a copy command for new value
+ Command copy = CopyCommand.create(EditorUtils.getTransactionalEditingDomain(), Collections.singleton(lowerValue));
+ copy.execute();
+ Collection<?> result = copy.getResult();
+ Object valueToAffect = null;
+ if(!result.isEmpty()) {
+ valueToAffect = result.iterator().next();
+ }
+ if(valueToAffect instanceof ValueSpecification) {
+ pin.setLowerValue((ValueSpecification)valueToAffect);
+ }
+ }
+ // Synchronize mutliplicity : upper value
+ ValueSpecification upperValue = parameter.getUpperValue();
+ if(upperValue != null) {
+ // use a copy command for new value
+ Command copy = CopyCommand.create(EditorUtils.getTransactionalEditingDomain(), Collections.singleton(upperValue));
+ copy.execute();
+ Collection<?> result = copy.getResult();
+ Object valueToAffect = null;
+ if(!result.isEmpty()) {
+ valueToAffect = result.iterator().next();
+ }
+ if(valueToAffect instanceof ValueSpecification) {
+ pin.setUpperValue((ValueSpecification)valueToAffect);
+ }
+ }
+ return pin;
+ }
+
+ /**
+ * Create a target input pin from a given operation
+ *
+ * @param operation
+ * the invoked operation
+ */
+ private InputPin createTargetPin(Operation operation) {
+ InputPin pin = UMLFactory.eINSTANCE.createInputPin();
+ Element owningType = operation.getOwner();
+ if(owningType instanceof Type) {
+ pin.setType((Type)owningType);
+ }
+ pin.setName(TARGET_PIN_INITIALIZATION_NAME);
+ return pin;
+ }
+
+ /**
+ * Create an input pin with valued copied from the parameter
+ *
+ * @param parameter
+ * the reference parameter
+ */
+ private InputPin createInputPin(Parameter parameter) {
+ InputPin pin = UMLFactory.eINSTANCE.createInputPin();
+ // Initialize name
+ pin.setName(parameter.getName());
+ // Synchronize type
+ pin.setType(parameter.getType());
+ // Synchronize is ordered
+ pin.setIsOrdered(parameter.isOrdered());
+ // Synchronize mutliplicity : is unique
+ pin.setIsUnique(parameter.isUnique());
+ // Synchronize mutliplicity : lower value
+ ValueSpecification lowerValue = parameter.getLowerValue();
+ if(lowerValue != null) {
+ // use a copy command for new value
+ Command copy = CopyCommand.create(EditorUtils.getTransactionalEditingDomain(), Collections.singleton(lowerValue));
+ copy.execute();
+ Collection<?> result = copy.getResult();
+ Object valueToAffect = null;
+ if(!result.isEmpty()) {
+ valueToAffect = result.iterator().next();
+ }
+ if(valueToAffect instanceof ValueSpecification) {
+ pin.setLowerValue((ValueSpecification)valueToAffect);
+ }
+ }
+ // Synchronize mutliplicity : upper value
+ ValueSpecification upperValue = parameter.getUpperValue();
+ if(upperValue != null) {
+ // use a copy command for new value
+ Command copy = CopyCommand.create(EditorUtils.getTransactionalEditingDomain(), Collections.singleton(upperValue));
+ copy.execute();
+ Collection<?> result = copy.getResult();
+ Object valueToAffect = null;
+ if(!result.isEmpty()) {
+ valueToAffect = result.iterator().next();
+ }
+ if(valueToAffect instanceof ValueSpecification) {
+ pin.setUpperValue((ValueSpecification)valueToAffect);
+ }
+ }
+ return pin;
+ }
+
+ /**
+ * Get the command to reset all pins of the action.
+ *
+ * @param action
+ * action to reinitialize pins (CallOperationAction or CallBehaviorAction)
+ * @return command
+ */
+ private CompoundCommand getResetPinsCmd(CallAction action) {
+ // Get the editing domain
+ TransactionalEditingDomain editingdomain = EditorUtils.getTransactionalEditingDomain();
+ CompoundCommand globalCmd = new CompoundCommand();
+
+ // remove argument pins
+ if(!action.getArguments().isEmpty()) {
+ Command cmd = RemoveCommand.create(editingdomain, action, UMLPackage.eINSTANCE.getInvocationAction_Argument(), action.getArguments());
+ globalCmd.append(cmd);
+ }
+ // remove result pins
+ if(!action.getResults().isEmpty()) {
+ Command cmd = RemoveCommand.create(editingdomain, action, UMLPackage.eINSTANCE.getCallAction_Result(), action.getResults());
+ globalCmd.append(cmd);
+ }
+ if(action instanceof CallOperationAction) {
+ // remove target pin
+ InputPin target = ((CallOperationAction)action).getTarget();
+ if(target != null) {
+ Command cmd = RemoveCommand.create(editingdomain, action, UMLPackage.eINSTANCE.getCallOperationAction_Target(), target);
+ globalCmd.append(cmd);
+ }
+ }
+
+ // recover parameters
+ List<Parameter> parameters = Collections.emptyList();
+ if(action instanceof CallOperationAction) {
+ Operation operation = ((CallOperationAction)action).getOperation();
+ if(operation != null) {
+ parameters = operation.getOwnedParameters();
+ }
+ }
+ if(action instanceof CallBehaviorAction) {
+ Behavior behavior = ((CallBehaviorAction)action).getBehavior();
+ if(behavior != null) {
+ parameters = behavior.getOwnedParameters();
+ }
+ }
+
+ // add pins corresponding to parameters
+ Map<Integer, Parameter> inParameters = new HashMap<Integer, Parameter>();
+ Map<Integer, Parameter> outParameters = new HashMap<Integer, Parameter>();
+ int inIndex = 0;
+ int outIndex = 0;
+ for(Parameter param : parameters) {
+ switch(param.getDirection()) {
+ case IN_LITERAL:
+ inParameters.put(inIndex, param);
+ inIndex++;
+ break;
+ case OUT_LITERAL:
+ case RETURN_LITERAL:
+ outParameters.put(outIndex, param);
+ outIndex++;
+ break;
+ case INOUT_LITERAL:
+ inParameters.put(inIndex, param);
+ inIndex++;
+ outParameters.put(outIndex, param);
+ outIndex++;
+ break;
+ }
+ }
+ if(!inParameters.isEmpty() || !outParameters.isEmpty()) {
+ Command cmd = getAddPinsCmd(action, inParameters, outParameters);
+ globalCmd.append(cmd);
+ }
+
+ if(action instanceof CallOperationAction) {
+ // add target pin
+ Operation operation = ((CallOperationAction)action).getOperation();
+ if(operation != null) {
+ InputPin targetPin = createTargetPin(operation);
+ Command cmd = SetCommand.create(editingdomain, action, UMLPackage.eINSTANCE.getCallOperationAction_Target(), targetPin);
+ globalCmd.append(cmd);
+ }
+ }
+
+ return globalCmd;
+ }
+
+ /**
+ * Get the command to update a pins list with given values
+ *
+ * @param pins
+ * the list of pins to update
+ * @param type
+ * the new type value
+ * @param ordered
+ * the new isOrdered value
+ * @param unique
+ * the new isUnique value
+ * @param lower
+ * the new lower value
+ * @param lowerValue
+ * the new lowerValue value
+ * @param upper
+ * the new upper value
+ * @param upperValue
+ * the new upperValue value
+ * @return the command to execute
+ */
+ private CompoundCommand getUpdatePinsCmd(List<Pin> pins, Type type, boolean ordered, boolean unique, int lower, ValueSpecification lowerValue, int upper, ValueSpecification upperValue) {
+ CompoundCommand globalCmd = new CompoundCommand();
+ if(pins == null) {
+ return globalCmd;
+ }
+ // Get the editing domain
+ TransactionalEditingDomain editingdomain = EditorUtils.getTransactionalEditingDomain();
+ for(Pin pin : pins) {
+ if(!EcoreUtil.equals(pin.getType(), type)) {
+ // add the command
+ Command cmd = SetCommand.create(editingdomain, pin, UMLPackage.eINSTANCE.getTypedElement_Type(), type);
+ globalCmd.append(cmd);
+ }
+ if(pin.isOrdered() != ordered) {
+ // add the command
+ Command cmd = SetCommand.create(editingdomain, pin, UMLPackage.eINSTANCE.getMultiplicityElement_IsOrdered(), ordered);
+ globalCmd.append(cmd);
+ }
+ if(pin.isUnique() != unique) {
+ // add the command
+ Command cmd = SetCommand.create(editingdomain, pin, UMLPackage.eINSTANCE.getMultiplicityElement_IsUnique(), unique);
+ globalCmd.append(cmd);
+ }
+ // UMLPackage.eINSTANCE.getMultiplicityElement_Lower() is derived from UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue()
+ if(!EcoreUtil.equals(pin.getLowerValue(), lowerValue)) {
+ Object affectedvalue = null;
+ // Execute a copy command then add the set command
+ if(lowerValue != null) {
+ Command copy = CopyCommand.create(editingdomain, Collections.singleton(lowerValue));
+ copy.execute();
+ Collection<?> result = copy.getResult();
+ if(!result.isEmpty()) {
+ affectedvalue = result.iterator().next();
+ }
+ }
+ Command cmd = SetCommand.create(editingdomain, pin, UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue(), affectedvalue);
+ globalCmd.append(cmd);
+ }
+ // UMLPackage.eINSTANCE.getMultiplicityElement_Upper() is derived from UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue()
+ if(!EcoreUtil.equals(pin.getUpperValue(), upperValue)) {
+ Object affectedvalue = null;
+ // Execute a copy command then add the set command
+ if(upperValue != null) {
+ Command copy = CopyCommand.create(editingdomain, Collections.singleton(upperValue));
+ copy.execute();
+ Collection<?> result = copy.getResult();
+ if(!result.isEmpty()) {
+ affectedvalue = result.iterator().next();
+ }
+ }
+ Command cmd = SetCommand.create(editingdomain, pin, UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue(), affectedvalue);
+ globalCmd.append(cmd);
+ }
+ }
+ return globalCmd;
+ }
+
+ /**
+ * Get the object invoked by the pin's parent action
+ *
+ * @return invoked operation, invoked behavior or null
+ */
+ static private NamedElement getInvokedObject(Pin pin) {
+ Element action = pin.getOwner();
+ if(action instanceof CallOperationAction) {
+ Operation operation = ((CallOperationAction)action).getOperation();
+ return operation;
+ } else if(action instanceof CallBehaviorAction) {
+ Behavior behavior = ((CallBehaviorAction)action).getBehavior();
+ return behavior;
+ }
+ return null;
+ }
+
+ /**
+ * Get all Pins associated to the parameter (provided no pin or parameter has been added without synchronization)
+ *
+ * @param parameter
+ * the parameter
+ * @return the list of associated pins
+ */
+ static private List<Pin> getPins(Parameter parameter) {
+ Element owner = parameter.getOwner();
+ List<CallAction> callingActions = getCallingActions(owner);
+ // initialize listOfPins
+ List<Pin> listOfPins = new LinkedList<Pin>();
+ // get index of pins
+ int inIndex = -1;
+ int outIndex = -1;
+ switch(parameter.getDirection()) {
+ case IN_LITERAL:
+ inIndex = getIndex(parameter, true);
+ break;
+ case OUT_LITERAL:
+ case RETURN_LITERAL:
+ outIndex = getIndex(parameter, false);
+ break;
+ case INOUT_LITERAL:
+ inIndex = getIndex(parameter, true);
+ outIndex = getIndex(parameter, false);
+ break;
+ }
+ if(owner instanceof Operation) {
+ // inspect each referencing action
+ for(CallAction action : callingActions) {
+ // owner is action's called Operation
+ switch(parameter.getDirection()) {
+ case IN_LITERAL:
+ Pin pin = ((CallOperationAction)action).getArguments().get(inIndex);
+ if(pin != null) {
+ listOfPins.add(pin);
+ }
+ break;
+ case OUT_LITERAL:
+ case RETURN_LITERAL:
+ pin = ((CallOperationAction)action).getResults().get(outIndex);
+ if(pin != null) {
+ listOfPins.add(pin);
+ }
+ break;
+ case INOUT_LITERAL:
+ pin = ((CallOperationAction)action).getArguments().get(inIndex);
+ if(pin != null) {
+ listOfPins.add(pin);
+ }
+ pin = ((CallOperationAction)action).getResults().get(outIndex);
+ if(pin != null) {
+ listOfPins.add(pin);
+ }
+ break;
+ }
+ }
+ return listOfPins;
+ } else if(owner instanceof Behavior) {
+ // inspect each referencing action
+ for(CallAction action : callingActions) {
+ // owner is action's called Behavior
+ switch(parameter.getDirection()) {
+ case IN_LITERAL:
+ Pin pin = ((CallBehaviorAction)action).getArguments().get(inIndex);
+ if(pin != null) {
+ listOfPins.add(pin);
+ }
+ break;
+ case OUT_LITERAL:
+ case RETURN_LITERAL:
+ pin = ((CallBehaviorAction)action).getResults().get(outIndex);
+ if(pin != null) {
+ listOfPins.add(pin);
+ }
+ break;
+ case INOUT_LITERAL:
+ pin = ((CallBehaviorAction)action).getArguments().get(inIndex);
+ if(pin != null) {
+ listOfPins.add(pin);
+ }
+ pin = ((CallBehaviorAction)action).getResults().get(outIndex);
+ if(pin != null) {
+ listOfPins.add(pin);
+ }
+ break;
+ }
+ }
+ return listOfPins;
+ }
+ return Collections.emptyList();
+ }
+
+ /**
+ * Get the index (considering Parameters in or out parameters only) at which the parameter appears in its container.
+ * For convenience with Pin mapping, in-out parameters counted are in both solution.
+ * Note that this count does not take in account the searched for parameter direction. This means that this method works even if the searched
+ * parameter has a different direction than the one specified in in (usefull when direction changes).
+ *
+ * @param parameter
+ * the searched parameter
+ * @param in
+ * if true, compute position in Parameters of direction in, if false, of direction out
+ * @return the position in which the parameter appears (0 based) or -1 if failed
+ */
+ static private int getIndex(Parameter parameter, boolean in) {
+ if(parameter == null) {
+ return -1;
+ }
+ Element owner = parameter.getOwner();
+ List<Parameter> parametersList = Collections.emptyList();
+ if(owner instanceof Operation) {
+ parametersList = ((Operation)owner).getOwnedParameters();
+ } else if(owner instanceof Behavior) {
+ parametersList = ((Behavior)owner).getOwnedParameters();
+ }
+ int index = 0;
+ for(Parameter param : parametersList) {
+ if(param.equals(parameter)) {
+ return index;
+ }
+ if(in && (ParameterDirectionKind.IN_LITERAL.equals(param.getDirection()) || ParameterDirectionKind.INOUT_LITERAL.equals(param.getDirection()))) {
+ index++;
+ } else if(!in && (ParameterDirectionKind.OUT_LITERAL.equals(param.getDirection()) || ParameterDirectionKind.RETURN_LITERAL.equals(param.getDirection()) || ParameterDirectionKind.INOUT_LITERAL.equals(param.getDirection()))) {
+ index++;
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Ask the user to validate all the implied modifications (parameters and all associated pins)
+ *
+ * @param listOfActions
+ * the list of impacted calling actions
+ * @return whether the user validates the modifications
+ */
+ protected boolean askForValidation(List<? extends NamedElement> listOfActions) {
+ return ConfirmPinAndParameterSyncDialog.openConfirmFromParameter(Display.getDefault().getActiveShell(), listOfActions, labelProvider);
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/locator/PinPositionLocator.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/locator/PinPositionLocator.java
new file mode 100644
index 00000000000..2d3ed92e835
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/locator/PinPositionLocator.java
@@ -0,0 +1,247 @@
+/*****************************************************************************
+ * 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.diagram.activity.locator;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.helper.ActivityFigureDrawer;
+import org.eclipse.papyrus.diagram.common.locator.AdvancedBorderItemLocator;
+
+/**
+ * This class is used to constrain the position of Pin
+ *
+ * TODO : The pin is not re-sizable
+ */
+public class PinPositionLocator extends AdvancedBorderItemLocator {
+
+ /** The offset to add to default position. (to avoid corner of rounded rectangles) */
+ private static final int EXTRA_BORDER_DEFAULT_OFFSET = 8;
+
+ /** Constructor **/
+ public PinPositionLocator(IFigure parentFigure) {
+ super(parentFigure);
+ }
+
+ /** Constructor **/
+ public PinPositionLocator(IFigure borderItem, IFigure parentFigure, Rectangle constraint) {
+ super(borderItem, parentFigure, constraint);
+ }
+
+ /** Constructor **/
+ public PinPositionLocator(IFigure parentFigure, int preferredSide) {
+ super(parentFigure, preferredSide);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Rectangle getValidLocation(Rectangle proposedLocation, IFigure borderItem) {
+ Rectangle realLocation = new Rectangle(proposedLocation);
+ realLocation.width = Math.max(realLocation.width, realLocation.height);
+ realLocation.height = realLocation.width;
+ int side = findClosestSideOfParent(proposedLocation, getParentBorder());
+ Point newTopLeft = locateOnBorder(realLocation.getTopLeft(), side, 0, borderItem);
+ realLocation.setLocation(newTopLeft);
+ return realLocation;
+ }
+
+ /**
+ * Re-arrange the location of the border item, and also the contained arrow.
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator#relocate(org.eclipse.draw2d.IFigure)
+ *
+ * @param borderItem
+ */
+ @Override
+ public void relocate(IFigure borderItem) {
+ // reset bounds of borderItem
+ Dimension size = getSize(borderItem);
+ Rectangle rectSuggested = getConstraint();
+ if(rectSuggested.getTopLeft().x == 0 && rectSuggested.getTopLeft().y == 0) {
+ rectSuggested.setLocation(getPreferredLocation(borderItem));
+ }
+ rectSuggested.setSize(size);
+ setConstraint(getValidLocation(rectSuggested, borderItem));
+ borderItem.setBounds(getConstraint().getCopy());
+ // ensure the side property is correctly set
+ setCurrentSideOfParent(findClosestSideOfParent(borderItem.getBounds(), getParentBorder()));
+ // refresh the arrow depending on the Pin type and the side on which it is located
+ for(Object subfigure : borderItem.getChildren()) {
+ if(subfigure instanceof IFigure) {
+ for(Object child : ((IFigure)subfigure).getChildren()) {
+ refreshPinDescriptorArrow(child, MapModeUtil.getMapMode(borderItem), size);
+ }
+ }
+ }
+ }
+
+ /**
+ * Refresh the arrow in case child is a Pin Descriptor
+ *
+ * @param child
+ * the Pin Descriptor (no effect otherwise)
+ * @param mapMode
+ * the IMapMode
+ * @param size
+ * the size of the border item
+ */
+ private void refreshPinDescriptorArrow(Object child, IMapMode mapMode, Dimension size) {
+ boolean arrowIn = false;
+ Polyline arrow = null;
+ if(child instanceof InputPinInOpaqueActEditPart.PinDescriptor) {
+ arrowIn = true;
+ arrow = ((InputPinInOpaqueActEditPart.PinDescriptor)child).getOptionalArrowFigure();
+ } else if(child instanceof InputPinInCallBeActEditPart.PinDescriptor) {
+ arrowIn = true;
+ arrow = ((InputPinInCallBeActEditPart.PinDescriptor)child).getOptionalArrowFigure();
+ } else if(child instanceof InputPinInCallOpActEditPart.PinDescriptor) {
+ arrowIn = true;
+ arrow = ((InputPinInCallOpActEditPart.PinDescriptor)child).getOptionalArrowFigure();
+ } else if(child instanceof InputPinInCallOpActAsTargetEditPart.PinDescriptor) {
+ arrowIn = true;
+ arrow = ((InputPinInCallOpActAsTargetEditPart.PinDescriptor)child).getOptionalArrowFigure();
+ } else if(child instanceof ActionInputPinInOpaqueActEditPart.PinDescriptor) {
+ arrowIn = true;
+ arrow = ((ActionInputPinInOpaqueActEditPart.PinDescriptor)child).getOptionalArrowFigure();
+ } else if(child instanceof ActionInputPinInCallBeActEditPart.PinDescriptor) {
+ arrowIn = true;
+ arrow = ((ActionInputPinInCallBeActEditPart.PinDescriptor)child).getOptionalArrowFigure();
+ } else if(child instanceof ActionInputPinInCallOpActEditPart.PinDescriptor) {
+ arrowIn = true;
+ arrow = ((ActionInputPinInCallOpActEditPart.PinDescriptor)child).getOptionalArrowFigure();
+ } else if(child instanceof ActionInputPinInCallOpActAsTargetEditPart.PinDescriptor) {
+ arrowIn = true;
+ arrow = ((ActionInputPinInCallOpActAsTargetEditPart.PinDescriptor)child).getOptionalArrowFigure();
+ } else if(child instanceof ValuePinInOpaqueActEditPart.PinDescriptor) {
+ arrowIn = true;
+ arrow = ((ValuePinInOpaqueActEditPart.PinDescriptor)child).getOptionalArrowFigure();
+ } else if(child instanceof ValuePinInCallBeActEditPart.PinDescriptor) {
+ arrowIn = true;
+ arrow = ((ValuePinInCallBeActEditPart.PinDescriptor)child).getOptionalArrowFigure();
+ } else if(child instanceof ValuePinInCallOpActEditPart.PinDescriptor) {
+ arrowIn = true;
+ arrow = ((ValuePinInCallOpActEditPart.PinDescriptor)child).getOptionalArrowFigure();
+ } else if(child instanceof ValuePinInCallOpActAsTargetEditPart.PinDescriptor) {
+ arrowIn = true;
+ arrow = ((ValuePinInCallOpActAsTargetEditPart.PinDescriptor)child).getOptionalArrowFigure();
+ } else if(child instanceof OutputPinInOpaqueActEditPart.PinDescriptor) {
+ arrowIn = false;
+ arrow = ((OutputPinInOpaqueActEditPart.PinDescriptor)child).getOptionalArrowFigure();
+ } else if(child instanceof OutputPinInCallBeActEditPart.PinDescriptor) {
+ arrowIn = false;
+ arrow = ((OutputPinInCallBeActEditPart.PinDescriptor)child).getOptionalArrowFigure();
+ } else if(child instanceof OutputPinInCallOpActEditPart.PinDescriptor) {
+ arrowIn = false;
+ arrow = ((OutputPinInCallOpActEditPart.PinDescriptor)child).getOptionalArrowFigure();
+ }
+ if(arrow != null) {
+ int arrowDirection;
+ int side = getCurrentSideOfParent();
+ switch(side) {
+ case PositionConstants.NORTH:
+ if(arrowIn) {
+ arrowDirection = PositionConstants.SOUTH;
+ } else {
+ arrowDirection = PositionConstants.NORTH;
+ }
+ break;
+ case PositionConstants.EAST:
+ if(arrowIn) {
+ arrowDirection = PositionConstants.WEST;
+ } else {
+ arrowDirection = PositionConstants.EAST;
+ }
+ break;
+ case PositionConstants.SOUTH:
+ if(arrowIn) {
+ arrowDirection = PositionConstants.NORTH;
+ } else {
+ arrowDirection = PositionConstants.SOUTH;
+ }
+ break;
+ case PositionConstants.WEST:
+ default:
+ if(arrowIn) {
+ arrowDirection = PositionConstants.EAST;
+ } else {
+ arrowDirection = PositionConstants.WEST;
+ }
+ }
+ ActivityFigureDrawer.redrawPinArrow(arrow, mapMode, size, arrowDirection);
+ }
+ }
+
+ /**
+ * Get an initial location based on the side. ( appropriate extremity of the side )
+ *
+ * @param side
+ * the preferred side of the parent figure on which to place this
+ * border item as defined in {@link PositionConstants}
+ * @return point
+ */
+ protected Point getPreferredLocation(int side, IFigure borderItem) {
+ Rectangle bounds = getParentBorder();
+ int parentFigureWidth = bounds.width;
+ int parentFigureHeight = bounds.height;
+ int parentFigureX = bounds.x;
+ int parentFigureY = bounds.y;
+ int x = parentFigureX;
+ int y = parentFigureY;
+
+ Dimension borderItemSize = getSize(borderItem);
+ switch(side) {
+ case PositionConstants.NORTH:
+ x += EXTRA_BORDER_DEFAULT_OFFSET + getBorderItemOffset().width;
+ y += -borderItemSize.height + getBorderItemOffset().height;
+ break;
+ case PositionConstants.EAST:
+ // take south east extremity to allow following pins placing above
+ x += parentFigureWidth - getBorderItemOffset().width;
+ y += parentFigureHeight - borderItemSize.height - EXTRA_BORDER_DEFAULT_OFFSET - getBorderItemOffset().height;
+ break;
+ case PositionConstants.SOUTH:
+ x += EXTRA_BORDER_DEFAULT_OFFSET + getBorderItemOffset().width;
+ y += parentFigureHeight - getBorderItemOffset().height;
+ break;
+ case PositionConstants.WEST:
+ default:
+ x += -borderItemSize.width + getBorderItemOffset().width;
+ y += EXTRA_BORDER_DEFAULT_OFFSET + getBorderItemOffset().height;
+ }
+ return new Point(x, y);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/ActivityEdgeWeightParser.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/ActivityEdgeWeightParser.java
new file mode 100644
index 00000000000..e87680dadea
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/ActivityEdgeWeightParser.java
@@ -0,0 +1,188 @@
+/*****************************************************************************
+ * 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.diagram.activity.parser.custom;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.papyrus.diagram.activity.commands.SetValueSpecificationValueCommand;
+import org.eclipse.papyrus.diagram.activity.parsers.MessageFormatParser;
+import org.eclipse.papyrus.umlutils.ValueSpecificationUtil;
+import org.eclipse.uml2.uml.ActivityEdge;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+/**
+ * A specific parser for displaying the weight of an Activity Edge. This parser refreshes the text
+ * displayed for the weight.
+ */
+public class ActivityEdgeWeightParser extends MessageFormatParser implements ISemanticParser {
+
+ /** The format string for displaying the weight */
+ private static final String WEIGHT_FORMAT = "{weight=%s}";
+
+ public ActivityEdgeWeightParser(EAttribute[] features, EAttribute[] editableFeatures) {
+ super(features, editableFeatures);
+ }
+
+ public ActivityEdgeWeightParser(EAttribute[] features) {
+ super(features);
+ }
+
+ public ActivityEdgeWeightParser() {
+ super(new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() });
+ }
+
+ protected EStructuralFeature getEStructuralFeature(Object notification) {
+ EStructuralFeature featureImpl = null;
+ if(notification instanceof Notification) {
+ Object feature = ((Notification)notification).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature)feature;
+ }
+ }
+ return featureImpl;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.diagram.sequence.parsers.AbstractParser#isAffectingEvent(java.lang.Object
+ * , int)
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+ EStructuralFeature feature = getEStructuralFeature(event);
+ return isValidFeature(feature);
+
+ }
+
+ @Override
+ public String getEditString(IAdaptable adapter, int flags) {
+ String value = getValueString(adapter, flags);
+ if(value != null) {
+ return value;
+ }
+ return "";
+ }
+
+ @Override
+ public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) {
+ Object obj = adapter.getAdapter(EObject.class);
+ TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(obj);
+ if(editingDomain == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ if(obj instanceof ActivityEdge) {
+ ActivityEdge edge = (ActivityEdge)obj;
+ ValueSpecification valueSpec = edge.getWeight();
+ if(valueSpec != null) {
+ CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values"); //$NON-NLS-1$
+ command.compose(new CommandProxy(new SetValueSpecificationValueCommand(valueSpec, newString)));
+ return command;
+ }
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.diagram.sequence.parsers.MessageFormatParser#getPrintString(org.eclipse
+ * .core.runtime.IAdaptable, int)
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+ String label = getValueString(element, flags);
+ if(label == null || label.length() == 0) {
+ label = " ";
+ } else {
+ label = String.format(WEIGHT_FORMAT, label);
+ }
+ return label;
+ }
+
+ /**
+ * Get the unformatted registered string value which shall be displayed
+ */
+ private String getValueString(IAdaptable element, int flags) {
+ Object obj = element.getAdapter(EObject.class);
+ if(obj instanceof ActivityEdge) {
+ ActivityEdge edge = (ActivityEdge)obj;
+ ValueSpecification valueSpec = edge.getWeight();
+ if(valueSpec != null) {
+ String value = ValueSpecificationUtil.getSpecificationValue(valueSpec);
+ if(value != null) {
+ return value;
+ }
+ }
+ }
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#areSemanticElementsAffected
+ * (org.eclipse.emf.ecore.EObject, java.lang.Object)
+ */
+ public boolean areSemanticElementsAffected(EObject listener, Object notification) {
+ EStructuralFeature feature = getEStructuralFeature(notification);
+ return isValidFeature(feature);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#getSemanticElementsBeingParsed
+ * (org.eclipse.emf.ecore.EObject)
+ */
+ public List<?> getSemanticElementsBeingParsed(EObject element) {
+ List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
+ if(element instanceof ActivityEdge) {
+ ActivityEdge edge = (ActivityEdge)element;
+ semanticElementsBeingParsed.add(edge);
+ if(edge.getWeight() != null) {
+ semanticElementsBeingParsed.add(edge.getWeight());
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ /**
+ * Determines if the given feature has to be taken into account in this parser
+ *
+ * @param feature
+ * the feature to test
+ * @return true if is valid, false otherwise
+ */
+ private boolean isValidFeature(EStructuralFeature feature) {
+ return UMLPackage.eINSTANCE.getActivityEdge_Weight().equals(feature) || ValueSpecification.class.isAssignableFrom(feature.getContainerClass());
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/CallBehaviorActionParser.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/CallBehaviorActionParser.java
new file mode 100644
index 00000000000..482be10395c
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/CallBehaviorActionParser.java
@@ -0,0 +1,144 @@
+/*****************************************************************************
+ * 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.diagram.activity.parser.custom;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.papyrus.diagram.activity.parsers.MessageFormatParser;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.CallBehaviorAction;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * A specific parser for displaying the label of a CallBehaviorAction. This parser refreshes the text
+ * displayed for the CallBehaviorAction.
+ */
+public class CallBehaviorActionParser extends MessageFormatParser implements ISemanticParser {
+
+ public CallBehaviorActionParser(EAttribute[] features, EAttribute[] editableFeatures) {
+ super(features, editableFeatures);
+ }
+
+ public CallBehaviorActionParser(EAttribute[] features) {
+ super(features);
+ }
+
+ public CallBehaviorActionParser() {
+ super(new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() });
+ }
+
+ protected EStructuralFeature getEStructuralFeature(Object notification) {
+ EStructuralFeature featureImpl = null;
+ if(notification instanceof Notification) {
+ Object feature = ((Notification)notification).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature)feature;
+ }
+ }
+ return featureImpl;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.diagram.sequence.parsers.AbstractParser#isAffectingEvent(java.lang.Object
+ * , int)
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+ EStructuralFeature feature = getEStructuralFeature(event);
+ return isValidFeature(feature);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.diagram.sequence.parsers.MessageFormatParser#getPrintString(org.eclipse
+ * .core.runtime.IAdaptable, int)
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+ Object obj = element.getAdapter(EObject.class);
+
+ if(obj instanceof CallBehaviorAction) {
+ CallBehaviorAction action = (CallBehaviorAction)obj;
+ String name = action.getName();
+ if(name == null) {
+ name = "";
+ }
+ if("".equals(name) && action.getBehavior() != null && action.getBehavior().getName() != null) {
+ // display behavior name if name is not available
+ name = action.getBehavior().getName();
+ }
+ if("".equals(name)) {
+ return " ";
+ } else {
+ return name;
+ }
+ }
+ return " ";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#areSemanticElementsAffected
+ * (org.eclipse.emf.ecore.EObject, java.lang.Object)
+ */
+ public boolean areSemanticElementsAffected(EObject listener, Object notification) {
+ EStructuralFeature feature = getEStructuralFeature(notification);
+ return isValidFeature(feature);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#getSemanticElementsBeingParsed
+ * (org.eclipse.emf.ecore.EObject)
+ */
+ public List<?> getSemanticElementsBeingParsed(EObject element) {
+ List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
+ if(element instanceof CallBehaviorAction) {
+ CallBehaviorAction action = (CallBehaviorAction)element;
+ semanticElementsBeingParsed.add(action);
+ Behavior behavior = action.getBehavior();
+ if(behavior != null) {
+ semanticElementsBeingParsed.add(behavior);
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ /**
+ * Determines if the given feature has to be taken into account in this parser
+ *
+ * @param feature
+ * the feature to test
+ * @return true if is valid, false otherwise
+ */
+ private boolean isValidFeature(EStructuralFeature feature) {
+ return UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) || UMLPackage.eINSTANCE.getCallBehaviorAction_Behavior().equals(feature);
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/CallOperationActionParser.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/CallOperationActionParser.java
new file mode 100644
index 00000000000..57b5fe90073
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/CallOperationActionParser.java
@@ -0,0 +1,194 @@
+/*****************************************************************************
+ * 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.diagram.activity.parser.custom;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.papyrus.diagram.activity.parsers.MessageFormatParser;
+import org.eclipse.uml2.uml.CallOperationAction;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * A specific parser for displaying the label of a CallOperationAction. This parser refreshes the text
+ * displayed for the CallOperationAction.
+ */
+public class CallOperationActionParser extends MessageFormatParser implements ISemanticParser {
+
+ /** The String format for displaying an action with its name, class name and operation name */
+ private static final String NAME_CLASS_OPERATION_FORMAT = "%s\n(%s::%s)";
+
+ /** The String format for displaying an action with its name (same as operation name) and class name */
+ private static final String NAME_CLASS_FORMAT = "%s\n(%s::)";
+
+ /** The String format for displaying an action name alone */
+ private static final String NAME_FORMAT = "%s";
+
+ public CallOperationActionParser(EAttribute[] features, EAttribute[] editableFeatures) {
+ super(features, editableFeatures);
+ }
+
+ public CallOperationActionParser(EAttribute[] features) {
+ super(features);
+ }
+
+ public CallOperationActionParser() {
+ super(new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() });
+ }
+
+ protected EStructuralFeature getEStructuralFeature(Object notification) {
+ EStructuralFeature featureImpl = null;
+ if(notification instanceof Notification) {
+ Object feature = ((Notification)notification).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature)feature;
+ }
+ }
+ return featureImpl;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.diagram.sequence.parsers.AbstractParser#isAffectingEvent(java.lang.Object
+ * , int)
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+ EStructuralFeature feature = getEStructuralFeature(event);
+ return isValidFeature(feature);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.diagram.sequence.parsers.MessageFormatParser#getPrintString(org.eclipse
+ * .core.runtime.IAdaptable, int)
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+ Object obj = element.getAdapter(EObject.class);
+
+ if(obj instanceof CallOperationAction) {
+ CallOperationAction action = (CallOperationAction)obj;
+ String name = action.getName();
+ String operation = "";
+ String className = "";
+ if(name == null) {
+ name = "";
+ }
+ if(action.getOperation() != null) {
+ operation = action.getOperation().getName();
+ if(operation == null) {
+ operation = "";
+ }
+ if(action.getOperation().getClass_() != null) {
+ className = action.getOperation().getClass_().getName();
+ if(className == null) {
+ className = "";
+ }
+ }
+ }
+ // name, operation and className are initialized with non null values
+ return getPrintString(name, operation, className);
+ }
+ return " ";
+ }
+
+ /**
+ * Get the string to print with the given elements
+ *
+ * @param name
+ * the name of the node or ""
+ * @param operation
+ * the name of the operation or ""
+ * @param className
+ * the name of the operation class or ""
+ * @return the string to print
+ */
+ private String getPrintString(String name, String operation, String className) {
+ if("".equals(name) || operation.equals(name)) {
+ // operation is displayed instead of node name
+ if("".equals(className)) {
+ return String.format(NAME_FORMAT, operation);
+ } else {
+ return String.format(NAME_CLASS_FORMAT, operation, className);
+ }
+ } else if("".equals(operation) && "".equals(className)) {
+ // name only is displayed
+ return String.format(NAME_FORMAT, name);
+ } else {
+ // all information is displayed (even case when operation or class name is "")
+ return String.format(NAME_CLASS_OPERATION_FORMAT, name, className, operation);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#areSemanticElementsAffected
+ * (org.eclipse.emf.ecore.EObject, java.lang.Object)
+ */
+ public boolean areSemanticElementsAffected(EObject listener, Object notification) {
+ EStructuralFeature feature = getEStructuralFeature(notification);
+ return isValidFeature(feature);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#getSemanticElementsBeingParsed
+ * (org.eclipse.emf.ecore.EObject)
+ */
+ public List<?> getSemanticElementsBeingParsed(EObject element) {
+ List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
+ if(element instanceof CallOperationAction) {
+ CallOperationAction action = (CallOperationAction)element;
+ semanticElementsBeingParsed.add(action);
+ Operation operation = action.getOperation();
+ if(operation != null) {
+ semanticElementsBeingParsed.add(operation);
+ if(operation.getClass_() != null) {
+ semanticElementsBeingParsed.add(operation.getClass_());
+ }
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ /**
+ * Determines if the given feature has to be taken into account in this parser
+ *
+ * @param feature
+ * the feature to test
+ * @return true if is valid, false otherwise
+ */
+ private boolean isValidFeature(EStructuralFeature feature) {
+ boolean isName = UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature);
+ boolean isPrintedElement = UMLPackage.eINSTANCE.getCallOperationAction_Operation().equals(feature) || UMLPackage.eINSTANCE.getOperation_Class().equals(feature);
+ return isName || isPrintedElement;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/ExceptionPinTriangleParser.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/ExceptionPinTriangleParser.java
new file mode 100644
index 00000000000..ee7bb79f54e
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/ExceptionPinTriangleParser.java
@@ -0,0 +1,157 @@
+/*****************************************************************************
+ * 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.diagram.activity.parser.custom;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.papyrus.diagram.activity.parsers.MessageFormatParser;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Pin;
+import org.eclipse.uml2.uml.State;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * A specific parser for displaying the label of a Pin. This parser refreshes the text
+ * displayed for the Pin.
+ */
+public class ExceptionPinTriangleParser extends MessageFormatParser implements ISemanticParser {
+
+ private static final String STATE_DISPLAY = "\n[%s]";
+
+ public ExceptionPinTriangleParser(EAttribute[] features, EAttribute[] editableFeatures) {
+ super(features, editableFeatures);
+ }
+
+ public ExceptionPinTriangleParser(EAttribute[] features) {
+ super(features);
+ }
+
+ public ExceptionPinTriangleParser() {
+ super(new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() });
+ }
+
+ protected EStructuralFeature getEStructuralFeature(Object notification) {
+ EStructuralFeature featureImpl = null;
+ if(notification instanceof Notification) {
+ Object feature = ((Notification)notification).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature)feature;
+ }
+ }
+ return featureImpl;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.diagram.sequence.parsers.AbstractParser#isAffectingEvent(java.lang.Object
+ * , int)
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+ EStructuralFeature feature = getEStructuralFeature(event);
+ return isValidFeature(feature);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.diagram.sequence.parsers.MessageFormatParser#getPrintString(org.eclipse
+ * .core.runtime.IAdaptable, int)
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+ StringBuffer label = new StringBuffer();
+ Object obj = element.getAdapter(EObject.class);
+ if(obj instanceof Pin) {
+ Pin pin = (Pin)obj;
+ String name = pin.getName();
+ if(name == null) {
+ name = "";
+ }
+ label.append(name);
+ if(pin.getInStates() != null) {
+ for(State state : pin.getInStates()) {
+ if(state != null) {
+ String stateName = state.getName();
+ if(stateName == null) {
+ stateName = "";
+ }
+ if(!"".equals(stateName)) {
+ label.append(String.format(STATE_DISPLAY, stateName));
+ }
+ }
+ }
+ }
+ }
+ if(label.length() == 0) {
+ label.append(" ");
+ }
+ return label.toString();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#areSemanticElementsAffected
+ * (org.eclipse.emf.ecore.EObject, java.lang.Object)
+ */
+ public boolean areSemanticElementsAffected(EObject listener, Object notification) {
+ EStructuralFeature feature = getEStructuralFeature(notification);
+ return isValidFeature(feature);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#getSemanticElementsBeingParsed
+ * (org.eclipse.emf.ecore.EObject)
+ */
+ public List<?> getSemanticElementsBeingParsed(EObject element) {
+ List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
+ if(element instanceof Pin) {
+ Pin pin = (Pin)element;
+ semanticElementsBeingParsed.add(pin);
+ if(pin.getInStates() != null) {
+ for(State state : pin.getInStates()) {
+ if(state != null) {
+ semanticElementsBeingParsed.add(state);
+ }
+ }
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ /**
+ * Determines if the given feature has to be taken into account in this parser
+ *
+ * @param feature
+ * the feature to test
+ * @return true if is valid, false otherwise
+ */
+ private boolean isValidFeature(EStructuralFeature feature) {
+ return UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) || UMLPackage.eINSTANCE.getObjectNode_InState().equals(feature);
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/PinParser.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/PinParser.java
new file mode 100644
index 00000000000..662a6742062
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/PinParser.java
@@ -0,0 +1,157 @@
+/*****************************************************************************
+ * 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.diagram.activity.parser.custom;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.papyrus.diagram.activity.parsers.MessageFormatParser;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Pin;
+import org.eclipse.uml2.uml.State;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * A specific parser for displaying the label of a Pin. This parser refreshes the text
+ * displayed for the Pin.
+ */
+public class PinParser extends MessageFormatParser implements ISemanticParser {
+
+ private static final String STATE_DISPLAY = "\n[%s]";
+
+ public PinParser(EAttribute[] features, EAttribute[] editableFeatures) {
+ super(features, editableFeatures);
+ }
+
+ public PinParser(EAttribute[] features) {
+ super(features);
+ }
+
+ public PinParser() {
+ super(new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() });
+ }
+
+ protected EStructuralFeature getEStructuralFeature(Object notification) {
+ EStructuralFeature featureImpl = null;
+ if(notification instanceof Notification) {
+ Object feature = ((Notification)notification).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature)feature;
+ }
+ }
+ return featureImpl;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.diagram.sequence.parsers.AbstractParser#isAffectingEvent(java.lang.Object
+ * , int)
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+ EStructuralFeature feature = getEStructuralFeature(event);
+ return isValidFeature(feature);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.diagram.sequence.parsers.MessageFormatParser#getPrintString(org.eclipse
+ * .core.runtime.IAdaptable, int)
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+ StringBuffer label = new StringBuffer();
+ Object obj = element.getAdapter(EObject.class);
+ if(obj instanceof Pin) {
+ Pin pin = (Pin)obj;
+ String name = pin.getName();
+ if(name == null) {
+ name = "";
+ }
+ label.append(name);
+ if(pin.getInStates() != null) {
+ for(State state : pin.getInStates()) {
+ if(state != null) {
+ String stateName = state.getName();
+ if(stateName == null) {
+ stateName = "";
+ }
+ if(!"".equals(stateName)) {
+ label.append(String.format(STATE_DISPLAY, stateName));
+ }
+ }
+ }
+ }
+ }
+ if(label.length() == 0) {
+ label.append(" ");
+ }
+ return label.toString();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#areSemanticElementsAffected
+ * (org.eclipse.emf.ecore.EObject, java.lang.Object)
+ */
+ public boolean areSemanticElementsAffected(EObject listener, Object notification) {
+ EStructuralFeature feature = getEStructuralFeature(notification);
+ return isValidFeature(feature);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#getSemanticElementsBeingParsed
+ * (org.eclipse.emf.ecore.EObject)
+ */
+ public List<?> getSemanticElementsBeingParsed(EObject element) {
+ List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
+ if(element instanceof Pin) {
+ Pin pin = (Pin)element;
+ semanticElementsBeingParsed.add(pin);
+ if(pin.getInStates() != null) {
+ for(State state : pin.getInStates()) {
+ if(state != null) {
+ semanticElementsBeingParsed.add(state);
+ }
+ }
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ /**
+ * Determines if the given feature has to be taken into account in this parser
+ *
+ * @param feature
+ * the feature to test
+ * @return true if is valid, false otherwise
+ */
+ private boolean isValidFeature(EStructuralFeature feature) {
+ return UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) || UMLPackage.eINSTANCE.getObjectNode_InState().equals(feature);
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/PinValueParser.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/PinValueParser.java
new file mode 100644
index 00000000000..e4abcfb90ec
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/parser/custom/PinValueParser.java
@@ -0,0 +1,244 @@
+/*****************************************************************************
+ * 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.diagram.activity.parser.custom;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.papyrus.diagram.activity.commands.SetValueSpecificationValueCommand;
+import org.eclipse.papyrus.diagram.activity.parsers.MessageFormatParser;
+import org.eclipse.papyrus.umlutils.ValueSpecificationUtil;
+import org.eclipse.uml2.uml.Action;
+import org.eclipse.uml2.uml.ActionInputPin;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Pin;
+import org.eclipse.uml2.uml.ReadSelfAction;
+import org.eclipse.uml2.uml.ReadVariableAction;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.ValuePin;
+import org.eclipse.uml2.uml.ValueSpecification;
+import org.eclipse.uml2.uml.ValueSpecificationAction;
+import org.eclipse.uml2.uml.Variable;
+
+/**
+ * A specific parser for displaying the label of a Pin. This parser refreshes the text
+ * displayed for the Pin.
+ */
+public class PinValueParser extends MessageFormatParser implements ISemanticParser {
+
+ /** The keyword for indication a ReadSelfAction input pin */
+ private static final String SELF_KEYWORD = "self";
+
+ public PinValueParser(EAttribute[] features, EAttribute[] editableFeatures) {
+ super(features, editableFeatures);
+ }
+
+ public PinValueParser(EAttribute[] features) {
+ super(features);
+ }
+
+ public PinValueParser() {
+ super(new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() });
+ }
+
+ protected EStructuralFeature getEStructuralFeature(Object notification) {
+ EStructuralFeature featureImpl = null;
+ if(notification instanceof Notification) {
+ Object feature = ((Notification)notification).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature)feature;
+ }
+ }
+ return featureImpl;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.diagram.sequence.parsers.AbstractParser#isAffectingEvent(java.lang.Object
+ * , int)
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+ EStructuralFeature feature = getEStructuralFeature(event);
+ return isValidFeature(feature);
+
+ }
+
+ @Override
+ public String getEditString(IAdaptable adapter, int flags) {
+ return getPrintString(adapter, flags);
+ }
+
+ @Override
+ public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) {
+ Object obj = adapter.getAdapter(EObject.class);
+ TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(obj);
+ if(editingDomain == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ if(obj instanceof ValuePin) {
+ ValuePin pin = (ValuePin)obj;
+ ValueSpecification valueSpec = pin.getValue();
+ if(valueSpec != null) {
+ CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values"); //$NON-NLS-1$
+ command.compose(new CommandProxy(new SetValueSpecificationValueCommand(valueSpec, newString)));
+ return command;
+ }
+ } else if(obj instanceof ActionInputPin) {
+ ActionInputPin pin = (ActionInputPin)obj;
+ Action action = pin.getFromAction();
+ if(action instanceof ReadVariableAction) {
+ Variable variable = ((ReadVariableAction)action).getVariable();
+ if(variable != null) {
+ CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values"); //$NON-NLS-1$
+ command.compose(getModificationCommand(variable, UMLPackage.eINSTANCE.getNamedElement_Name(), newString));
+ return command;
+ }
+ } else if(action instanceof ReadSelfAction) {
+ return UnexecutableCommand.INSTANCE;
+ } else if(action instanceof ValueSpecificationAction) {
+ ValueSpecification valueSpec = ((ValueSpecificationAction)action).getValue();
+ if(valueSpec != null) {
+ CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values"); //$NON-NLS-1$
+ command.compose(new CommandProxy(new SetValueSpecificationValueCommand(valueSpec, newString)));
+ return command;
+ }
+ }
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.diagram.sequence.parsers.MessageFormatParser#getPrintString(org.eclipse
+ * .core.runtime.IAdaptable, int)
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+ // ensure valueLabel is never null
+ String valueLabel = " ";
+ Object obj = element.getAdapter(EObject.class);
+ if(obj instanceof ValuePin) {
+ ValuePin pin = (ValuePin)obj;
+ ValueSpecification valueSpec = pin.getValue();
+ if(valueSpec != null) {
+ String value = ValueSpecificationUtil.getSpecificationValue(valueSpec);
+ if(value != null) {
+ valueLabel = value;
+ }
+ }
+ } else if(obj instanceof ActionInputPin) {
+ ActionInputPin pin = (ActionInputPin)obj;
+ Action action = pin.getFromAction();
+ if(action instanceof ReadVariableAction) {
+ Variable variable = ((ReadVariableAction)action).getVariable();
+ if(variable != null) {
+ String value = variable.getName();
+ if(value != null) {
+ valueLabel = value;
+ }
+ }
+ } else if(action instanceof ReadSelfAction) {
+ valueLabel = SELF_KEYWORD;
+ } else if(action instanceof ValueSpecificationAction) {
+ ValueSpecification valueSpec = ((ValueSpecificationAction)action).getValue();
+ if(valueSpec != null) {
+ String value = ValueSpecificationUtil.getSpecificationValue(valueSpec);
+ if(value != null) {
+ valueLabel = value;
+ }
+ }
+ }
+ }
+ if(valueLabel.length() == 0) {
+ valueLabel = " ";
+ }
+ return valueLabel;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#areSemanticElementsAffected
+ * (org.eclipse.emf.ecore.EObject, java.lang.Object)
+ */
+ public boolean areSemanticElementsAffected(EObject listener, Object notification) {
+ EStructuralFeature feature = getEStructuralFeature(notification);
+ return isValidFeature(feature);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#getSemanticElementsBeingParsed
+ * (org.eclipse.emf.ecore.EObject)
+ */
+ public List<?> getSemanticElementsBeingParsed(EObject element) {
+ List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
+ if(element instanceof Pin) {
+ Pin pin = (Pin)element;
+ semanticElementsBeingParsed.add(pin);
+ if(pin instanceof ValuePin) {
+ ValueSpecification valueSpec = ((ValuePin)pin).getValue();
+ if(valueSpec != null) {
+ semanticElementsBeingParsed.add(valueSpec);
+ }
+ } else if(pin instanceof ActionInputPin) {
+ Action action = ((ActionInputPin)pin).getFromAction();
+ if(action != null) {
+ semanticElementsBeingParsed.add(action);
+ }
+ if(action instanceof ReadVariableAction) {
+ Variable variable = ((ReadVariableAction)action).getVariable();
+ if(variable != null) {
+ semanticElementsBeingParsed.add(variable);
+ }
+ } else if(action instanceof ValueSpecificationAction) {
+ ValueSpecification valueSpec = ((ValueSpecificationAction)action).getValue();
+ if(valueSpec != null) {
+ semanticElementsBeingParsed.add(valueSpec);
+ }
+ }
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ /**
+ * Determines if the given feature has to be taken into account in this parser
+ *
+ * @param feature
+ * the feature to test
+ * @return true if is valid, false otherwise
+ */
+ private boolean isValidFeature(EStructuralFeature feature) {
+ return UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) || UMLPackage.eINSTANCE.getValuePin_Value().equals(feature) || UMLPackage.eINSTANCE.getActionInputPin_FromAction().equals(feature) || UMLPackage.eINSTANCE.getVariableAction_Variable().equals(feature) || UMLPackage.eINSTANCE.getValueSpecificationAction_Value().equals(feature) || ValueSpecification.class.isAssignableFrom(feature.getContainerClass());
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/providers/ActivityDiagramContributionItemProvider.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/providers/ActivityDiagramContributionItemProvider.java
new file mode 100644
index 00000000000..5d3cb85460c
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/custom-src/org/eclipse/papyrus/diagram/activity/providers/ActivityDiagramContributionItemProvider.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.diagram.activity.providers;
+
+import org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider;
+import org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.papyrus.diagram.activity.edit.actions.RestoreRelatedLinksAction;
+
+/**
+ * This class used to contrib item for specific actions.
+ *
+ * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a>
+ */
+public class ActivityDiagramContributionItemProvider extends AbstractContributionItemProvider {
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider#createAction(java.lang.String,
+ * org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor)
+ */
+ @Override
+ protected IAction createAction(String actionId, IWorkbenchPartDescriptor partDescriptor) {
+ if(actionId.equals(RestoreRelatedLinksAction.ID)) {
+ return new RestoreRelatedLinksAction();
+ }
+ return super.createAction(actionId, partDescriptor);
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/messages.properties b/plugins/uml/org.eclipse.papyrus.diagram.activity/messages.properties
index 046d5b4cd2d..7cb94afeb1f 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/messages.properties
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/messages.properties
@@ -1,5 +1,5 @@
####################################################################################
-# Copyright (c) 2008 Atos Origin.
+# Copyright (c) 2009 Atos Origin.
#
#
# All rights reserved. This program and the accompanying materials
@@ -8,11 +8,30 @@
# http://www.eclipse.org/legal/epl-v10.html
#
####################################################################################
+# Non generated values :
+PinAndParameterSynchronizer_UnauthorizedModificationTitle=Unauthorized modification : invoked element is impacted
+PinAndParameterSynchronizer_UnauthorizedModificationRedirection=You can not modify this element directly. Instead, you should modify {0}, which is called by the action. You may access it by the following link.
+ConfirmPinAndParameterSync_Title=Please confirm modifications
+ConfirmPinAndParameterSync_FromParameterMsg=The modification of this parameter will also update all corresponding Pins in calling actions:\n{0}Do you still want to perform this action?
+CreateCallActionDialog_OperationTitle=Create a new Call Operation Action
+CreateCallActionDialog_SelectOperation=Choose to select an existing Operation
+CreateCallActionDialog_CreateOperation=Choose to create a new Operation
+CreateCallActionDialog_BehaviorTitle=Create a new Call Behavior Action
+CreateCallActionDialog_SelectBehavior=Choose to select an existing Behavior
+CreateCallActionDialog_CreateBehavior=Choose to create a new Behavior
+CreateCallActionDialog_ParentLabel=Owner of the created element:
+CreateCallActionDialog_NameLabel=Name:
+CreateCallActionDialog_TypeLabel=Type:
+CreateCallActionDialog_IsSynchronousTitle=Choose whether the call is synchronous (only if no result is expected)
+CreateCallActionDialog_IsSynchronous=Is synchronous
+CreateCallActionDialog_OperationInvocationTitle=Assign an existing Operation or create a new one
+CreateCallActionDialog_BehaviorInvocationTitle=Assign an existing Behavior or create a new one
+# End of non generated values
# TODO: manually put keys and values
-UMLCreationWizardTitle=New UML Diagram
-UMLCreationWizard_DiagramModelFilePageTitle=Create UML Diagram
+UMLCreationWizardTitle=New PapyrusUMLActivityDiagram Diagram
+UMLCreationWizard_DiagramModelFilePageTitle=Create PapyrusUMLActivityDiagram Diagram
UMLCreationWizard_DiagramModelFilePageDescription=Select file that will contain diagram model.
-UMLCreationWizard_DomainModelFilePageTitle=Create UML Domain Model
+UMLCreationWizard_DomainModelFilePageTitle=Create PapyrusUMLActivityDiagram Domain Model
UMLCreationWizard_DomainModelFilePageDescription=Select file that will contain domain model.
UMLCreationWizardOpenEditorError=Error opening diagram editor
UMLCreationWizardCreationError=Creation Problems
@@ -53,46 +72,113 @@ UMLDiagramEditor_SaveErrorMessage=Could not save file.
UMLElementChooserDialog_SelectModelElementTitle=Select model element
ModelElementSelectionPageMessage=Select model element:
ValidateActionMessage=Validate
-Uml1Group_title=uml
-ControlFlow1CreationTool_title=ControlFlow
-ControlFlow1CreationTool_desc=Create new ControlFlow
-InitialNode2CreationTool_title=InitialNode
-InitialNode2CreationTool_desc=Create new InitialNode
-FlowFinalNode3CreationTool_title=FlowFinalNode
-FlowFinalNode3CreationTool_desc=Create new FlowFinalNode
-ActivityFinalNode4CreationTool_title=ActivityFinalNode
-ActivityFinalNode4CreationTool_desc=Create new ActivityFinalNode
-
+Objects1Group_title=Objects
+Actions2Group_title=Actions
+Pins3Group_title=Pins
+Edges4Group_title=Edges
+ActionsLocalConditions5Group_title=Actions' Local Conditions
+ObjectFlowsSpecifications6Group_title=Object Flows' Specifications
+Initialnode1CreationTool_title=Initial node
+Initialnode1CreationTool_desc=Create an Initial node
+Activityfinal2CreationTool_title=Activity final
+Activityfinal2CreationTool_desc=Create an Activity final node
+Flowfinal3CreationTool_title=Flow final
+Flowfinal3CreationTool_desc=Create a Flow final node
+OpaqueAction1CreationTool_title=Opaque Action
+OpaqueAction1CreationTool_desc=Create an Opaque Action node
+CallBehaviorAction2CreationTool_title=Call Behavior Action
+CallBehaviorAction2CreationTool_desc=Create an Call Behavior Action node
+CallOperationAction3CreationTool_title=Call Operation Action
+CallOperationAction3CreationTool_desc=Create a Call Operation Action node
+OutputPin1CreationTool_title=Output Pin
+OutputPin1CreationTool_desc=Create an Output Pin
+InputPin2CreationTool_title=Input Pin
+InputPin2CreationTool_desc=Create an Input Pin
+ActionInputPin3CreationTool_title=Action Input Pin
+ActionInputPin3CreationTool_desc=Create an Action Input Pin
+ValuePin4CreationTool_title=Value Pin
+ValuePin4CreationTool_desc=Create a Value Pin
+ControlFlow1CreationTool_title=Control Flow
+ControlFlow1CreationTool_desc=Create a Control Flow
+ObjectFlow2CreationTool_title=Object Flow
+ObjectFlow2CreationTool_desc=Create an Object Flow
+LocalPreconditionConstraint1CreationTool_title=Local Precondition Constraint
+LocalPreconditionConstraint1CreationTool_desc=Create a Constraint as Local Precondition for an Action
+LocalPostconditionConstraint6CreationTool_title=Local Postcondition Constraint
+LocalPostconditionConstraint6CreationTool_desc=Create a Constraint as Local Postcondition for an Action
+SelectionBehavior1CreationTool_title=Selection Behavior
+SelectionBehavior1CreationTool_desc=Create a new Behavior or choose an exisitng one as Selection for an Object Flow
+TransformationBehavior2CreationTool_title=Transformation Behavior
+TransformationBehavior2CreationTool_desc=Create a new Behavior or choose an exisitng one as Transformation for an Object Flow
+ActivityActivityParametersCompartmentEditPart_title=ActivityParametersCompartment
+ActivityActivityPreConditionsCompartmentEditPart_title=ActivityPreConditionsCompartment
+ActivityActivityPostConditionsCompartmentEditPart_title=ActivityPostConditionsCompartment
+ActivityActivityContentCompartmentEditPart_title=ActivityContentCompartment
CommandName_OpenDiagram=Open Diagram
-NavigatorGroupName_Activity_1000_links=links
-NavigatorGroupName_InitialNode_2001_incominglinks=incoming links
-NavigatorGroupName_InitialNode_2001_outgoinglinks=outgoing links
-NavigatorGroupName_ActivityFinalNode_2002_incominglinks=incoming links
-NavigatorGroupName_ActivityFinalNode_2002_outgoinglinks=outgoing links
-NavigatorGroupName_FlowFinalNode_2003_incominglinks=incoming links
-NavigatorGroupName_FlowFinalNode_2003_outgoinglinks=outgoing links
-NavigatorGroupName_ControlFlow_4001_target=target
-NavigatorGroupName_ControlFlow_4001_source=source
+NavigatorGroupName_Package_1000_links=links
+NavigatorGroupName_Activity_2001_incominglinks=incoming links
+NavigatorGroupName_Constraint_3002_incominglinks=incoming links
+NavigatorGroupName_Constraint_3003_incominglinks=incoming links
+NavigatorGroupName_InitialNode_3004_incominglinks=incoming links
+NavigatorGroupName_InitialNode_3004_outgoinglinks=outgoing links
+NavigatorGroupName_ActivityFinalNode_3005_incominglinks=incoming links
+NavigatorGroupName_ActivityFinalNode_3005_outgoinglinks=outgoing links
+NavigatorGroupName_FlowFinalNode_3006_incominglinks=incoming links
+NavigatorGroupName_FlowFinalNode_3006_outgoinglinks=outgoing links
+NavigatorGroupName_OpaqueAction_3007_outgoinglinks=outgoing links
+NavigatorGroupName_OpaqueAction_3007_incominglinks=incoming links
+NavigatorGroupName_ValuePin_3015_incominglinks=incoming links
+NavigatorGroupName_ValuePin_3015_outgoinglinks=outgoing links
+NavigatorGroupName_ActionInputPin_3016_incominglinks=incoming links
+NavigatorGroupName_ActionInputPin_3016_outgoinglinks=outgoing links
+NavigatorGroupName_InputPin_3013_incominglinks=incoming links
+NavigatorGroupName_InputPin_3013_outgoinglinks=outgoing links
+NavigatorGroupName_OutputPin_3014_incominglinks=incoming links
+NavigatorGroupName_OutputPin_3014_outgoinglinks=outgoing links
+NavigatorGroupName_CallBehaviorAction_3008_outgoinglinks=outgoing links
+NavigatorGroupName_CallBehaviorAction_3008_incominglinks=incoming links
+NavigatorGroupName_ValuePin_3017_incominglinks=incoming links
+NavigatorGroupName_ValuePin_3017_outgoinglinks=outgoing links
+NavigatorGroupName_ActionInputPin_3018_incominglinks=incoming links
+NavigatorGroupName_ActionInputPin_3018_outgoinglinks=outgoing links
+NavigatorGroupName_InputPin_3019_incominglinks=incoming links
+NavigatorGroupName_InputPin_3019_outgoinglinks=outgoing links
+NavigatorGroupName_OutputPin_3020_incominglinks=incoming links
+NavigatorGroupName_OutputPin_3020_outgoinglinks=outgoing links
+NavigatorGroupName_CallOperationAction_3010_outgoinglinks=outgoing links
+NavigatorGroupName_CallOperationAction_3010_incominglinks=incoming links
+NavigatorGroupName_ActionInputPin_3021_incominglinks=incoming links
+NavigatorGroupName_ActionInputPin_3021_outgoinglinks=outgoing links
+NavigatorGroupName_ValuePin_3022_incominglinks=incoming links
+NavigatorGroupName_ValuePin_3022_outgoinglinks=outgoing links
+NavigatorGroupName_InputPin_3023_incominglinks=incoming links
+NavigatorGroupName_InputPin_3023_outgoinglinks=outgoing links
+NavigatorGroupName_OutputPin_3024_incominglinks=incoming links
+NavigatorGroupName_OutputPin_3024_outgoinglinks=outgoing links
+NavigatorGroupName_ValuePin_3025_incominglinks=incoming links
+NavigatorGroupName_ValuePin_3025_outgoinglinks=outgoing links
+NavigatorGroupName_ActionInputPin_3026_incominglinks=incoming links
+NavigatorGroupName_ActionInputPin_3026_outgoinglinks=outgoing links
+NavigatorGroupName_InputPin_3027_incominglinks=incoming links
+NavigatorGroupName_InputPin_3027_outgoinglinks=outgoing links
+NavigatorGroupName_Constraint_3011_incominglinks=incoming links
+NavigatorGroupName_Constraint_3012_incominglinks=incoming links
+NavigatorGroupName_Activity_3028_incominglinks=incoming links
+NavigatorGroupName_Activity_3029_incominglinks=incoming links
+NavigatorGroupName_ActionLocalPrecondition_4001_target=target
+NavigatorGroupName_ActionLocalPrecondition_4001_source=source
+NavigatorGroupName_ActionLocalPostcondition_4002_target=target
+NavigatorGroupName_ActionLocalPostcondition_4002_source=source
+NavigatorGroupName_ObjectFlowSelection_4005_target=target
+NavigatorGroupName_ObjectFlowTransformation_4006_target=target
+NavigatorGroupName_ObjectFlow_4003_target=target
+NavigatorGroupName_ObjectFlow_4003_source=source
+NavigatorGroupName_ControlFlow_4004_target=target
+NavigatorGroupName_ControlFlow_4004_source=source
NavigatorActionProvider_OpenDiagramActionName=Open Diagram
AbstractParser_UnexpectedValueType=Value of type {0} is expected
AbstractParser_WrongStringConversion=String value does not convert to {0} value
AbstractParser_UnknownLiteral=Unknown literal: {0}
-
MessageFormatParser_InvalidInputError=Invalid input at {0}
UMLModelingAssistantProviderTitle=Select domain model element
UMLModelingAssistantProviderMessage=Available domain model elements:
-Nodes1Group_title=Nodes
-Children2Group_title=Children
-Links3Group_title=Links
-Objects1Group_title=Objects
-ActivityActivityPreconditionEditPart_title=ActivityPrecondition
-ActivityActivityParametersCompartmentEditPart_title=ActivityParametersCompartment
-ActivityActivityPreConditionsCompartmentEditPart_title=ActivityPreConditionsCompartment
-ActivityActivityPostConditionsCompartmentEditPart_title=ActivityPostConditionsCompartment
-ActivityActivityContentCompartmentEditPart_title=ActivityContentCompartment
-Initialnode1CreationTool_title=Initial node
-Initialnode1CreationTool_desc=Create an Initial node
-Activityfinal2CreationTool_title=Activity final
-Activityfinal2CreationTool_desc=Create an Activity final node
-Flowfinal3CreationTool_title=Flow final
-Flowfinal3CreationTool_desc=Create a Flow final node
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfgen b/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfgen
index 9c4cc6c2ad2..1e2bf21b3c4 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfgen
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfgen
@@ -1,611 +1,4122 @@
<?xml version="1.0" encoding="UTF-8"?>
-<gmfgen:GenEditorGenerator xmi:version="2.0"
+<xmi:XMI xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgen="http://www.eclipse.org/gmf/2009/GenModel" packageNamePrefix="org.eclipse.papyrus.diagram.activity"
- modelID="PapyrusUMLActivityDiagram"
- dynamicTemplates="true"
- templateDirectory="/org.eclipse.papyrus.def/dynamic-templates3.5/codegen">
- <audits>
- <categories
- id="org.eclipse.uml2.uml.util.UMLValidator.validate"
- name="validateNoIncomingEdges"
- description="Validate the UML model"
- path="//@audits/@categories.0"/>
- <categories
- id="org.eclipse.uml2.uml.util.UMLValidator.validateInitialNode"
- name="validateInitialNode"
- description="Validate an initial node"
- path="//@audits/@categories.0 //@audits/@categories.1"
- audits="//@audits/@rules.0 //@audits/@rules.1"/>
- <categories
- id="org.eclipse.uml2.uml.util.UMLValidator.validateFinalNode"
- name="validateFinalNode"
- description="Validate a final node"
- path="//@audits/@categories.0 //@audits/@categories.2"
- audits="//@audits/@rules.2"/>
- <rules
- name="validateNoIncomingEdges"
- description="An initial node has no incoming edge"
- id="org.eclipse.uml2.uml.util.UMLValidator.validateInitialNode_validateNoIncomingEdges"
- rule="//@expressionProviders/@providers.0/@expressions.1"
- message="An initial node must have no incoming edge"
- useInLiveMode="true"
- category="//@audits/@categories.1">
- <target
- xsi:type="gmfgen:GenDomainElementTarget"
- contextSelector="//@audits/@clientContexts.0">
- <element
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InitialNode"/>
- </target>
- </rules>
- <rules
- name="validateControlEdges"
- description="Only control edges can have initial nodes as source"
- id="org.eclipse.uml2.uml.util.UMLValidator.validateInitialNode_validateControlEdges"
- rule="//@expressionProviders/@providers.0/@expressions.2"
- message="Only control edges can have initial nodes as source"
- useInLiveMode="true"
- category="//@audits/@categories.1">
- <target
- xsi:type="gmfgen:GenDomainElementTarget"
- contextSelector="//@audits/@clientContexts.0">
- <element
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InitialNode"/>
- </target>
- </rules>
- <rules
- name="validateNoOutgoingEdges"
- description="A fianl node has no outgoing edge"
- id="org.eclipse.uml2.uml.util.UMLValidator.validateFinalNode_validateNoOutgoingEdges"
- rule="//@expressionProviders/@providers.0/@expressions.3"
- message="A final node must have no outgoing edge"
- useInLiveMode="true"
- category="//@audits/@categories.2">
- <target
- xsi:type="gmfgen:GenDomainElementTarget"
- contextSelector="//@audits/@clientContexts.0">
- <element
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/FinalNode"/>
- </target>
- </rules>
- <clientContexts
- ruleTargets="//@audits/@rules.0/@target //@audits/@rules.1/@target //@audits/@rules.2/@target"/>
- </audits>
- <diagram
- visualID="1000"
- editPartClassName="ActivityDiagramEditPart"
- itemSemanticEditPolicyClassName="ActivityDiagramItemSemanticEditPolicy"
- canonicalEditPolicyClassName="ActivityCanonicalEditPolicy"
- iconProviderPriority="Low"
- validationProviderPriority="Low">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="PackageEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.draw2d.FreeformLayer"/>
- <domainDiagramElement
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package"/>
- <childNodes
- xsi:type="gmfgen:GenChildLabelNode"
- visualID="3001"
- editPartClassName="ParameterEditPart"
- itemSemanticEditPolicyClassName="ParameterItemSemanticEditPolicy"
- notationViewFactoryClassName="ParameterViewFactory"
- canonicalEditPolicyClassName="ParameterCanonicalEditPolicy"
- graphicalNodeEditPolicyClassName="ParameterGraphicalNodeEditPolicy"
- createCommandClassName="ParameterCreateCommand"
- containers="//@diagram/@compartments.0">
+ xmlns:gmfgen="http://www.eclipse.org/gmf/2009/GenModel"
+ xmlns:papyrusgmfgenextension="http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension">
+ <gmfgen:GenEditorGenerator
+ packageNamePrefix="org.eclipse.papyrus.diagram.activity"
+ modelID="PapyrusUMLActivityDiagram"
+ dynamicTemplates="true"
+ templateDirectory="/org.eclipse.papyrus.def/dynamic-templates3.5/codegen">
+ <audits>
+ <categories
+ id="org.eclipse.uml2.uml.util.UMLValidator.validate"
+ name="validateUMLModel"
+ description="Validate the UML model"
+ path="/0/@audits/@categories.0"/>
+ <categories
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateInitialNode"
+ name="validateInitialNode"
+ description="Validate an initial node"
+ path="/0/@audits/@categories.0 /0/@audits/@categories.1"
+ audits="/0/@audits/@rules.0 /0/@audits/@rules.1"/>
+ <categories
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateFinalNode"
+ name="validateFinalNode"
+ description="Validate a final node"
+ path="/0/@audits/@categories.0 /0/@audits/@categories.2"
+ audits="/0/@audits/@rules.2"/>
+ <categories
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateCallBehaviorAction"
+ name="validateCallBehaviorAction"
+ description="Validate a call behavior action"
+ path="/0/@audits/@categories.0 /0/@audits/@categories.3"/>
+ <categories
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateCallOperationAction"
+ name="validateCallOperationAction"
+ description="Validate a call operation action"
+ path="/0/@audits/@categories.0 /0/@audits/@categories.4"/>
+ <categories
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateCallAction"
+ name="validateCallAction"
+ description="Validate a call action"
+ path="/0/@audits/@categories.0 /0/@audits/@categories.5"/>
+ <categories
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateInvocationAction"
+ name="validateInvocationAction"
+ description="Validate an invocation action"
+ path="/0/@audits/@categories.0 /0/@audits/@categories.6"/>
+ <categories
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateActivityNode"
+ name="validateActivityNode"
+ description="Validate an activity node"
+ path="/0/@audits/@categories.0 /0/@audits/@categories.7"/>
+ <categories
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateRedefinableElement"
+ name="validateRedefinableElement"
+ description="Validate a redefineable element"
+ path="/0/@audits/@categories.0 /0/@audits/@categories.8"/>
+ <categories
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateNamedElement"
+ name="validateNamedElement"
+ description="Validate a named element"
+ path="/0/@audits/@categories.0 /0/@audits/@categories.9"/>
+ <categories
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateElement"
+ name="validateElement"
+ description="Validate an element"
+ path="/0/@audits/@categories.0 /0/@audits/@categories.10"/>
+ <rules
+ name="validateNoIncomingEdges"
+ description="An initial node has no incoming edge"
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateInitialNode_validateNoIncomingEdges"
+ rule="/0/@expressionProviders/@providers.1/@expressions.2"
+ message="An initial node must have no incoming edge"
+ useInLiveMode="true"
+ category="/0/@audits/@categories.1">
+ <target
+ xsi:type="gmfgen:GenDomainElementTarget"
+ contextSelector="/0/@audits/@clientContexts.0">
+ <element
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InitialNode"/>
+ </target>
+ </rules>
+ <rules
+ name="validateControlEdges"
+ description="Only control edges can have initial nodes as source"
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateInitialNode_validateControlEdges"
+ rule="/0/@expressionProviders/@providers.1/@expressions.3"
+ message="Only control edges can have initial nodes as source"
+ useInLiveMode="true"
+ category="/0/@audits/@categories.1">
+ <target
+ xsi:type="gmfgen:GenDomainElementTarget"
+ contextSelector="/0/@audits/@clientContexts.0">
+ <element
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InitialNode"/>
+ </target>
+ </rules>
+ <rules
+ name="validateNoOutgoingEdges"
+ description="A fianl node has no outgoing edge"
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateFinalNode_validateNoOutgoingEdges"
+ rule="/0/@expressionProviders/@providers.1/@expressions.4"
+ message="A final node must have no outgoing edge"
+ useInLiveMode="true"
+ category="/0/@audits/@categories.2">
+ <target
+ xsi:type="gmfgen:GenDomainElementTarget"
+ contextSelector="/0/@audits/@clientContexts.0">
+ <element
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/FinalNode"/>
+ </target>
+ </rules>
+ <clientContexts
+ ruleTargets="/0/@audits/@rules.0/@target /0/@audits/@rules.1/@target /0/@audits/@rules.2/@target"/>
+ </audits>
+ <diagram
+ visualID="1000"
+ editPartClassName="ActivityDiagramEditPart"
+ itemSemanticEditPolicyClassName="ActivityDiagramItemSemanticEditPolicy"
+ canonicalEditPolicyClassName="ActivityCanonicalEditPolicy"
+ iconProviderPriority="Low"
+ validationProviderPriority="Low">
<diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/>
<elementType
xsi:type="gmfgen:MetamodelType"
- editHelperClassName="ParameterEditHelper"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="ActivityParameterFigure"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class ActivityParameterFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public ActivityParameterFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Parameter"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Behavior/ownedParameter"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Behavior/ownedParameter"/>
- </modelFacet>
- <labelModelFacet
- parser="//@labelParsers/@implementations.2"/>
- </childNodes>
- <childNodes
- xsi:type="gmfgen:GenChildLabelNode"
- visualID="3002"
- editPartClassName="ConstraintEditPart"
- itemSemanticEditPolicyClassName="ConstraintItemSemanticEditPolicy"
- notationViewFactoryClassName="ConstraintViewFactory"
- canonicalEditPolicyClassName="ConstraintCanonicalEditPolicy"
- graphicalNodeEditPolicyClassName="ConstraintGraphicalNodeEditPolicy"
- createCommandClassName="ConstraintCreateCommand"
- containers="//@diagram/@compartments.1">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="ConstraintEditHelper"/>
+ editHelperClassName="PackageEditHelper"/>
<viewmap
xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Namespace/ownedRule"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Behavior/precondition"/>
- </modelFacet>
- <labelModelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="//@labelParsers/@implementations.0"
- viewPattern="&lt;&lt;precondition>> {0}"
- editorPattern="{0}"
- editPattern="{0}">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </labelModelFacet>
- </childNodes>
- <childNodes
- xsi:type="gmfgen:GenChildLabelNode"
- visualID="3003"
- editPartClassName="Constraint2EditPart"
- itemSemanticEditPolicyClassName="Constraint2ItemSemanticEditPolicy"
- notationViewFactoryClassName="ConstraintViewFactory"
- canonicalEditPolicyClassName="Constraint2CanonicalEditPolicy"
- graphicalNodeEditPolicyClassName="Constraint2GraphicalNodeEditPolicy"
- createCommandClassName="Constraint2CreateCommand"
- containers="//@diagram/@compartments.2">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- metamodelType="//@diagram/@childNodes.1/@elementType"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Namespace/ownedRule"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Behavior/postcondition"/>
- </modelFacet>
- <labelModelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="//@labelParsers/@implementations.0"
- viewPattern="&lt;&lt;postcondition>> {0}"
- editorPattern="{0}"
- editPattern="{0}">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </labelModelFacet>
- </childNodes>
- <childNodes
- visualID="3004"
- editPartClassName="InitialNodeEditPart"
- itemSemanticEditPolicyClassName="InitialNodeItemSemanticEditPolicy"
- notationViewFactoryClassName="InitialNodeViewFactory"
- canonicalEditPolicyClassName="InitialNodeCanonicalEditPolicy"
- graphicalNodeEditPolicyClassName="InitialNodeGraphicalNodeEditPolicy"
- createCommandClassName="InitialNodeCreateCommand"
- containers="//@diagram/@compartments.3">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="InitialNodeEditHelper"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="InitialNodeFigure"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class InitialNodeFigure extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public InitialNodeFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setFill(false);&#xA;this.setOutline(false);&#xA;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;this.setMaximumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(17)&#xA;, getMapMode().DPtoLP(17)&#xA;));&#xA;this.setMinimumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;this.setSize(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;);&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;org.eclipse.draw2d.Ellipse disc0 = new org.eclipse.draw2d.Ellipse();&#xA;disc0.setLineWidth(1);&#xA;&#x9;disc0.setBackgroundColor(org.eclipse.draw2d.ColorConstants.black);&#xA;disc0.setSize(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;);&#xA;&#xA;this.add(disc0);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;">
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="16"
- height="16"/>
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:OpenDiagramBehaviour"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InitialNode"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
- </modelFacet>
- </childNodes>
- <childNodes
- visualID="3005"
- editPartClassName="ActivityFinalNodeEditPart"
- itemSemanticEditPolicyClassName="ActivityFinalNodeItemSemanticEditPolicy"
- notationViewFactoryClassName="ActivityFinalNodeViewFactory"
- canonicalEditPolicyClassName="ActivityFinalNodeCanonicalEditPolicy"
- graphicalNodeEditPolicyClassName="ActivityFinalNodeGraphicalNodeEditPolicy"
- createCommandClassName="ActivityFinalNodeCreateCommand"
- containers="//@diagram/@compartments.3">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="ActivityFinalNodeEditHelper"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="ActivityFinalNodeFigure"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class ActivityFinalNodeFigure extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public ActivityFinalNodeFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setFill(false);&#xA;this.setOutline(false);&#xA;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;));&#xA;this.setMaximumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(23)&#xA;, getMapMode().DPtoLP(23)&#xA;));&#xA;this.setMinimumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;));&#xA;this.setSize(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;);&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;org.eclipse.draw2d.Ellipse circle0 = new org.eclipse.draw2d.Ellipse();&#xA;circle0.setLineWidth(1);&#xA;circle0.setSize(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;);&#xA;&#xA;this.add(circle0);&#xA;&#xA;&#xA;&#xA;org.eclipse.draw2d.Ellipse disc0 = new org.eclipse.draw2d.Ellipse();&#xA;disc0.setLineWidth(1);&#xA;&#x9;disc0.setBackgroundColor(org.eclipse.draw2d.ColorConstants.black);&#xA;disc0.setLocation(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(3)&#xA;, getMapMode().DPtoLP(3)&#xA;));&#xA;disc0.setSize(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;);&#xA;&#xA;this.add(disc0);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;">
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="22"
- height="22"/>
- <attributes
- xsi:type="gmfgen:StyleAttributes"
- fixedForeground="true"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:OpenDiagramBehaviour"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActivityFinalNode"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
- </modelFacet>
- </childNodes>
- <childNodes
- visualID="3006"
- editPartClassName="FlowFinalNodeEditPart"
- itemSemanticEditPolicyClassName="FlowFinalNodeItemSemanticEditPolicy"
- notationViewFactoryClassName="FlowFinalNodeViewFactory"
- canonicalEditPolicyClassName="FlowFinalNodeCanonicalEditPolicy"
- graphicalNodeEditPolicyClassName="FlowFinalNodeGraphicalNodeEditPolicy"
- createCommandClassName="FlowFinalNodeCreateCommand"
- containers="//@diagram/@compartments.3">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="FlowFinalNodeEditHelper"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="FlowFinalNodeFigure"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class FlowFinalNodeFigure extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public FlowFinalNodeFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setFill(false);&#xA;this.setOutline(false);&#xA;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;));&#xA;this.setMaximumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(23)&#xA;, getMapMode().DPtoLP(23)&#xA;));&#xA;this.setMinimumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;));&#xA;this.setSize(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;);&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;org.eclipse.draw2d.Ellipse elli0 = new org.eclipse.draw2d.Ellipse();&#xA;elli0.setLineWidth(1);&#xA;elli0.setSize(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;);&#xA;&#xA;this.add(elli0);&#xA;&#xA;&#xA;&#xA;org.eclipse.draw2d.Polyline antislash0 = new org.eclipse.draw2d.Polyline();&#xA;antislash0.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(4)&#xA;, getMapMode().DPtoLP(4)&#xA;));&#xA;antislash0.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(18)&#xA;, getMapMode().DPtoLP(18)&#xA;));&#xA;antislash0.setLineWidth(1);&#xA;&#xA;this.add(antislash0);&#xA;&#xA;&#xA;&#xA;org.eclipse.draw2d.Polyline slash0 = new org.eclipse.draw2d.Polyline();&#xA;slash0.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(4)&#xA;, getMapMode().DPtoLP(18)&#xA;));&#xA;slash0.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(18)&#xA;, getMapMode().DPtoLP(4)&#xA;));&#xA;slash0.setLineWidth(1);&#xA;&#xA;this.add(slash0);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;">
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="22"
- height="22"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:OpenDiagramBehaviour"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/FlowFinalNode"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
- </modelFacet>
- </childNodes>
- <topLevelNodes
- visualID="2001"
- editPartClassName="ActivityEditPart"
- itemSemanticEditPolicyClassName="ActivityItemSemanticEditPolicy"
- notationViewFactoryClassName="ActivityViewFactory"
- canonicalEditPolicyClassName="Activity2CanonicalEditPolicy"
- compartments="//@diagram/@compartments.0 //@diagram/@compartments.1 //@diagram/@compartments.2 //@diagram/@compartments.3"
- graphicalNodeEditPolicyClassName="ActivityGraphicalNodeEditPolicy"
- createCommandClassName="ActivityCreateCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="ActivityEditHelper"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="CustomActivityRectangleFigure"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CustomActivityRectangleFigure extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fHeaderLabel; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.RectangleFigure fActivityParametersCompartment; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.RectangleFigure fActivityPreconditionsCompartment; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.RectangleFigure fActivityPostconditionsCompartment; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fHeaderSingleExecution; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.RectangleFigure fCompartmentFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CustomActivityRectangleFigure() {&#xA;&#x9;&#x9;&#xA;&#x9;org.eclipse.draw2d.BorderLayout layoutThis = new org.eclipse.draw2d.BorderLayout();&#xA;&#x9;layoutThis.setHorizontalSpacing(0);// TODO mapMode?&#xA;&#x9;layoutThis.setVerticalSpacing(0);&#xA;&#x9;this.setLayoutManager(layoutThis);&#xA;&#xA;&#x9;&#x9;this.setFill(false);&#xA;this.setOutline(false);&#xA;this.setLineWidth(0);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(857)&#xA;, getMapMode().DPtoLP(757)&#xA;));&#xA;this.setBorder(new org.eclipse.draw2d.MarginBorder(getMapMode().DPtoLP(30)&#xA;, getMapMode().DPtoLP(30)&#xA;, getMapMode().DPtoLP(30)&#xA;, getMapMode().DPtoLP(30)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;org.eclipse.draw2d.RoundedRectangle activityBorderFigure0 = new org.eclipse.draw2d.RoundedRectangle();&#xA;activityBorderFigure0.setCornerDimensions(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(8)&#xA;, getMapMode().DPtoLP(8)&#xA;));&#xA;activityBorderFigure0.setLineWidth(1);&#xA;&#xA;this.add(activityBorderFigure0, org.eclipse.draw2d.BorderLayout.CENTER);&#xA;&#xA;&#x9;org.eclipse.draw2d.GridLayout layoutActivityBorderFigure0 = new org.eclipse.draw2d.GridLayout();&#xA;&#x9;layoutActivityBorderFigure0.numColumns = 3;&#xA;&#x9;layoutActivityBorderFigure0.makeColumnsEqualWidth = false;&#xA;&#x9;layoutActivityBorderFigure0.horizontalSpacing = 0;&#xA;&#x9;layoutActivityBorderFigure0.verticalSpacing = 0;&#xA;&#x9;layoutActivityBorderFigure0.marginWidth = 0;&#xA;&#x9;layoutActivityBorderFigure0.marginHeight = 0;&#xA;&#x9;activityBorderFigure0.setLayoutManager(layoutActivityBorderFigure0);&#xA;&#xA;&#xA;&#xA;org.eclipse.draw2d.RectangleFigure labelAndParameter1 = new org.eclipse.draw2d.RectangleFigure();&#xA;labelAndParameter1.setFill(false);&#xA;labelAndParameter1.setOutline(false);&#xA;labelAndParameter1.setLineWidth(0);&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintLabelAndParameter1 = new org.eclipse.draw2d.GridData();&#xA;constraintLabelAndParameter1.verticalAlignment = org.eclipse.draw2d.GridData.CENTER;&#xA;constraintLabelAndParameter1.horizontalAlignment = org.eclipse.draw2d.GridData.BEGINNING;&#xA;constraintLabelAndParameter1.horizontalIndent = 0;&#xA;constraintLabelAndParameter1.horizontalSpan = 1;&#xA;constraintLabelAndParameter1.verticalSpan = 1;&#xA;constraintLabelAndParameter1.grabExcessHorizontalSpace = true;&#xA;constraintLabelAndParameter1.grabExcessVerticalSpace = false;&#xA;activityBorderFigure0.add(labelAndParameter1, constraintLabelAndParameter1);&#xA;&#xA;&#xA;&#x9;org.eclipse.draw2d.GridLayout layoutLabelAndParameter1 = new org.eclipse.draw2d.GridLayout();&#xA;&#x9;layoutLabelAndParameter1.numColumns = 1;&#xA;&#x9;layoutLabelAndParameter1.makeColumnsEqualWidth = true;&#xA;&#x9;labelAndParameter1.setLayoutManager(layoutLabelAndParameter1);&#xA;&#xA;&#xA;&#xA;fHeaderLabel = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();&#xA;fHeaderLabel.setText(&quot;ActivityName&quot;);&#xA;&#xA;fHeaderLabel.setFont(FHEADERLABEL_FONT);&#xA;&#xA;&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintFHeaderLabel = new org.eclipse.draw2d.GridData();&#xA;constraintFHeaderLabel.verticalAlignment = org.eclipse.draw2d.GridData.CENTER;&#xA;constraintFHeaderLabel.horizontalAlignment = org.eclipse.draw2d.GridData.BEGINNING;&#xA;constraintFHeaderLabel.horizontalIndent = 4;&#xA;constraintFHeaderLabel.horizontalSpan = 1;&#xA;constraintFHeaderLabel.verticalSpan = 1;&#xA;constraintFHeaderLabel.grabExcessHorizontalSpace = true;&#xA;constraintFHeaderLabel.grabExcessVerticalSpace = false;&#xA;labelAndParameter1.add(fHeaderLabel, constraintFHeaderLabel);&#xA;&#xA;&#xA;&#xA;&#xA;fActivityParametersCompartment = new org.eclipse.draw2d.RectangleFigure();&#xA;fActivityParametersCompartment.setFill(false);&#xA;fActivityParametersCompartment.setOutline(false);&#xA;fActivityParametersCompartment.setLineWidth(0);&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintFActivityParametersCompartment = new org.eclipse.draw2d.GridData();&#xA;constraintFActivityParametersCompartment.verticalAlignment = org.eclipse.draw2d.GridData.CENTER;&#xA;constraintFActivityParametersCompartment.horizontalAlignment = org.eclipse.draw2d.GridData.BEGINNING;&#xA;constraintFActivityParametersCompartment.horizontalIndent = 0;&#xA;constraintFActivityParametersCompartment.horizontalSpan = 1;&#xA;constraintFActivityParametersCompartment.verticalSpan = 1;&#xA;constraintFActivityParametersCompartment.grabExcessHorizontalSpace = true;&#xA;constraintFActivityParametersCompartment.grabExcessVerticalSpace = false;&#xA;labelAndParameter1.add(fActivityParametersCompartment, constraintFActivityParametersCompartment);&#xA;&#xA;fActivityParametersCompartment.setLayoutManager(new org.eclipse.draw2d.StackLayout());&#xA;&#xA;&#xA;&#xA;&#xA;org.eclipse.draw2d.RectangleFigure prePostContions1 = new org.eclipse.draw2d.RectangleFigure();&#xA;prePostContions1.setFill(false);&#xA;prePostContions1.setOutline(false);&#xA;prePostContions1.setLineWidth(0);&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintPrePostContions1 = new org.eclipse.draw2d.GridData();&#xA;constraintPrePostContions1.verticalAlignment = org.eclipse.draw2d.GridData.CENTER;&#xA;constraintPrePostContions1.horizontalAlignment = org.eclipse.draw2d.GridData.BEGINNING;&#xA;constraintPrePostContions1.horizontalIndent = 0;&#xA;constraintPrePostContions1.horizontalSpan = 1;&#xA;constraintPrePostContions1.verticalSpan = 1;&#xA;constraintPrePostContions1.grabExcessHorizontalSpace = true;&#xA;constraintPrePostContions1.grabExcessVerticalSpace = false;&#xA;activityBorderFigure0.add(prePostContions1, constraintPrePostContions1);&#xA;&#xA;&#xA;&#x9;org.eclipse.draw2d.GridLayout layoutPrePostContions1 = new org.eclipse.draw2d.GridLayout();&#xA;&#x9;layoutPrePostContions1.numColumns = 1;&#xA;&#x9;layoutPrePostContions1.makeColumnsEqualWidth = true;&#xA;&#x9;prePostContions1.setLayoutManager(layoutPrePostContions1);&#xA;&#xA;&#xA;&#xA;fActivityPreconditionsCompartment = new org.eclipse.draw2d.RectangleFigure();&#xA;fActivityPreconditionsCompartment.setFill(false);&#xA;fActivityPreconditionsCompartment.setOutline(false);&#xA;fActivityPreconditionsCompartment.setLineWidth(0);&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintFActivityPreconditionsCompartment = new org.eclipse.draw2d.GridData();&#xA;constraintFActivityPreconditionsCompartment.verticalAlignment = org.eclipse.draw2d.GridData.CENTER;&#xA;constraintFActivityPreconditionsCompartment.horizontalAlignment = org.eclipse.draw2d.GridData.BEGINNING;&#xA;constraintFActivityPreconditionsCompartment.horizontalIndent = 0;&#xA;constraintFActivityPreconditionsCompartment.horizontalSpan = 1;&#xA;constraintFActivityPreconditionsCompartment.verticalSpan = 1;&#xA;constraintFActivityPreconditionsCompartment.grabExcessHorizontalSpace = true;&#xA;constraintFActivityPreconditionsCompartment.grabExcessVerticalSpace = false;&#xA;prePostContions1.add(fActivityPreconditionsCompartment, constraintFActivityPreconditionsCompartment);&#xA;&#xA;fActivityPreconditionsCompartment.setLayoutManager(new org.eclipse.draw2d.StackLayout());&#xA;&#xA;&#xA;&#xA;fActivityPostconditionsCompartment = new org.eclipse.draw2d.RectangleFigure();&#xA;fActivityPostconditionsCompartment.setFill(false);&#xA;fActivityPostconditionsCompartment.setOutline(false);&#xA;fActivityPostconditionsCompartment.setLineWidth(0);&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintFActivityPostconditionsCompartment = new org.eclipse.draw2d.GridData();&#xA;constraintFActivityPostconditionsCompartment.verticalAlignment = org.eclipse.draw2d.GridData.CENTER;&#xA;constraintFActivityPostconditionsCompartment.horizontalAlignment = org.eclipse.draw2d.GridData.BEGINNING;&#xA;constraintFActivityPostconditionsCompartment.horizontalIndent = 0;&#xA;constraintFActivityPostconditionsCompartment.horizontalSpan = 1;&#xA;constraintFActivityPostconditionsCompartment.verticalSpan = 1;&#xA;constraintFActivityPostconditionsCompartment.grabExcessHorizontalSpace = true;&#xA;constraintFActivityPostconditionsCompartment.grabExcessVerticalSpace = false;&#xA;prePostContions1.add(fActivityPostconditionsCompartment, constraintFActivityPostconditionsCompartment);&#xA;&#xA;fActivityPostconditionsCompartment.setLayoutManager(new org.eclipse.draw2d.StackLayout());&#xA;&#xA;&#xA;&#xA;&#xA;fHeaderSingleExecution = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();&#xA;fHeaderSingleExecution.setText(&quot;&quot;);&#xA;fHeaderSingleExecution.setBorder(new org.eclipse.draw2d.MarginBorder(getMapMode().DPtoLP(0)&#xA;, getMapMode().DPtoLP(0)&#xA;, getMapMode().DPtoLP(0)&#xA;, getMapMode().DPtoLP(8)&#xA;));&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintFHeaderSingleExecution = new org.eclipse.draw2d.GridData();&#xA;constraintFHeaderSingleExecution.verticalAlignment = org.eclipse.draw2d.GridData.CENTER;&#xA;constraintFHeaderSingleExecution.horizontalAlignment = org.eclipse.draw2d.GridData.BEGINNING;&#xA;constraintFHeaderSingleExecution.horizontalIndent = 0;&#xA;constraintFHeaderSingleExecution.horizontalSpan = 1;&#xA;constraintFHeaderSingleExecution.verticalSpan = 2;&#xA;constraintFHeaderSingleExecution.grabExcessHorizontalSpace = false;&#xA;constraintFHeaderSingleExecution.grabExcessVerticalSpace = false;&#xA;activityBorderFigure0.add(fHeaderSingleExecution, constraintFHeaderSingleExecution);&#xA;&#xA;&#xA;&#xA;&#xA;fCompartmentFigure = new org.eclipse.draw2d.RectangleFigure();&#xA;fCompartmentFigure.setFill(false);&#xA;fCompartmentFigure.setOutline(false);&#xA;fCompartmentFigure.setLineWidth(0);&#xA;fCompartmentFigure.setBorder(new org.eclipse.draw2d.MarginBorder(getMapMode().DPtoLP(0)&#xA;, getMapMode().DPtoLP(4)&#xA;, getMapMode().DPtoLP(4)&#xA;, getMapMode().DPtoLP(4)&#xA;));&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintFCompartmentFigure = new org.eclipse.draw2d.GridData();&#xA;constraintFCompartmentFigure.verticalAlignment = org.eclipse.draw2d.GridData.FILL;&#xA;constraintFCompartmentFigure.horizontalAlignment = org.eclipse.draw2d.GridData.FILL;&#xA;constraintFCompartmentFigure.horizontalIndent = 0;&#xA;constraintFCompartmentFigure.horizontalSpan = 3;&#xA;constraintFCompartmentFigure.verticalSpan = 1;&#xA;constraintFCompartmentFigure.grabExcessHorizontalSpace = true;&#xA;constraintFCompartmentFigure.grabExcessVerticalSpace = true;&#xA;activityBorderFigure0.add(fCompartmentFigure, constraintFCompartmentFigure);&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getHeaderLabel() {&#xA;&#x9;&#x9;return fHeaderLabel;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.RectangleFigure getActivityParametersCompartment() {&#xA;&#x9;&#x9;return fActivityParametersCompartment;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.RectangleFigure getActivityPreconditionsCompartment() {&#xA;&#x9;&#x9;return fActivityPreconditionsCompartment;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.RectangleFigure getActivityPostconditionsCompartment() {&#xA;&#x9;&#x9;return fActivityPostconditionsCompartment;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getHeaderSingleExecution() {&#xA;&#x9;&#x9;return fHeaderSingleExecution;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.RectangleFigure getCompartmentFigure() {&#xA;&#x9;&#x9;return fCompartmentFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;/**&#xA; * @generated&#xA; */&#xA;static final org.eclipse.swt.graphics.Font FHEADERLABEL_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), org.eclipse.swt.widgets.Display.getDefault().getSystemFont().getFontData()[0].getName(), 8, org.eclipse.swt.SWT.BOLD);&#xA;&#xA;">
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="857"
- height="757"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="EditPolicy.COMPONENT_ROLE"
- editPolicyQualifiedClassName="org.eclipse.gef.editpolicies.RootComponentEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="EditPolicy.LAYOUT_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.activity.edit.policies.ResizeActivityEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="//@expressionProviders/@providers.0/@expressions.0">
- <feature
+ figureQualifiedClassName="org.eclipse.draw2d.FreeformLayer"/>
+ <domainDiagramElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package"/>
+ <childNodes
+ xsi:type="gmfgen:GenChildLabelNode"
+ visualID="3001"
+ editPartClassName="ParameterEditPart"
+ itemSemanticEditPolicyClassName="ParameterItemSemanticEditPolicy"
+ notationViewFactoryClassName="ParameterViewFactory"
+ canonicalEditPolicyClassName="ParameterCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ParameterGraphicalNodeEditPolicy"
+ createCommandClassName="ParameterCreateCommand"
+ containers="/0/@diagram/@compartments.0">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="ParameterEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Parameter"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Behavior/ownedParameter"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Behavior/ownedParameter"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.1">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labelModelFacet
+ parser="/0/@labelParsers/@implementations.2"/>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildLabelNode"
+ visualID="3002"
+ editPartClassName="ConstraintInActivityAsPrecondEditPart"
+ itemSemanticEditPolicyClassName="ConstraintInActivityAsPrecondItemSemanticEditPolicy"
+ notationViewFactoryClassName="ConstraintViewFactory"
+ canonicalEditPolicyClassName="ConstraintInActivityAsPrecondCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ConstraintInActivityAsPrecondGraphicalNodeEditPolicy"
+ createCommandClassName="ConstraintInActivityAsPrecondCreateCommand"
+ containers="/0/@diagram/@compartments.1">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="ConstraintEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Namespace/ownedRule"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Behavior/precondition"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.2">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labelModelFacet
+ xsi:type="gmfgen:FeatureLabelModelFacet"
+ parser="/0/@labelParsers/@implementations.0"
+ viewPattern="&lt;&lt;precondition>> {0}"
+ editorPattern="{0}"
+ editPattern="{0}">
+ <metaFeatures
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </labelModelFacet>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildLabelNode"
+ visualID="3003"
+ editPartClassName="ConstraintInActivityAsPostcondEditPart"
+ itemSemanticEditPolicyClassName="ConstraintInActivityAsPostcondItemSemanticEditPolicy"
+ notationViewFactoryClassName="ConstraintViewFactory"
+ canonicalEditPolicyClassName="ConstraintInActivityAsPostcondCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ConstraintInActivityAsPostcondGraphicalNodeEditPolicy"
+ createCommandClassName="ConstraintInActivityAsPostcondCreateCommand"
+ containers="/0/@diagram/@compartments.2">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@childNodes.1/@elementType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Namespace/ownedRule"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Behavior/postcondition"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.3">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labelModelFacet
+ xsi:type="gmfgen:FeatureLabelModelFacet"
+ parser="/0/@labelParsers/@implementations.0"
+ viewPattern="&lt;&lt;postcondition>> {0}"
+ editorPattern="{0}"
+ editPattern="{0}">
+ <metaFeatures
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </labelModelFacet>
+ </childNodes>
+ <childNodes
+ visualID="3004"
+ editPartClassName="InitialNodeEditPart"
+ itemSemanticEditPolicyClassName="InitialNodeItemSemanticEditPolicy"
+ notationViewFactoryClassName="InitialNodeViewFactory"
+ canonicalEditPolicyClassName="InitialNodeCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="InitialNodeGraphicalNodeEditPolicy"
+ createCommandClassName="InitialNodeCreateCommand"
+ containers="/0/@diagram/@compartments.3">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="InitialNodeEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="InitialNodeFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class InitialNodeFigure extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public InitialNodeFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setFill(false);&#xA;this.setOutline(false);&#xA;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;this.setMaximumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(17)&#xA;, getMapMode().DPtoLP(17)&#xA;));&#xA;this.setMinimumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;this.setSize(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;);&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;org.eclipse.draw2d.Ellipse disc0 = new org.eclipse.draw2d.Ellipse();&#xA;disc0.setLineWidth(1);&#xA;&#x9;disc0.setBackgroundColor(org.eclipse.draw2d.ColorConstants.black);&#xA;disc0.setSize(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;);&#xA;&#xA;this.add(disc0);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:ResizeConstraints"/>
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ <attributes
+ xsi:type="gmfgen:StyleAttributes"
+ fixedForeground="true"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InitialNode"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.4">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ </childNodes>
+ <childNodes
+ visualID="3005"
+ editPartClassName="ActivityFinalNodeEditPart"
+ itemSemanticEditPolicyClassName="ActivityFinalNodeItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActivityFinalNodeViewFactory"
+ canonicalEditPolicyClassName="ActivityFinalNodeCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ActivityFinalNodeGraphicalNodeEditPolicy"
+ createCommandClassName="ActivityFinalNodeCreateCommand"
+ containers="/0/@diagram/@compartments.3">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="ActivityFinalNodeEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="ActivityFinalNodeFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class ActivityFinalNodeFigure extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public ActivityFinalNodeFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setFill(false);&#xA;this.setOutline(false);&#xA;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;));&#xA;this.setMaximumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(23)&#xA;, getMapMode().DPtoLP(23)&#xA;));&#xA;this.setMinimumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;));&#xA;this.setSize(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;);&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;org.eclipse.draw2d.Ellipse circle0 = new org.eclipse.draw2d.Ellipse();&#xA;circle0.setLineWidth(1);&#xA;circle0.setSize(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;);&#xA;&#xA;this.add(circle0);&#xA;&#xA;&#xA;&#xA;org.eclipse.draw2d.Ellipse disc0 = new org.eclipse.draw2d.Ellipse();&#xA;disc0.setLineWidth(1);&#xA;&#x9;disc0.setBackgroundColor(org.eclipse.draw2d.ColorConstants.black);&#xA;disc0.setLocation(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(3)&#xA;, getMapMode().DPtoLP(3)&#xA;));&#xA;disc0.setSize(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;);&#xA;&#xA;this.add(disc0);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="22"
+ height="22"/>
+ <attributes
+ xsi:type="gmfgen:StyleAttributes"
+ fixedForeground="true"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActivityFinalNode"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.5">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ </childNodes>
+ <childNodes
+ visualID="3006"
+ editPartClassName="FlowFinalNodeEditPart"
+ itemSemanticEditPolicyClassName="FlowFinalNodeItemSemanticEditPolicy"
+ notationViewFactoryClassName="FlowFinalNodeViewFactory"
+ canonicalEditPolicyClassName="FlowFinalNodeCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="FlowFinalNodeGraphicalNodeEditPolicy"
+ createCommandClassName="FlowFinalNodeCreateCommand"
+ containers="/0/@diagram/@compartments.3">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="FlowFinalNodeEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="FlowFinalNodeFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class FlowFinalNodeFigure extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public FlowFinalNodeFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setFill(false);&#xA;this.setOutline(false);&#xA;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;));&#xA;this.setMaximumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(23)&#xA;, getMapMode().DPtoLP(23)&#xA;));&#xA;this.setMinimumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;));&#xA;this.setSize(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;);&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;org.eclipse.draw2d.Ellipse elli0 = new org.eclipse.draw2d.Ellipse();&#xA;elli0.setLineWidth(1);&#xA;elli0.setSize(getMapMode().DPtoLP(22)&#xA;, getMapMode().DPtoLP(22)&#xA;);&#xA;&#xA;this.add(elli0);&#xA;&#xA;&#xA;&#xA;org.eclipse.draw2d.Polyline antislash0 = new org.eclipse.draw2d.Polyline();&#xA;antislash0.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(4)&#xA;, getMapMode().DPtoLP(4)&#xA;));&#xA;antislash0.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(18)&#xA;, getMapMode().DPtoLP(18)&#xA;));&#xA;antislash0.setLineWidth(1);&#xA;&#xA;this.add(antislash0);&#xA;&#xA;&#xA;&#xA;org.eclipse.draw2d.Polyline slash0 = new org.eclipse.draw2d.Polyline();&#xA;slash0.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(4)&#xA;, getMapMode().DPtoLP(18)&#xA;));&#xA;slash0.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(18)&#xA;, getMapMode().DPtoLP(4)&#xA;));&#xA;slash0.setLineWidth(1);&#xA;&#xA;this.add(slash0);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="22"
+ height="22"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/FlowFinalNode"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.6">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ </childNodes>
+ <childNodes
+ visualID="3007"
+ editPartClassName="OpaqueActionEditPart"
+ itemSemanticEditPolicyClassName="OpaqueActionItemSemanticEditPolicy"
+ notationViewFactoryClassName="OpaqueActionViewFactory"
+ canonicalEditPolicyClassName="OpaqueActionCanonicalEditPolicy"
+ childNodes="/0/@diagram/@childNodes.7 /0/@diagram/@childNodes.8 /0/@diagram/@childNodes.9 /0/@diagram/@childNodes.10"
+ graphicalNodeEditPolicyClassName="OpaqueActionGraphicalNodeEditPolicy"
+ createCommandClassName="OpaqueActionCreateCommand"
+ containers="/0/@diagram/@compartments.3">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="OpaqueActionEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="ActionFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class ActionFigure extends org.eclipse.draw2d.RoundedRectangle {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel fActionLabel; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalRakeFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public ActionFigure() {&#xA;&#x9;&#x9;&#xA;&#x9;org.eclipse.papyrus.diagram.common.draw2d.CenterLayout layoutThis = new org.eclipse.papyrus.diagram.common.draw2d.CenterLayout();&#xA;&#xA;&#xA;&#x9;this.setLayoutManager(layoutThis);&#xA;&#xA;&#x9;&#x9;this.setCornerDimensions(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;this.setLineWidth(1);&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fActionLabel = new org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel();&#xA;&#xA;&#xA;&#xA;this.add(fActionLabel);&#xA;&#xA;&#xA;&#xA;fOptionalRakeFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalRakeFigure.setFill(false);&#xA;fOptionalRakeFigure.setLineWidth(2);&#xA;&#xA;this.add(fOptionalRakeFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel getActionLabel() {&#xA;&#x9;&#x9;return fActionLabel;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalRakeFigure() {&#xA;&#x9;&#x9;return fOptionalRakeFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
+ key="RequestConstants.REQ_CREATE"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OpaqueAction"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.7">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ visualID="5003"
+ editPartClassName="OpaqueActionNameEditPart"
+ itemSemanticEditPolicyClassName="OpaqueActionNameItemSemanticEditPolicy"
+ notationViewFactoryClassName="OpaqueActionNameViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getActionLabel"
+ figureQualifiedClassName="org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel"/>
+ <modelFacet
+ xsi:type="gmfgen:FeatureLabelModelFacet"
+ parser="/0/@labelParsers/@implementations.0">
+ <metaFeatures
href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="5001"
- editPartClassName="ActivityNameEditPart"
- itemSemanticEditPolicyClassName="ActivityNameItemSemanticEditPolicy"
- notationViewFactoryClassName="ActivityNameViewFactory">
+ </modelFacet>
+ </labels>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildSideAffixedNode"
+ visualID="3015"
+ editPartClassName="ValuePinInOpaqueActEditPart"
+ itemSemanticEditPolicyClassName="ValuePinInOpaqueActItemSemanticEditPolicy"
+ notationViewFactoryClassName="ValuePinViewFactory"
+ canonicalEditPolicyClassName="ValuePinInOpaqueActCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ValuePinInOpaqueActGraphicalNodeEditPolicy"
+ createCommandClassName="ValuePinInOpaqueActCreateCommand"
+ containers="/0/@diagram/@childNodes.6"
+ preferredSideName="WEST">
<diagramRunTimeClass
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="ValuePinEditHelper"/>
<viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getHeaderLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PinDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PinDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalArrowFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PinDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fOptionalArrowFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalArrowFigure.setLineWidth(1);&#xA;&#xA;this.add(fOptionalArrowFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalArrowFigure() {&#xA;&#x9;&#x9;return fOptionalArrowFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ValuePin"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OpaqueAction/inputValue"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OpaqueAction/inputValue"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.8">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5011"
+ editPartClassName="ValuePinInOActLabelEditPart"
+ itemSemanticEditPolicyClassName="ValuePinInOActLabelItemSemanticEditPolicy"
+ notationViewFactoryClassName="ValuePinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.5"/>
+ </labels>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5024"
+ editPartClassName="ValuePinInOActValueEditPart"
+ itemSemanticEditPolicyClassName="ValuePinInOActValueItemSemanticEditPolicy"
+ notationViewFactoryClassName="ValuePinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.6"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildSideAffixedNode"
+ visualID="3016"
+ editPartClassName="ActionInputPinInOpaqueActEditPart"
+ itemSemanticEditPolicyClassName="ActionInputPinInOpaqueActItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActionInputPinViewFactory"
+ canonicalEditPolicyClassName="ActionInputPinInOpaqueActCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ActionInputPinInOpaqueActGraphicalNodeEditPolicy"
+ createCommandClassName="ActionInputPinInOpaqueActCreateCommand"
+ containers="/0/@diagram/@childNodes.6"
+ preferredSideName="WEST">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="ActionInputPinEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PinDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PinDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalArrowFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PinDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fOptionalArrowFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalArrowFigure.setLineWidth(1);&#xA;&#xA;this.add(fOptionalArrowFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalArrowFigure() {&#xA;&#x9;&#x9;return fOptionalArrowFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActionInputPin"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OpaqueAction/inputValue"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OpaqueAction/inputValue"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.9">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5012"
+ editPartClassName="ActionInputPinInOActLabelEditPart"
+ itemSemanticEditPolicyClassName="ActionInputPinInOActLabelItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActionInputPinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.5"/>
+ </labels>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5025"
+ editPartClassName="ActionInputPinInOActValueEditPart"
+ itemSemanticEditPolicyClassName="ActionInputPinInOActValueItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActionInputPinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.6"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildSideAffixedNode"
+ visualID="3013"
+ editPartClassName="InputPinInOpaqueActEditPart"
+ itemSemanticEditPolicyClassName="InputPinInOpaqueActItemSemanticEditPolicy"
+ notationViewFactoryClassName="InputPinViewFactory"
+ canonicalEditPolicyClassName="InputPinInOpaqueActCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="InputPinInOpaqueActGraphicalNodeEditPolicy"
+ createCommandClassName="InputPinInOpaqueActCreateCommand"
+ containers="/0/@diagram/@childNodes.6"
+ preferredSideName="WEST">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="InputPinEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PinDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PinDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalArrowFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PinDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fOptionalArrowFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalArrowFigure.setLineWidth(1);&#xA;&#xA;this.add(fOptionalArrowFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalArrowFigure() {&#xA;&#x9;&#x9;return fOptionalArrowFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InputPin"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OpaqueAction/inputValue"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OpaqueAction/inputValue"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.10">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5009"
+ editPartClassName="InputPinInOActLabelEditPart"
+ itemSemanticEditPolicyClassName="InputPinInOActLabelItemSemanticEditPolicy"
+ notationViewFactoryClassName="InputPinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.5"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildSideAffixedNode"
+ visualID="3014"
+ editPartClassName="OutputPinInOpaqueActEditPart"
+ itemSemanticEditPolicyClassName="OutputPinInOpaqueActItemSemanticEditPolicy"
+ notationViewFactoryClassName="OutputPinViewFactory"
+ canonicalEditPolicyClassName="OutputPinInOpaqueActCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="OutputPinInOpaqueActGraphicalNodeEditPolicy"
+ createCommandClassName="OutputPinInOpaqueActCreateCommand"
+ containers="/0/@diagram/@childNodes.6"
+ preferredSideName="EAST">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="OutputPinEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PinDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PinDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalArrowFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PinDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fOptionalArrowFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalArrowFigure.setLineWidth(1);&#xA;&#xA;this.add(fOptionalArrowFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalArrowFigure() {&#xA;&#x9;&#x9;return fOptionalArrowFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OutputPin"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OpaqueAction/outputValue"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OpaqueAction/outputValue"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.11">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5010"
+ editPartClassName="OutputPinInOActLabelEditPart"
+ itemSemanticEditPolicyClassName="OutputPinInOActLabelItemSemanticEditPolicy"
+ notationViewFactoryClassName="OutputPinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.5"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ visualID="3008"
+ editPartClassName="CallBehaviorActionEditPart"
+ itemSemanticEditPolicyClassName="CallBehaviorActionItemSemanticEditPolicy"
+ notationViewFactoryClassName="CallBehaviorActionViewFactory"
+ canonicalEditPolicyClassName="CallBehaviorActionCanonicalEditPolicy"
+ childNodes="/0/@diagram/@childNodes.12 /0/@diagram/@childNodes.13 /0/@diagram/@childNodes.14 /0/@diagram/@childNodes.15"
+ graphicalNodeEditPolicyClassName="CallBehaviorActionGraphicalNodeEditPolicy"
+ createCommandClassName="CallBehaviorActionCreateCommand"
+ containers="/0/@diagram/@compartments.3">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="CallBehaviorActionEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="ActionFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class ActionFigure extends org.eclipse.draw2d.RoundedRectangle {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel fActionLabel; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalRakeFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public ActionFigure() {&#xA;&#x9;&#x9;&#xA;&#x9;org.eclipse.papyrus.diagram.common.draw2d.CenterLayout layoutThis = new org.eclipse.papyrus.diagram.common.draw2d.CenterLayout();&#xA;&#xA;&#xA;&#x9;this.setLayoutManager(layoutThis);&#xA;&#xA;&#x9;&#x9;this.setCornerDimensions(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;this.setLineWidth(1);&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fActionLabel = new org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel();&#xA;&#xA;&#xA;&#xA;this.add(fActionLabel);&#xA;&#xA;&#xA;&#xA;fOptionalRakeFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalRakeFigure.setFill(false);&#xA;fOptionalRakeFigure.setLineWidth(2);&#xA;&#xA;this.add(fOptionalRakeFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel getActionLabel() {&#xA;&#x9;&#x9;return fActionLabel;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalRakeFigure() {&#xA;&#x9;&#x9;return fOptionalRakeFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
+ key="RequestConstants.REQ_CREATE"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallBehaviorAction"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.12">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ visualID="5004"
+ editPartClassName="CallBehaviorActionNameEditPart"
+ itemSemanticEditPolicyClassName="CallBehaviorActionNameItemSemanticEditPolicy"
+ notationViewFactoryClassName="CallBehaviorActionNameViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getActionLabel"
+ figureQualifiedClassName="org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.4"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildSideAffixedNode"
+ visualID="3017"
+ editPartClassName="ValuePinInCallBeActEditPart"
+ itemSemanticEditPolicyClassName="ValuePinInCallBeActItemSemanticEditPolicy"
+ notationViewFactoryClassName="ValuePinViewFactory"
+ canonicalEditPolicyClassName="ValuePinInCallBeActCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ValuePinInCallBeActGraphicalNodeEditPolicy"
+ createCommandClassName="ValuePinInCallBeActCreateCommand"
+ containers="/0/@diagram/@childNodes.11"
+ preferredSideName="WEST">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@childNodes.7/@elementType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PinDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PinDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalArrowFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PinDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fOptionalArrowFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalArrowFigure.setLineWidth(1);&#xA;&#xA;this.add(fOptionalArrowFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalArrowFigure() {&#xA;&#x9;&#x9;return fOptionalArrowFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ValuePin"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InvocationAction/argument"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InvocationAction/argument"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.13">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5013"
+ editPartClassName="ValuePinInCBActLabelEditPart"
+ itemSemanticEditPolicyClassName="ValuePinInCBActLabelItemSemanticEditPolicy"
+ notationViewFactoryClassName="ValuePinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.5"/>
+ </labels>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5026"
+ editPartClassName="ValuePinInCBActValueEditPart"
+ itemSemanticEditPolicyClassName="ValuePinInCBActValueItemSemanticEditPolicy"
+ notationViewFactoryClassName="ValuePinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.6"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildSideAffixedNode"
+ visualID="3018"
+ editPartClassName="ActionInputPinInCallBeActEditPart"
+ itemSemanticEditPolicyClassName="ActionInputPinInCallBeActItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActionInputPinViewFactory"
+ canonicalEditPolicyClassName="ActionInputPinInCallBeActCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ActionInputPinInCallBeActGraphicalNodeEditPolicy"
+ createCommandClassName="ActionInputPinInCallBeActCreateCommand"
+ containers="/0/@diagram/@childNodes.11"
+ preferredSideName="WEST">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@childNodes.8/@elementType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PinDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PinDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalArrowFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PinDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fOptionalArrowFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalArrowFigure.setLineWidth(1);&#xA;&#xA;this.add(fOptionalArrowFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalArrowFigure() {&#xA;&#x9;&#x9;return fOptionalArrowFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActionInputPin"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InvocationAction/argument"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InvocationAction/argument"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.14">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5014"
+ editPartClassName="ActionInputPinInCBActLabelEditPart"
+ itemSemanticEditPolicyClassName="ActionInputPinInCBActLabelItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActionInputPinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.5"/>
+ </labels>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5027"
+ editPartClassName="ActionInputPinInCBActValueEditPart"
+ itemSemanticEditPolicyClassName="ActionInputPinInCBActValueItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActionInputPinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.6"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildSideAffixedNode"
+ visualID="3019"
+ editPartClassName="InputPinInCallBeActEditPart"
+ itemSemanticEditPolicyClassName="InputPinInCallBeActItemSemanticEditPolicy"
+ notationViewFactoryClassName="InputPinViewFactory"
+ canonicalEditPolicyClassName="InputPinInCallBeActCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="InputPinInCallBeActGraphicalNodeEditPolicy"
+ createCommandClassName="InputPinInCallBeActCreateCommand"
+ containers="/0/@diagram/@childNodes.11"
+ preferredSideName="WEST">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@childNodes.9/@elementType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PinDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PinDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalArrowFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PinDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fOptionalArrowFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalArrowFigure.setLineWidth(1);&#xA;&#xA;this.add(fOptionalArrowFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalArrowFigure() {&#xA;&#x9;&#x9;return fOptionalArrowFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InputPin"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InvocationAction/argument"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InvocationAction/argument"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.15">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5015"
+ editPartClassName="InputPinInCBActLabelEditPart"
+ itemSemanticEditPolicyClassName="InputPinInCBActLabelItemSemanticEditPolicy"
+ notationViewFactoryClassName="InputPinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.5"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildSideAffixedNode"
+ visualID="3020"
+ editPartClassName="OutputPinInCallBeActEditPart"
+ itemSemanticEditPolicyClassName="OutputPinInCallBeActItemSemanticEditPolicy"
+ notationViewFactoryClassName="OutputPinViewFactory"
+ canonicalEditPolicyClassName="OutputPinInCallBeActCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="OutputPinInCallBeActGraphicalNodeEditPolicy"
+ createCommandClassName="OutputPinInCallBeActCreateCommand"
+ containers="/0/@diagram/@childNodes.11"
+ preferredSideName="EAST">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@childNodes.10/@elementType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PinDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PinDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalArrowFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PinDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fOptionalArrowFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalArrowFigure.setLineWidth(1);&#xA;&#xA;this.add(fOptionalArrowFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalArrowFigure() {&#xA;&#x9;&#x9;return fOptionalArrowFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OutputPin"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallAction/result"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallAction/result"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.16">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5016"
+ editPartClassName="OutputPinInCBActLabelEditPart"
+ itemSemanticEditPolicyClassName="OutputPinInCBActLabelItemSemanticEditPolicy"
+ notationViewFactoryClassName="OutputPinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.5"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ visualID="3010"
+ editPartClassName="CallOperationActionEditPart"
+ itemSemanticEditPolicyClassName="CallOperationActionItemSemanticEditPolicy"
+ notationViewFactoryClassName="CallOperationActionViewFactory"
+ canonicalEditPolicyClassName="CallOperationActionCanonicalEditPolicy"
+ childNodes="/0/@diagram/@childNodes.17 /0/@diagram/@childNodes.18 /0/@diagram/@childNodes.19 /0/@diagram/@childNodes.20 /0/@diagram/@childNodes.21 /0/@diagram/@childNodes.22 /0/@diagram/@childNodes.23"
+ graphicalNodeEditPolicyClassName="CallOperationActionGraphicalNodeEditPolicy"
+ createCommandClassName="CallOperationActionCreateCommand"
+ containers="/0/@diagram/@compartments.3">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="CallOperationActionEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="ActionFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class ActionFigure extends org.eclipse.draw2d.RoundedRectangle {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel fActionLabel; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalRakeFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public ActionFigure() {&#xA;&#x9;&#x9;&#xA;&#x9;org.eclipse.papyrus.diagram.common.draw2d.CenterLayout layoutThis = new org.eclipse.papyrus.diagram.common.draw2d.CenterLayout();&#xA;&#xA;&#xA;&#x9;this.setLayoutManager(layoutThis);&#xA;&#xA;&#x9;&#x9;this.setCornerDimensions(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;this.setLineWidth(1);&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fActionLabel = new org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel();&#xA;&#xA;&#xA;&#xA;this.add(fActionLabel);&#xA;&#xA;&#xA;&#xA;fOptionalRakeFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalRakeFigure.setFill(false);&#xA;fOptionalRakeFigure.setLineWidth(2);&#xA;&#xA;this.add(fOptionalRakeFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel getActionLabel() {&#xA;&#x9;&#x9;return fActionLabel;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalRakeFigure() {&#xA;&#x9;&#x9;return fOptionalRakeFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
+ key="RequestConstants.REQ_CREATE"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallOperationAction"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/node"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.17">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ visualID="5006"
+ editPartClassName="CallOperationActionNameEditPart"
+ itemSemanticEditPolicyClassName="CallOperationActionNameItemSemanticEditPolicy"
+ notationViewFactoryClassName="CallOperationActionNameViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getActionLabel"
+ figureQualifiedClassName="org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.3"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildSideAffixedNode"
+ visualID="3021"
+ editPartClassName="ActionInputPinInCallOpActEditPart"
+ itemSemanticEditPolicyClassName="ActionInputPinInCallOpActItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActionInputPinViewFactory"
+ canonicalEditPolicyClassName="ActionInputPinInCallOpActCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ActionInputPinInCallOpActGraphicalNodeEditPolicy"
+ createCommandClassName="ActionInputPinInCallOpActCreateCommand"
+ containers="/0/@diagram/@childNodes.16"
+ preferredSideName="WEST">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@childNodes.8/@elementType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PinDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PinDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalArrowFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PinDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fOptionalArrowFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalArrowFigure.setLineWidth(1);&#xA;&#xA;this.add(fOptionalArrowFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalArrowFigure() {&#xA;&#x9;&#x9;return fOptionalArrowFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActionInputPin"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InvocationAction/argument"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InvocationAction/argument"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.18">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5017"
+ editPartClassName="ActionInputPinInCOActLabelEditPart"
+ itemSemanticEditPolicyClassName="ActionInputPinInCOActLabelItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActionInputPinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.5"/>
+ </labels>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5028"
+ editPartClassName="ActionInputPinInCOActValueEditPart"
+ itemSemanticEditPolicyClassName="ActionInputPinInCOActValueItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActionInputPinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.6"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildSideAffixedNode"
+ visualID="3022"
+ editPartClassName="ValuePinInCallOpActEditPart"
+ itemSemanticEditPolicyClassName="ValuePinInCallOpActItemSemanticEditPolicy"
+ notationViewFactoryClassName="ValuePinViewFactory"
+ canonicalEditPolicyClassName="ValuePinInCallOpActCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ValuePinInCallOpActGraphicalNodeEditPolicy"
+ createCommandClassName="ValuePinInCallOpActCreateCommand"
+ containers="/0/@diagram/@childNodes.16"
+ preferredSideName="WEST">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@childNodes.7/@elementType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PinDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PinDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalArrowFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PinDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fOptionalArrowFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalArrowFigure.setLineWidth(1);&#xA;&#xA;this.add(fOptionalArrowFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalArrowFigure() {&#xA;&#x9;&#x9;return fOptionalArrowFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ValuePin"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InvocationAction/argument"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InvocationAction/argument"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.19">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5018"
+ editPartClassName="ValuePinInCOActLabelEditPart"
+ itemSemanticEditPolicyClassName="ValuePinInCOActLabelItemSemanticEditPolicy"
+ notationViewFactoryClassName="ValuePinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.5"/>
+ </labels>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5029"
+ editPartClassName="ValuePinInCOActValueEditPart"
+ itemSemanticEditPolicyClassName="ValuePinInCOActValueItemSemanticEditPolicy"
+ notationViewFactoryClassName="ValuePinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.6"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildSideAffixedNode"
+ visualID="3023"
+ editPartClassName="InputPinInCallOpActEditPart"
+ itemSemanticEditPolicyClassName="InputPinInCallOpActItemSemanticEditPolicy"
+ notationViewFactoryClassName="InputPinViewFactory"
+ canonicalEditPolicyClassName="InputPinInCallOpActCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="InputPinInCallOpActGraphicalNodeEditPolicy"
+ createCommandClassName="InputPinInCallOpActCreateCommand"
+ containers="/0/@diagram/@childNodes.16"
+ preferredSideName="WEST">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@childNodes.9/@elementType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PinDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PinDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalArrowFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PinDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fOptionalArrowFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalArrowFigure.setLineWidth(1);&#xA;&#xA;this.add(fOptionalArrowFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalArrowFigure() {&#xA;&#x9;&#x9;return fOptionalArrowFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InputPin"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InvocationAction/argument"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InvocationAction/argument"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.20">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5019"
+ editPartClassName="InputPinInCOActLabelEditPart"
+ itemSemanticEditPolicyClassName="InputPinInCOActLabelItemSemanticEditPolicy"
+ notationViewFactoryClassName="InputPinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.5"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildSideAffixedNode"
+ visualID="3024"
+ editPartClassName="OutputPinInCallOpActEditPart"
+ itemSemanticEditPolicyClassName="OutputPinInCallOpActItemSemanticEditPolicy"
+ notationViewFactoryClassName="OutputPinViewFactory"
+ canonicalEditPolicyClassName="OutputPinInCallOpActCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="OutputPinInCallOpActGraphicalNodeEditPolicy"
+ createCommandClassName="OutputPinInCallOpActCreateCommand"
+ containers="/0/@diagram/@childNodes.16"
+ preferredSideName="EAST">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@childNodes.10/@elementType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PinDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PinDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalArrowFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PinDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fOptionalArrowFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalArrowFigure.setLineWidth(1);&#xA;&#xA;this.add(fOptionalArrowFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalArrowFigure() {&#xA;&#x9;&#x9;return fOptionalArrowFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OutputPin"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallAction/result"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallAction/result"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.21">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5020"
+ editPartClassName="OutputPinInCOActLabelEditPart"
+ itemSemanticEditPolicyClassName="OutputPinInCOActLabelItemSemanticEditPolicy"
+ notationViewFactoryClassName="OutputPinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.5"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildSideAffixedNode"
+ visualID="3025"
+ editPartClassName="ValuePinInCallOpActAsTargetEditPart"
+ itemSemanticEditPolicyClassName="ValuePinInCallOpActAsTargetItemSemanticEditPolicy"
+ notationViewFactoryClassName="ValuePinViewFactory"
+ canonicalEditPolicyClassName="ValuePinInCallOpActAsTargetCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ValuePinInCallOpActAsTargetGraphicalNodeEditPolicy"
+ createCommandClassName="ValuePinInCallOpActAsTargetCreateCommand"
+ containers="/0/@diagram/@childNodes.16"
+ preferredSideName="NORTH">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@childNodes.7/@elementType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PinDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PinDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalArrowFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PinDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fOptionalArrowFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalArrowFigure.setLineWidth(1);&#xA;&#xA;this.add(fOptionalArrowFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalArrowFigure() {&#xA;&#x9;&#x9;return fOptionalArrowFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ValuePin"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallOperationAction/target"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallOperationAction/target"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.22">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5021"
+ editPartClassName="ValuePinInCOActAsTargetLabelEditPart"
+ itemSemanticEditPolicyClassName="ValuePinInCOActAsTargetLabelItemSemanticEditPolicy"
+ notationViewFactoryClassName="ValuePinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.5"/>
+ </labels>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5030"
+ editPartClassName="ValuePinInCOActAsTargetValueEditPart"
+ itemSemanticEditPolicyClassName="ValuePinInCOActAsTargetValueItemSemanticEditPolicy"
+ notationViewFactoryClassName="ValuePinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.6"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildSideAffixedNode"
+ visualID="3026"
+ editPartClassName="ActionInputPinInCallOpActAsTargetEditPart"
+ itemSemanticEditPolicyClassName="ActionInputPinInCallOpActAsTargetItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActionInputPinViewFactory"
+ canonicalEditPolicyClassName="ActionInputPinInCallOpActAsTargetCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ActionInputPinInCallOpActAsTargetGraphicalNodeEditPolicy"
+ createCommandClassName="ActionInputPinInCallOpActAsTargetCreateCommand"
+ containers="/0/@diagram/@childNodes.16"
+ preferredSideName="NORTH">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@childNodes.8/@elementType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PinDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PinDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalArrowFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PinDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fOptionalArrowFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalArrowFigure.setLineWidth(1);&#xA;&#xA;this.add(fOptionalArrowFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalArrowFigure() {&#xA;&#x9;&#x9;return fOptionalArrowFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActionInputPin"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallOperationAction/target"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallOperationAction/target"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.23">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5022"
+ editPartClassName="ActionInputPinInCOActAsTargetLabelEditPart"
+ itemSemanticEditPolicyClassName="ActionInputPinInCOActAsTargetLabelItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActionInputPinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.5"/>
+ </labels>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5031"
+ editPartClassName="ActionInputPinInCOActAsTargetValueEditPart"
+ itemSemanticEditPolicyClassName="ActionInputPinInCOActAsTargetValueItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActionInputPinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.6"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildSideAffixedNode"
+ visualID="3027"
+ editPartClassName="InputPinInCallOpActAsTargetEditPart"
+ itemSemanticEditPolicyClassName="InputPinInCallOpActAsTargetItemSemanticEditPolicy"
+ notationViewFactoryClassName="InputPinViewFactory"
+ canonicalEditPolicyClassName="InputPinInCallOpActAsTargetCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="InputPinInCallOpActAsTargetGraphicalNodeEditPolicy"
+ createCommandClassName="InputPinInCallOpActAsTargetCreateCommand"
+ containers="/0/@diagram/@childNodes.16"
+ preferredSideName="NORTH">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@childNodes.9/@elementType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PinDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PinDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.Polyline fOptionalArrowFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PinDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)&#xA;, getMapMode().DPtoLP(16)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fOptionalArrowFigure = new org.eclipse.draw2d.Polyline();&#xA;fOptionalArrowFigure.setLineWidth(1);&#xA;&#xA;this.add(fOptionalArrowFigure);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = true;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.Polyline getOptionalArrowFigure() {&#xA;&#x9;&#x9;return fOptionalArrowFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="16"
+ height="16"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InputPin"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallOperationAction/target"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallOperationAction/target"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.24">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ xsi:type="gmfgen:GenExternalNodeLabel"
+ visualID="5023"
+ editPartClassName="InputPinInCOActAsTargetLabelEditPart"
+ itemSemanticEditPolicyClassName="InputPinInCOActAsTargetLabelItemSemanticEditPolicy"
+ notationViewFactoryClassName="InputPinLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.5"/>
+ </labels>
+ </childNodes>
+ <childNodes
+ visualID="3011"
+ editPartClassName="ConstraintAsLocalPrecondEditPart"
+ itemSemanticEditPolicyClassName="ConstraintAsLocalPrecondItemSemanticEditPolicy"
+ notationViewFactoryClassName="ConstraintViewFactory"
+ canonicalEditPolicyClassName="ConstraintAsLocalPrecondCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ConstraintAsLocalPrecondGraphicalNodeEditPolicy"
+ createCommandClassName="ConstraintAsLocalPrecondCreateCommand"
+ containers="/0/@diagram/@compartments.3">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@childNodes.1/@elementType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CornerBentWithTextFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CornerBentWithTextFigure extends org.eclipse.papyrus.diagram.common.figure.node.CornerBentFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.papyrus.diagram.activity.figures.WrappedLabel fCornerBentContent; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CornerBentWithTextFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;&#xA;&#xA;&#x9;this.setBackgroundColor(THIS_BACK&#xA;);&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fCornerBentContent = new org.eclipse.papyrus.diagram.activity.figures.WrappedLabel();&#xA;&#xA;&#xA;&#xA;this.add(fCornerBentContent);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.papyrus.diagram.activity.figures.WrappedLabel getCornerBentContent() {&#xA;&#x9;&#x9;return fCornerBentContent;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;/**&#xA; * @generated&#xA; */&#xA;static final org.eclipse.swt.graphics.Color THIS_BACK = new org.eclipse.swt.graphics.Color(null, 248, 249, 214);&#xA;&#xA;">
<attributes
xsi:type="gmfgen:StyleAttributes"
- fixedFont="true"/>
+ fixedBackground="true"/>
</viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
<modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="//@labelParsers/@implementations.0"
- viewPattern=""
- editorPattern=""
- editPattern="">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ modelElementSelector="/0/@expressionProviders/@providers.1/@expressions.0">
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Action/localPrecondition"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Action/localPrecondition"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.25">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
</modelFacet>
- </labels>
- <labels
- visualID="5002"
- editPartClassName="ActivityIsSingleExecutionEditPart"
- itemSemanticEditPolicyClassName="ActivityIsSingleExecutionItemSemanticEditPolicy"
- notationViewFactoryClassName="ActivityIsSingleExecutionViewFactory"
- readOnly="true">
+ <labels
+ visualID="5007"
+ editPartClassName="ConstraintAsLocalPrecondNameEditPart"
+ itemSemanticEditPolicyClassName="ConstraintAsLocalPrecondNameItemSemanticEditPolicy"
+ notationViewFactoryClassName="ConstraintNameViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getCornerBentContent"
+ figureQualifiedClassName="org.eclipse.papyrus.diagram.activity.figures.WrappedLabel"/>
+ <modelFacet
+ xsi:type="gmfgen:FeatureLabelModelFacet"
+ parser="/0/@labelParsers/@implementations.0"
+ viewPattern="&lt;&lt;localPrecondition>>\n{0}"
+ editorPattern="{0}"
+ editPattern="{0}">
+ <metaFeatures
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </modelFacet>
+ </labels>
+ </childNodes>
+ <childNodes
+ visualID="3012"
+ editPartClassName="ConstraintAsLocalPostcondEditPart"
+ itemSemanticEditPolicyClassName="ConstraintAsLocalPostcondItemSemanticEditPolicy"
+ notationViewFactoryClassName="ConstraintViewFactory"
+ canonicalEditPolicyClassName="ConstraintAsLocalPostcondCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ConstraintAsLocalPostcondGraphicalNodeEditPolicy"
+ createCommandClassName="ConstraintAsLocalPostcondCreateCommand"
+ containers="/0/@diagram/@compartments.3">
<diagramRunTimeClass
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@childNodes.1/@elementType"/>
<viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getHeaderSingleExecution"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/>
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CornerBentWithTextFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CornerBentWithTextFigure extends org.eclipse.papyrus.diagram.common.figure.node.CornerBentFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.papyrus.diagram.activity.figures.WrappedLabel fCornerBentContent; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CornerBentWithTextFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;&#xA;&#xA;&#x9;this.setBackgroundColor(THIS_BACK&#xA;);&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fCornerBentContent = new org.eclipse.papyrus.diagram.activity.figures.WrappedLabel();&#xA;&#xA;&#xA;&#xA;this.add(fCornerBentContent);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.papyrus.diagram.activity.figures.WrappedLabel getCornerBentContent() {&#xA;&#x9;&#x9;return fCornerBentContent;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;/**&#xA; * @generated&#xA; */&#xA;static final org.eclipse.swt.graphics.Color THIS_BACK = new org.eclipse.swt.graphics.Color(null, 248, 249, 214);&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:StyleAttributes"
+ fixedBackground="true"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
<modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="//@labelParsers/@implementations.1">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/isSingleExecution"/>
- </modelFacet>
- </labels>
- </topLevelNodes>
- <compartments
- visualID="7001"
- editPartClassName="ActivityActivityParametersCompartmentEditPart"
- itemSemanticEditPolicyClassName="ActivityActivityParametersCompartmentItemSemanticEditPolicy"
- notationViewFactoryClassName="ActivityActivityParametersCompartmentViewFactory"
- canonicalEditPolicyClassName="ActivityActivityParametersCompartmentCanonicalEditPolicy"
- childNodes="//@diagram/@childNodes.0"
- title="ActivityParametersCompartment"
- canCollapse="false"
- needsTitle="false"
- node="//@diagram/@topLevelNodes.0">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getActivityParametersCompartment"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- </compartments>
- <compartments
- visualID="7002"
- editPartClassName="ActivityActivityPreConditionsCompartmentEditPart"
- itemSemanticEditPolicyClassName="ActivityActivityPreConditionsCompartmentItemSemanticEditPolicy"
- notationViewFactoryClassName="ActivityActivityPreConditionsCompartmentViewFactory"
- canonicalEditPolicyClassName="ActivityActivityPreConditionsCompartmentCanonicalEditPolicy"
- childNodes="//@diagram/@childNodes.1"
- title="ActivityPreConditionsCompartment"
- canCollapse="false"
- needsTitle="false"
- node="//@diagram/@topLevelNodes.0">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getActivityPreconditionsCompartment"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- </compartments>
- <compartments
- visualID="7003"
- editPartClassName="ActivityActivityPostConditionsCompartmentEditPart"
- itemSemanticEditPolicyClassName="ActivityActivityPostConditionsCompartmentItemSemanticEditPolicy"
- notationViewFactoryClassName="ActivityActivityPostConditionsCompartmentViewFactory"
- canonicalEditPolicyClassName="ActivityActivityPostConditionsCompartmentCanonicalEditPolicy"
- childNodes="//@diagram/@childNodes.2"
- title="ActivityPostConditionsCompartment"
- canCollapse="false"
- needsTitle="false"
- node="//@diagram/@topLevelNodes.0">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getActivityPostconditionsCompartment"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- </compartments>
- <compartments
- visualID="7004"
- editPartClassName="ActivityActivityContentCompartmentEditPart"
- itemSemanticEditPolicyClassName="ActivityActivityContentCompartmentItemSemanticEditPolicy"
- notationViewFactoryClassName="ActivityActivityContentCompartmentViewFactory"
- canonicalEditPolicyClassName="ActivityActivityContentCompartmentCanonicalEditPolicy"
- childNodes="//@diagram/@childNodes.3 //@diagram/@childNodes.4 //@diagram/@childNodes.5"
- title="ActivityContentCompartment"
- canCollapse="false"
- needsTitle="false"
- node="//@diagram/@topLevelNodes.0"
- listLayout="false">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCompartmentFigure"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="EditPolicyRoles.DRAG_DROP_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.activity.edit.policies.CustomDiagramDragDropEditPolicy"/>
- </compartments>
- <palette>
- <groups
- title="Objects">
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Initial node"
- description="Create an Initial node"
- genNodes="//@diagram/@childNodes.3"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Activity final"
- description="Create an Activity final node"
- genNodes="//@diagram/@childNodes.4"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Flow final"
- description="Create a Flow final node"
- genNodes="//@diagram/@childNodes.5"/>
- </groups>
- </palette>
- <preferencePages
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.general"
- name="UML Diagram">
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.appearance"
- name="Appearance"
- kind="Appearance"/>
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.connections"
- name="Connections"
- kind="Connections"/>
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.printing"
- name="Printing"
- kind="Printing"/>
- <children
+ modelElementSelector="/0/@expressionProviders/@providers.1/@expressions.1">
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Action/localPostcondition"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Action/localPostcondition"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.26">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ visualID="5008"
+ editPartClassName="ConstraintAsLocalPostcondNameEditPart"
+ itemSemanticEditPolicyClassName="ConstraintAsLocalPostcondNameItemSemanticEditPolicy"
+ notationViewFactoryClassName="ConstraintNameViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getCornerBentContent"
+ figureQualifiedClassName="org.eclipse.papyrus.diagram.activity.figures.WrappedLabel"/>
+ <modelFacet
+ xsi:type="gmfgen:FeatureLabelModelFacet"
+ parser="/0/@labelParsers/@implementations.0"
+ viewPattern="&lt;&lt;localPostcondition>>\n{0}"
+ editorPattern="{0}"
+ editPattern="{0}">
+ <metaFeatures
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </modelFacet>
+ </labels>
+ </childNodes>
+ <childNodes
+ visualID="3028"
+ editPartClassName="ActivityAsSelectionEditPart"
+ itemSemanticEditPolicyClassName="ActivityAsSelectionItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActivityViewFactory"
+ canonicalEditPolicyClassName="ActivityAsSelectionCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ActivityAsSelectionGraphicalNodeEditPolicy"
+ createCommandClassName="ActivityAsSelectionCreateCommand"
+ containers="/0/@diagram/@compartments.3">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@topLevelNodes.0/@elementType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CornerBentWithTextFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CornerBentWithTextFigure extends org.eclipse.papyrus.diagram.common.figure.node.CornerBentFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.papyrus.diagram.activity.figures.WrappedLabel fCornerBentContent; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CornerBentWithTextFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;&#xA;&#xA;&#x9;this.setBackgroundColor(THIS_BACK&#xA;);&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fCornerBentContent = new org.eclipse.papyrus.diagram.activity.figures.WrappedLabel();&#xA;&#xA;&#xA;&#xA;this.add(fCornerBentContent);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.papyrus.diagram.activity.figures.WrappedLabel getCornerBentContent() {&#xA;&#x9;&#x9;return fCornerBentContent;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;/**&#xA; * @generated&#xA; */&#xA;static final org.eclipse.swt.graphics.Color THIS_BACK = new org.eclipse.swt.graphics.Color(null, 248, 249, 214);&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:StyleAttributes"
+ fixedBackground="true"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ObjectFlow/selection"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.27">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ visualID="5032"
+ editPartClassName="ActivityAsSelectionNameEditPart"
+ itemSemanticEditPolicyClassName="ActivityAsSelectionNameItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActivityNameViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getCornerBentContent"
+ figureQualifiedClassName="org.eclipse.papyrus.diagram.activity.figures.WrappedLabel"/>
+ <modelFacet
+ xsi:type="gmfgen:FeatureLabelModelFacet"
+ parser="/0/@labelParsers/@implementations.0"
+ viewPattern="&lt;&lt;selection>>\n{0}"
+ editorPattern="{0}"
+ editPattern="{0}">
+ <metaFeatures
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </modelFacet>
+ </labels>
+ </childNodes>
+ <childNodes
+ visualID="3029"
+ editPartClassName="ActivityAsTransformationEditPart"
+ itemSemanticEditPolicyClassName="ActivityAsTransformationItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActivityViewFactory"
+ canonicalEditPolicyClassName="ActivityAsTransformationCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="ActivityAsTransformationGraphicalNodeEditPolicy"
+ createCommandClassName="ActivityAsTransformationCreateCommand"
+ containers="/0/@diagram/@compartments.3">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"
+ metamodelType="/0/@diagram/@topLevelNodes.0/@elementType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CornerBentWithTextFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CornerBentWithTextFigure extends org.eclipse.papyrus.diagram.common.figure.node.CornerBentFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.papyrus.diagram.activity.figures.WrappedLabel fCornerBentContent; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CornerBentWithTextFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;&#xA;&#xA;&#x9;this.setBackgroundColor(THIS_BACK&#xA;);&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fCornerBentContent = new org.eclipse.papyrus.diagram.activity.figures.WrappedLabel();&#xA;&#xA;&#xA;&#xA;this.add(fCornerBentContent);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.papyrus.diagram.activity.figures.WrappedLabel getCornerBentContent() {&#xA;&#x9;&#x9;return fCornerBentContent;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;/**&#xA; * @generated&#xA; */&#xA;static final org.eclipse.swt.graphics.Color THIS_BACK = new org.eclipse.swt.graphics.Color(null, 248, 249, 214);&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:StyleAttributes"
+ fixedBackground="true"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:OpenDiagramBehaviour"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ObjectFlow/transformation"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.28">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ visualID="5033"
+ editPartClassName="ActivityAsTransformationNameEditPart"
+ itemSemanticEditPolicyClassName="ActivityAsTransformationNameItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActivityNameViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getCornerBentContent"
+ figureQualifiedClassName="org.eclipse.papyrus.diagram.activity.figures.WrappedLabel"/>
+ <modelFacet
+ xsi:type="gmfgen:FeatureLabelModelFacet"
+ parser="/0/@labelParsers/@implementations.0"
+ viewPattern="&lt;&lt;transformation>>\n{0}"
+ editorPattern="{0}"
+ editPattern="{0}">
+ <metaFeatures
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </modelFacet>
+ </labels>
+ </childNodes>
+ <topLevelNodes
+ visualID="2001"
+ editPartClassName="ActivityEditPart"
+ itemSemanticEditPolicyClassName="ActivityItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActivityViewFactory"
+ canonicalEditPolicyClassName="Activity2CanonicalEditPolicy"
+ compartments="/0/@diagram/@compartments.0 /0/@diagram/@compartments.1 /0/@diagram/@compartments.2 /0/@diagram/@compartments.3"
+ graphicalNodeEditPolicyClassName="ActivityGraphicalNodeEditPolicy"
+ createCommandClassName="ActivityCreateCommand">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="ActivityEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CustomActivityRectangleFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CustomActivityRectangleFigure extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fHeaderLabel; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.RectangleFigure fActivityParametersCompartment; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.RectangleFigure fActivityPreconditionsCompartment; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.RectangleFigure fActivityPostconditionsCompartment; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fHeaderSingleExecution; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.RectangleFigure fCompartmentFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CustomActivityRectangleFigure() {&#xA;&#x9;&#x9;&#xA;&#x9;org.eclipse.draw2d.BorderLayout layoutThis = new org.eclipse.draw2d.BorderLayout();&#xA;&#x9;layoutThis.setHorizontalSpacing(0);// TODO mapMode?&#xA;&#x9;layoutThis.setVerticalSpacing(0);&#xA;&#x9;this.setLayoutManager(layoutThis);&#xA;&#xA;&#x9;&#x9;this.setFill(false);&#xA;this.setOutline(false);&#xA;this.setLineWidth(0);&#xA;this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(857)&#xA;, getMapMode().DPtoLP(757)&#xA;));&#xA;this.setBorder(new org.eclipse.draw2d.MarginBorder(getMapMode().DPtoLP(30)&#xA;, getMapMode().DPtoLP(30)&#xA;, getMapMode().DPtoLP(30)&#xA;, getMapMode().DPtoLP(30)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;org.eclipse.draw2d.RoundedRectangle activityBorderFigure0 = new org.eclipse.draw2d.RoundedRectangle();&#xA;activityBorderFigure0.setCornerDimensions(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(8)&#xA;, getMapMode().DPtoLP(8)&#xA;));&#xA;activityBorderFigure0.setLineWidth(1);&#xA;&#xA;this.add(activityBorderFigure0, org.eclipse.draw2d.BorderLayout.CENTER);&#xA;&#xA;&#x9;org.eclipse.draw2d.GridLayout layoutActivityBorderFigure0 = new org.eclipse.draw2d.GridLayout();&#xA;&#x9;layoutActivityBorderFigure0.numColumns = 3;&#xA;&#x9;layoutActivityBorderFigure0.makeColumnsEqualWidth = false;&#xA;&#x9;layoutActivityBorderFigure0.horizontalSpacing = 0;&#xA;&#x9;layoutActivityBorderFigure0.verticalSpacing = 0;&#xA;&#x9;layoutActivityBorderFigure0.marginWidth = 0;&#xA;&#x9;layoutActivityBorderFigure0.marginHeight = 0;&#xA;&#x9;activityBorderFigure0.setLayoutManager(layoutActivityBorderFigure0);&#xA;&#xA;&#xA;&#xA;org.eclipse.draw2d.RectangleFigure labelAndParameter1 = new org.eclipse.draw2d.RectangleFigure();&#xA;labelAndParameter1.setFill(false);&#xA;labelAndParameter1.setOutline(false);&#xA;labelAndParameter1.setLineWidth(0);&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintLabelAndParameter1 = new org.eclipse.draw2d.GridData();&#xA;constraintLabelAndParameter1.verticalAlignment = org.eclipse.draw2d.GridData.CENTER;&#xA;constraintLabelAndParameter1.horizontalAlignment = org.eclipse.draw2d.GridData.BEGINNING;&#xA;constraintLabelAndParameter1.horizontalIndent = 0;&#xA;constraintLabelAndParameter1.horizontalSpan = 1;&#xA;constraintLabelAndParameter1.verticalSpan = 1;&#xA;constraintLabelAndParameter1.grabExcessHorizontalSpace = true;&#xA;constraintLabelAndParameter1.grabExcessVerticalSpace = false;&#xA;activityBorderFigure0.add(labelAndParameter1, constraintLabelAndParameter1);&#xA;&#xA;&#xA;&#x9;org.eclipse.draw2d.GridLayout layoutLabelAndParameter1 = new org.eclipse.draw2d.GridLayout();&#xA;&#x9;layoutLabelAndParameter1.numColumns = 1;&#xA;&#x9;layoutLabelAndParameter1.makeColumnsEqualWidth = true;&#xA;&#x9;labelAndParameter1.setLayoutManager(layoutLabelAndParameter1);&#xA;&#xA;&#xA;&#xA;fHeaderLabel = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();&#xA;fHeaderLabel.setText(&quot;ActivityName&quot;);&#xA;&#xA;fHeaderLabel.setFont(FHEADERLABEL_FONT);&#xA;&#xA;&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintFHeaderLabel = new org.eclipse.draw2d.GridData();&#xA;constraintFHeaderLabel.verticalAlignment = org.eclipse.draw2d.GridData.CENTER;&#xA;constraintFHeaderLabel.horizontalAlignment = org.eclipse.draw2d.GridData.BEGINNING;&#xA;constraintFHeaderLabel.horizontalIndent = 4;&#xA;constraintFHeaderLabel.horizontalSpan = 1;&#xA;constraintFHeaderLabel.verticalSpan = 1;&#xA;constraintFHeaderLabel.grabExcessHorizontalSpace = true;&#xA;constraintFHeaderLabel.grabExcessVerticalSpace = false;&#xA;labelAndParameter1.add(fHeaderLabel, constraintFHeaderLabel);&#xA;&#xA;&#xA;&#xA;&#xA;fActivityParametersCompartment = new org.eclipse.draw2d.RectangleFigure();&#xA;fActivityParametersCompartment.setFill(false);&#xA;fActivityParametersCompartment.setOutline(false);&#xA;fActivityParametersCompartment.setLineWidth(0);&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintFActivityParametersCompartment = new org.eclipse.draw2d.GridData();&#xA;constraintFActivityParametersCompartment.verticalAlignment = org.eclipse.draw2d.GridData.CENTER;&#xA;constraintFActivityParametersCompartment.horizontalAlignment = org.eclipse.draw2d.GridData.BEGINNING;&#xA;constraintFActivityParametersCompartment.horizontalIndent = 0;&#xA;constraintFActivityParametersCompartment.horizontalSpan = 1;&#xA;constraintFActivityParametersCompartment.verticalSpan = 1;&#xA;constraintFActivityParametersCompartment.grabExcessHorizontalSpace = true;&#xA;constraintFActivityParametersCompartment.grabExcessVerticalSpace = false;&#xA;labelAndParameter1.add(fActivityParametersCompartment, constraintFActivityParametersCompartment);&#xA;&#xA;fActivityParametersCompartment.setLayoutManager(new org.eclipse.draw2d.StackLayout());&#xA;&#xA;&#xA;&#xA;&#xA;org.eclipse.draw2d.RectangleFigure prePostContions1 = new org.eclipse.draw2d.RectangleFigure();&#xA;prePostContions1.setFill(false);&#xA;prePostContions1.setOutline(false);&#xA;prePostContions1.setLineWidth(0);&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintPrePostContions1 = new org.eclipse.draw2d.GridData();&#xA;constraintPrePostContions1.verticalAlignment = org.eclipse.draw2d.GridData.CENTER;&#xA;constraintPrePostContions1.horizontalAlignment = org.eclipse.draw2d.GridData.BEGINNING;&#xA;constraintPrePostContions1.horizontalIndent = 0;&#xA;constraintPrePostContions1.horizontalSpan = 1;&#xA;constraintPrePostContions1.verticalSpan = 1;&#xA;constraintPrePostContions1.grabExcessHorizontalSpace = true;&#xA;constraintPrePostContions1.grabExcessVerticalSpace = false;&#xA;activityBorderFigure0.add(prePostContions1, constraintPrePostContions1);&#xA;&#xA;&#xA;&#x9;org.eclipse.draw2d.GridLayout layoutPrePostContions1 = new org.eclipse.draw2d.GridLayout();&#xA;&#x9;layoutPrePostContions1.numColumns = 1;&#xA;&#x9;layoutPrePostContions1.makeColumnsEqualWidth = true;&#xA;&#x9;prePostContions1.setLayoutManager(layoutPrePostContions1);&#xA;&#xA;&#xA;&#xA;fActivityPreconditionsCompartment = new org.eclipse.draw2d.RectangleFigure();&#xA;fActivityPreconditionsCompartment.setFill(false);&#xA;fActivityPreconditionsCompartment.setOutline(false);&#xA;fActivityPreconditionsCompartment.setLineWidth(0);&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintFActivityPreconditionsCompartment = new org.eclipse.draw2d.GridData();&#xA;constraintFActivityPreconditionsCompartment.verticalAlignment = org.eclipse.draw2d.GridData.CENTER;&#xA;constraintFActivityPreconditionsCompartment.horizontalAlignment = org.eclipse.draw2d.GridData.BEGINNING;&#xA;constraintFActivityPreconditionsCompartment.horizontalIndent = 0;&#xA;constraintFActivityPreconditionsCompartment.horizontalSpan = 1;&#xA;constraintFActivityPreconditionsCompartment.verticalSpan = 1;&#xA;constraintFActivityPreconditionsCompartment.grabExcessHorizontalSpace = true;&#xA;constraintFActivityPreconditionsCompartment.grabExcessVerticalSpace = false;&#xA;prePostContions1.add(fActivityPreconditionsCompartment, constraintFActivityPreconditionsCompartment);&#xA;&#xA;fActivityPreconditionsCompartment.setLayoutManager(new org.eclipse.draw2d.StackLayout());&#xA;&#xA;&#xA;&#xA;fActivityPostconditionsCompartment = new org.eclipse.draw2d.RectangleFigure();&#xA;fActivityPostconditionsCompartment.setFill(false);&#xA;fActivityPostconditionsCompartment.setOutline(false);&#xA;fActivityPostconditionsCompartment.setLineWidth(0);&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintFActivityPostconditionsCompartment = new org.eclipse.draw2d.GridData();&#xA;constraintFActivityPostconditionsCompartment.verticalAlignment = org.eclipse.draw2d.GridData.CENTER;&#xA;constraintFActivityPostconditionsCompartment.horizontalAlignment = org.eclipse.draw2d.GridData.BEGINNING;&#xA;constraintFActivityPostconditionsCompartment.horizontalIndent = 0;&#xA;constraintFActivityPostconditionsCompartment.horizontalSpan = 1;&#xA;constraintFActivityPostconditionsCompartment.verticalSpan = 1;&#xA;constraintFActivityPostconditionsCompartment.grabExcessHorizontalSpace = true;&#xA;constraintFActivityPostconditionsCompartment.grabExcessVerticalSpace = false;&#xA;prePostContions1.add(fActivityPostconditionsCompartment, constraintFActivityPostconditionsCompartment);&#xA;&#xA;fActivityPostconditionsCompartment.setLayoutManager(new org.eclipse.draw2d.StackLayout());&#xA;&#xA;&#xA;&#xA;&#xA;fHeaderSingleExecution = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();&#xA;fHeaderSingleExecution.setText(&quot;&quot;);&#xA;fHeaderSingleExecution.setBorder(new org.eclipse.draw2d.MarginBorder(getMapMode().DPtoLP(0)&#xA;, getMapMode().DPtoLP(0)&#xA;, getMapMode().DPtoLP(0)&#xA;, getMapMode().DPtoLP(8)&#xA;));&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintFHeaderSingleExecution = new org.eclipse.draw2d.GridData();&#xA;constraintFHeaderSingleExecution.verticalAlignment = org.eclipse.draw2d.GridData.CENTER;&#xA;constraintFHeaderSingleExecution.horizontalAlignment = org.eclipse.draw2d.GridData.BEGINNING;&#xA;constraintFHeaderSingleExecution.horizontalIndent = 0;&#xA;constraintFHeaderSingleExecution.horizontalSpan = 1;&#xA;constraintFHeaderSingleExecution.verticalSpan = 2;&#xA;constraintFHeaderSingleExecution.grabExcessHorizontalSpace = false;&#xA;constraintFHeaderSingleExecution.grabExcessVerticalSpace = false;&#xA;activityBorderFigure0.add(fHeaderSingleExecution, constraintFHeaderSingleExecution);&#xA;&#xA;&#xA;&#xA;&#xA;fCompartmentFigure = new org.eclipse.draw2d.RectangleFigure();&#xA;fCompartmentFigure.setFill(false);&#xA;fCompartmentFigure.setOutline(false);&#xA;fCompartmentFigure.setLineWidth(0);&#xA;fCompartmentFigure.setBorder(new org.eclipse.draw2d.MarginBorder(getMapMode().DPtoLP(0)&#xA;, getMapMode().DPtoLP(4)&#xA;, getMapMode().DPtoLP(4)&#xA;, getMapMode().DPtoLP(4)&#xA;));&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintFCompartmentFigure = new org.eclipse.draw2d.GridData();&#xA;constraintFCompartmentFigure.verticalAlignment = org.eclipse.draw2d.GridData.FILL;&#xA;constraintFCompartmentFigure.horizontalAlignment = org.eclipse.draw2d.GridData.FILL;&#xA;constraintFCompartmentFigure.horizontalIndent = 0;&#xA;constraintFCompartmentFigure.horizontalSpan = 3;&#xA;constraintFCompartmentFigure.verticalSpan = 1;&#xA;constraintFCompartmentFigure.grabExcessHorizontalSpace = true;&#xA;constraintFCompartmentFigure.grabExcessVerticalSpace = true;&#xA;activityBorderFigure0.add(fCompartmentFigure, constraintFCompartmentFigure);&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getHeaderLabel() {&#xA;&#x9;&#x9;return fHeaderLabel;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.RectangleFigure getActivityParametersCompartment() {&#xA;&#x9;&#x9;return fActivityParametersCompartment;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.RectangleFigure getActivityPreconditionsCompartment() {&#xA;&#x9;&#x9;return fActivityPreconditionsCompartment;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.RectangleFigure getActivityPostconditionsCompartment() {&#xA;&#x9;&#x9;return fActivityPostconditionsCompartment;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getHeaderSingleExecution() {&#xA;&#x9;&#x9;return fHeaderSingleExecution;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.RectangleFigure getCompartmentFigure() {&#xA;&#x9;&#x9;return fCompartmentFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;/**&#xA; * @generated&#xA; */&#xA;static final org.eclipse.swt.graphics.Font FHEADERLABEL_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), org.eclipse.swt.widgets.Display.getDefault().getSystemFont().getFontData()[0].getName(), 8, org.eclipse.swt.SWT.BOLD);&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:DefaultSizeAttributes"
+ width="857"
+ height="757"/>
+ </viewmap>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
+ key="EditPolicy.COMPONENT_ROLE"
+ editPolicyQualifiedClassName="org.eclipse.gef.editpolicies.RootComponentEditPolicy"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
+ key="EditPolicy.LAYOUT_ROLE"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.activity.edit.policies.ResizeActivityEditPolicy"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.0">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ </modelFacet>
+ <labels
+ visualID="5001"
+ editPartClassName="ActivityNameEditPart"
+ itemSemanticEditPolicyClassName="ActivityNameItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActivityNameViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getHeaderLabel"
+ figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
+ <attributes
+ xsi:type="gmfgen:StyleAttributes"
+ fixedFont="true"/>
+ </viewmap>
+ <modelFacet
+ xsi:type="gmfgen:FeatureLabelModelFacet"
+ parser="/0/@labelParsers/@implementations.0"
+ viewPattern=""
+ editorPattern=""
+ editPattern="">
+ <metaFeatures
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </modelFacet>
+ </labels>
+ <labels
+ visualID="5002"
+ editPartClassName="ActivityIsSingleExecutionEditPart"
+ itemSemanticEditPolicyClassName="ActivityIsSingleExecutionItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActivityIsSingleExecutionViewFactory"
+ readOnly="true">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getHeaderSingleExecution"
+ figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/>
+ <modelFacet
+ xsi:type="gmfgen:FeatureLabelModelFacet"
+ parser="/0/@labelParsers/@implementations.1">
+ <metaFeatures
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/isSingleExecution"/>
+ </modelFacet>
+ </labels>
+ </topLevelNodes>
+ <links
+ visualID="4001"
+ editPartClassName="ActionLocalPreconditionEditPart"
+ itemSemanticEditPolicyClassName="ActionLocalPreconditionItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActionLocalPreconditionViewFactory"
+ createCommandClassName="ActionLocalPreconditionCreateCommand"
+ reorientCommandClassName="ActionLocalPreconditionReorientCommand">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="DashedLinkDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class DashedLinkDescriptor extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public DashedLinkDescriptor() {&#xA;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASH);&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:StyleAttributes"
+ fixedForeground="true"/>
+ </viewmap>
+ <modelFacet
+ xsi:type="gmfgen:FeatureLinkModelFacet">
+ <metaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Action/localPrecondition"/>
+ </modelFacet>
+ </links>
+ <links
+ visualID="4002"
+ editPartClassName="ActionLocalPostconditionEditPart"
+ itemSemanticEditPolicyClassName="ActionLocalPostconditionItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActionLocalPostconditionViewFactory"
+ createCommandClassName="ActionLocalPostconditionCreateCommand"
+ reorientCommandClassName="ActionLocalPostconditionReorientCommand">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="DashedLinkDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class DashedLinkDescriptor extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public DashedLinkDescriptor() {&#xA;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASH);&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:StyleAttributes"
+ fixedForeground="true"/>
+ </viewmap>
+ <modelFacet
+ xsi:type="gmfgen:FeatureLinkModelFacet">
+ <metaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Action/localPostcondition"/>
+ </modelFacet>
+ </links>
+ <links
+ visualID="4005"
+ editPartClassName="ObjectFlowSelectionEditPart"
+ itemSemanticEditPolicyClassName="ObjectFlowSelectionItemSemanticEditPolicy"
+ notationViewFactoryClassName="ObjectFlowSelectionViewFactory"
+ createCommandClassName="ObjectFlowSelectionCreateCommand"
+ reorientCommandClassName="ObjectFlowSelectionReorientCommand">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="DashedLinkDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class DashedLinkDescriptor extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public DashedLinkDescriptor() {&#xA;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASH);&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ xsi:type="gmfgen:FeatureLinkModelFacet">
+ <metaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ObjectFlow/selection"/>
+ </modelFacet>
+ </links>
+ <links
+ visualID="4006"
+ editPartClassName="ObjectFlowTransformationEditPart"
+ itemSemanticEditPolicyClassName="ObjectFlowTransformationItemSemanticEditPolicy"
+ notationViewFactoryClassName="ObjectFlowTransformationViewFactory"
+ createCommandClassName="ObjectFlowTransformationCreateCommand"
+ reorientCommandClassName="ObjectFlowTransformationReorientCommand">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="DashedLinkDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class DashedLinkDescriptor extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public DashedLinkDescriptor() {&#xA;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASH);&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ xsi:type="gmfgen:FeatureLinkModelFacet">
+ <metaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ObjectFlow/transformation"/>
+ </modelFacet>
+ </links>
+ <links
+ visualID="4003"
+ editPartClassName="ObjectFlowEditPart"
+ itemSemanticEditPolicyClassName="ObjectFlowItemSemanticEditPolicy"
+ notationViewFactoryClassName="ObjectFlowViewFactory"
+ createCommandClassName="ObjectFlowCreateCommand"
+ reorientCommandClassName="ObjectFlowReorientCommand">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="ObjectFlowEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="ActivityEdgeDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class ActivityEdgeDescriptor extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.papyrus.diagram.activity.figures.WrappedLabel fEdgeName; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.papyrus.diagram.activity.figures.WrappedLabel fEdgeWeight; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public ActivityEdgeDescriptor() {&#xA;&#x9;&#x9;this.setLineWidth(1);&#xA;&#xA;&#x9;&#x9;setTargetDecoration(createTargetDecoration());&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {&#xA;&#x9;&#x9;org.eclipse.draw2d.PolylineDecoration df = new org.eclipse.draw2d.PolylineDecoration();&#xA;df.setLineWidth(1);&#xA;org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();&#xA;pl.addPoint(getMapMode().DPtoLP(-2)&#xA;, getMapMode().DPtoLP(2)&#xA;);&#xA;pl.addPoint(getMapMode().DPtoLP(0)&#xA;, getMapMode().DPtoLP(0)&#xA;);&#xA;pl.addPoint(getMapMode().DPtoLP(-2)&#xA;, getMapMode().DPtoLP(-2)&#xA;);&#xA;df.setTemplate(pl);&#xA;df.setScale(getMapMode().DPtoLP(7)&#xA;, getMapMode().DPtoLP(3)&#xA;);&#xA;&#x9;&#x9;return df;&#xA;&#x9;}&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.papyrus.diagram.activity.figures.WrappedLabel getEdgeName() {&#xA;&#x9;&#x9;return fEdgeName;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.papyrus.diagram.activity.figures.WrappedLabel getEdgeWeight() {&#xA;&#x9;&#x9;return fEdgeWeight;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
+ key="RequestConstants.REQ_CREATE"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.activity.edit.policies.CreateObjectFlowBehaviorEditPolicy"/>
+ <modelFacet
+ xsi:type="gmfgen:TypeLinkModelFacet">
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ObjectFlow"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/edge"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/edge"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.29">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ <sourceMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActivityEdge/source"/>
+ <targetMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActivityEdge/target"/>
+ </modelFacet>
+ <labels
+ visualID="6001"
+ editPartClassName="ObjectFlowNameEditPart"
+ itemSemanticEditPolicyClassName="ObjectFlowNameItemSemanticEditPolicy"
+ notationViewFactoryClassName="ObjectFlowNameViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:LabelOffsetAttributes"
+ y="40"/>
+ </viewmap>
+ <modelFacet
+ xsi:type="gmfgen:FeatureLabelModelFacet"
+ parser="/0/@labelParsers/@implementations.0">
+ <metaFeatures
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </modelFacet>
+ </labels>
+ <labels
+ visualID="6002"
+ editPartClassName="ObjectFlowWeightEditPart"
+ itemSemanticEditPolicyClassName="ObjectFlowWeightItemSemanticEditPolicy"
+ notationViewFactoryClassName="ObjectFlowLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:LabelOffsetAttributes"
+ y="60"/>
+ </viewmap>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.7"/>
+ </labels>
+ </links>
+ <links
+ visualID="4004"
+ editPartClassName="ControlFlowEditPart"
+ itemSemanticEditPolicyClassName="ControlFlowItemSemanticEditPolicy"
+ notationViewFactoryClassName="ControlFlowViewFactory"
+ createCommandClassName="ControlFlowCreateCommand"
+ reorientCommandClassName="ControlFlowReorientCommand">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="ControlFlowEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="ActivityEdgeDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class ActivityEdgeDescriptor extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.papyrus.diagram.activity.figures.WrappedLabel fEdgeName; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.papyrus.diagram.activity.figures.WrappedLabel fEdgeWeight; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public ActivityEdgeDescriptor() {&#xA;&#x9;&#x9;this.setLineWidth(1);&#xA;&#xA;&#x9;&#x9;setTargetDecoration(createTargetDecoration());&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {&#xA;&#x9;&#x9;org.eclipse.draw2d.PolylineDecoration df = new org.eclipse.draw2d.PolylineDecoration();&#xA;df.setLineWidth(1);&#xA;org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();&#xA;pl.addPoint(getMapMode().DPtoLP(-2)&#xA;, getMapMode().DPtoLP(2)&#xA;);&#xA;pl.addPoint(getMapMode().DPtoLP(0)&#xA;, getMapMode().DPtoLP(0)&#xA;);&#xA;pl.addPoint(getMapMode().DPtoLP(-2)&#xA;, getMapMode().DPtoLP(-2)&#xA;);&#xA;df.setTemplate(pl);&#xA;df.setScale(getMapMode().DPtoLP(7)&#xA;, getMapMode().DPtoLP(3)&#xA;);&#xA;&#x9;&#x9;return df;&#xA;&#x9;}&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.papyrus.diagram.activity.figures.WrappedLabel getEdgeName() {&#xA;&#x9;&#x9;return fEdgeName;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.papyrus.diagram.activity.figures.WrappedLabel getEdgeWeight() {&#xA;&#x9;&#x9;return fEdgeWeight;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ <modelFacet
+ xsi:type="gmfgen:TypeLinkModelFacet">
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ControlFlow"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/edge"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity/edge"/>
+ <modelElementInitializer
+ xsi:type="gmfgen:GenFeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfgen:GenFeatureValueSpec"
+ value="/0/@expressionProviders/@providers.0/@expressions.30">
+ <feature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </initializers>
+ </modelElementInitializer>
+ <sourceMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActivityEdge/source"/>
+ <targetMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActivityEdge/target"/>
+ </modelFacet>
+ <labels
+ visualID="6003"
+ editPartClassName="ControlFlowNameEditPart"
+ itemSemanticEditPolicyClassName="ControlFlowNameItemSemanticEditPolicy"
+ notationViewFactoryClassName="ControlFlowNameViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:LabelOffsetAttributes"
+ y="40"/>
+ </viewmap>
+ <modelFacet
+ xsi:type="gmfgen:FeatureLabelModelFacet"
+ parser="/0/@labelParsers/@implementations.0">
+ <metaFeatures
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </modelFacet>
+ </labels>
+ <labels
+ visualID="6004"
+ editPartClassName="ControlFlowWeightEditPart"
+ itemSemanticEditPolicyClassName="ControlFlowWeightItemSemanticEditPolicy"
+ notationViewFactoryClassName="ControlFlowLabelViewFactory">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="CommonLabelFigure"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class CommonLabelFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public CommonLabelFigure() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:LabelOffsetAttributes"
+ y="60"/>
+ </viewmap>
+ <modelFacet
+ parser="/0/@labelParsers/@implementations.7"/>
+ </labels>
+ </links>
+ <compartments
+ visualID="7001"
+ editPartClassName="ActivityActivityParametersCompartmentEditPart"
+ itemSemanticEditPolicyClassName="ActivityActivityParametersCompartmentItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActivityActivityParametersCompartmentViewFactory"
+ canonicalEditPolicyClassName="ActivityActivityParametersCompartmentCanonicalEditPolicy"
+ childNodes="/0/@diagram/@childNodes.0"
+ title="ActivityParametersCompartment"
+ canCollapse="false"
+ needsTitle="false"
+ node="/0/@diagram/@topLevelNodes.0">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getActivityParametersCompartment"
+ figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
+ </compartments>
+ <compartments
+ visualID="7002"
+ editPartClassName="ActivityActivityPreConditionsCompartmentEditPart"
+ itemSemanticEditPolicyClassName="ActivityActivityPreConditionsCompartmentItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActivityActivityPreConditionsCompartmentViewFactory"
+ canonicalEditPolicyClassName="ActivityActivityPreConditionsCompartmentCanonicalEditPolicy"
+ childNodes="/0/@diagram/@childNodes.1"
+ title="ActivityPreConditionsCompartment"
+ canCollapse="false"
+ needsTitle="false"
+ node="/0/@diagram/@topLevelNodes.0">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getActivityPreconditionsCompartment"
+ figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
+ </compartments>
+ <compartments
+ visualID="7003"
+ editPartClassName="ActivityActivityPostConditionsCompartmentEditPart"
+ itemSemanticEditPolicyClassName="ActivityActivityPostConditionsCompartmentItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActivityActivityPostConditionsCompartmentViewFactory"
+ canonicalEditPolicyClassName="ActivityActivityPostConditionsCompartmentCanonicalEditPolicy"
+ childNodes="/0/@diagram/@childNodes.2"
+ title="ActivityPostConditionsCompartment"
+ canCollapse="false"
+ needsTitle="false"
+ node="/0/@diagram/@topLevelNodes.0">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getActivityPostconditionsCompartment"
+ figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
+ </compartments>
+ <compartments
+ visualID="7004"
+ editPartClassName="ActivityActivityContentCompartmentEditPart"
+ itemSemanticEditPolicyClassName="ActivityActivityContentCompartmentItemSemanticEditPolicy"
+ notationViewFactoryClassName="ActivityActivityContentCompartmentViewFactory"
+ canonicalEditPolicyClassName="ActivityActivityContentCompartmentCanonicalEditPolicy"
+ childNodes="/0/@diagram/@childNodes.3 /0/@diagram/@childNodes.4 /0/@diagram/@childNodes.5 /0/@diagram/@childNodes.6 /0/@diagram/@childNodes.11 /0/@diagram/@childNodes.16 /0/@diagram/@childNodes.24 /0/@diagram/@childNodes.25 /0/@diagram/@childNodes.26 /0/@diagram/@childNodes.27"
+ title="ActivityContentCompartment"
+ canCollapse="false"
+ needsTitle="false"
+ node="/0/@diagram/@topLevelNodes.0"
+ listLayout="false">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getCompartmentFigure"
+ figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
+ key="EditPolicyRoles.DRAG_DROP_ROLE"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.diagram.activity.edit.policies.CustomDiagramDragDropEditPolicy"/>
+ </compartments>
+ <palette>
+ <groups
+ title="Objects"
+ largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Initial node"
+ description="Create an Initial node"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InitialNode.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InitialNode.gif"
+ genNodes="/0/@diagram/@childNodes.3"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Activity final"
+ description="Create an Activity final node"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ActivityFinalNode.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ActivityFinalNode.gif"
+ genNodes="/0/@diagram/@childNodes.4"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Flow final"
+ description="Create a Flow final node"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/FlowFinalNode.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/FlowFinalNode.gif"
+ genNodes="/0/@diagram/@childNodes.5"/>
+ </groups>
+ <groups
+ title="Actions"
+ largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Opaque Action"
+ description="Create an Opaque Action node"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/OpaqueAction.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/OpaqueAction.gif"
+ genNodes="/0/@diagram/@childNodes.6"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Call Behavior Action"
+ description="Create an Call Behavior Action node"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/CallBehaviorAction.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/CallBehaviorAction.gif"
+ genNodes="/0/@diagram/@childNodes.11"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Call Operation Action"
+ description="Create a Call Operation Action node"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/CallOperationAction.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/CallOperationAction.gif"
+ genNodes="/0/@diagram/@childNodes.16"/>
+ </groups>
+ <groups
+ title="Pins"
+ largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Output Pin"
+ description="Create an Output Pin"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/OutputPin.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/OutputPin.gif"
+ genNodes="/0/@diagram/@childNodes.10 /0/@diagram/@childNodes.15 /0/@diagram/@childNodes.20"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Input Pin"
+ description="Create an Input Pin"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InputPin.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InputPin.gif"
+ genNodes="/0/@diagram/@childNodes.9 /0/@diagram/@childNodes.14 /0/@diagram/@childNodes.19"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Action Input Pin"
+ description="Create an Action Input Pin"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ActionInputPin.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ActionInputPin.gif"
+ genNodes="/0/@diagram/@childNodes.8 /0/@diagram/@childNodes.13 /0/@diagram/@childNodes.17"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Value Pin"
+ description="Create a Value Pin"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ValuePin.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ValuePin.gif"
+ genNodes="/0/@diagram/@childNodes.7 /0/@diagram/@childNodes.12 /0/@diagram/@childNodes.18"/>
+ </groups>
+ <groups
+ title="Edges"
+ largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Control Flow"
+ description="Create a Control Flow"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ControlFlow.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ControlFlow.gif"
+ genLinks="/0/@diagram/@links.5"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Object Flow"
+ description="Create an Object Flow"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ObjectFlow.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ObjectFlow.gif"
+ genLinks="/0/@diagram/@links.4"/>
+ </groups>
+ <groups
+ title="Actions' Local Conditions"
+ largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Local Precondition Constraint"
+ description="Create a Constraint as Local Precondition for an Action"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"
+ genNodes="/0/@diagram/@childNodes.24"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Local Precondition Interaction Constraint"
+ description="Create an Interaction Constraint as Local Precondition for an Action"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InteractionConstraint.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InteractionConstraint.gif"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Local Precondition Interval Constraint"
+ description="Create an Interval Constraint as Local Precondition for an Action"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/IntervalConstraint.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/IntervalConstraint.gif"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Local Precondition Duration Constraint"
+ description="Create a Duration Constraint as Local Precondition for an Action"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/DurationConstraint.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/DurationConstraint.gif"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Local Precondition Time Constraint"
+ description="Create a Time Constraint as Local Precondition for an Action"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/TimeConstraint.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/TimeConstraint.gif"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Local Postcondition Constraint"
+ description="Create a Constraint as Local Postcondition for an Action"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"
+ genNodes="/0/@diagram/@childNodes.25"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Local Postcondition Interaction Constraint"
+ description="Create an Interaction Constraint as Local Postcondition for an Action"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InteractionConstraint.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InteractionConstraint.gif"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Local Postcondition Interval Constraint"
+ description="Create an Interval Constraint as Local Postcondition for an Action"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/IntervalConstraint.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/IntervalConstraint.gif"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Local Postcondition Duration Constraint"
+ description="Create a Duration Constraint as Local Postcondition for an Action"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/DurationConstraint.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/DurationConstraint.gif"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Local Postcondition Time Constraint"
+ description="Create a Time Constraint as Local Postcondition for an Action"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/TimeConstraint.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/TimeConstraint.gif"/>
+ </groups>
+ <groups
+ title="Object Flows' Specifications"
+ largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Selection Behavior"
+ description="Create a new Behavior or choose an exisitng one as Selection for an Object Flow"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Behavior.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Behavior.gif"
+ qualifiedToolName="org.eclipse.papyrus.diagram.activity.edit.commands.CreateObjectFlowActivitySelection"
+ genNodes="/0/@diagram/@childNodes.26"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Transformation Behavior"
+ description="Create a new Behavior or choose an exisitng one as Transformation for an Object Flow"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Behavior.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Behavior.gif"
+ qualifiedToolName="org.eclipse.papyrus.diagram.activity.edit.commands.CreateObjectFlowActivityTransformation"
+ genNodes="/0/@diagram/@childNodes.27"/>
+ </groups>
+ </palette>
+ <preferencePages
xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.rulersAndGrid"
- name="Rulers And Grid"
- kind="RulersAndGrid"/>
- </preferencePages>
- </diagram>
- <plugin
- iD="org.eclipse.papyrus.diagram.activity"
- name="Papyrus activity editor Plugin"
- provider="Papyrus"
- version="0.0.1.qualifier">
- <requiredPlugins>org.eclipse.draw2d</requiredPlugins>
- <requiredPlugins>org.eclipse.papyrus.diagram.common</requiredPlugins>
- <requiredPlugins>org.eclipse.gmf.runtime.draw2d.ui</requiredPlugins>
- </plugin>
- <editor/>
- <navigator>
- <childReferences
- child="//@diagram"/>
- <childReferences
- parent="//@diagram/@topLevelNodes.0"
- child="//@diagram/@childNodes.0"/>
- <childReferences
- parent="//@diagram/@topLevelNodes.0"
- child="//@diagram/@childNodes.1"/>
- <childReferences
- parent="//@diagram/@topLevelNodes.0"
- child="//@diagram/@childNodes.2"/>
- <childReferences
- parent="//@diagram/@topLevelNodes.0"
- child="//@diagram/@childNodes.3"/>
- <childReferences
- parent="//@diagram/@topLevelNodes.0"
- child="//@diagram/@childNodes.4"/>
- <childReferences
- parent="//@diagram/@topLevelNodes.0"
- child="//@diagram/@childNodes.5"/>
- <childReferences
- parent="//@diagram"
- child="//@diagram/@topLevelNodes.0"/>
- </navigator>
- <diagramUpdater/>
- <propertySheet>
- <tabs
- xsi:type="gmfgen:GenStandardPropertyTab"
- iD="appearance"/>
- <tabs
- xsi:type="gmfgen:GenStandardPropertyTab"
- iD="diagram"/>
- <tabs
- xsi:type="gmfgen:GenCustomPropertyTab"
- iD="domain"
- label="Core">
- <filter
- xsi:type="gmfgen:TypeTabFilter">
- <types>org.eclipse.gmf.runtime.notation.View</types>
- <types>org.eclipse.gef.EditPart</types>
- <generatedTypes>abstractNavigatorItem</generatedTypes>
- </filter>
- </tabs>
- </propertySheet>
- <domainGenModel
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#/"/>
- <expressionProviders>
- <providers
- xsi:type="gmfgen:GenExpressionInterpreter">
- <expressions
- body="let base : String = 'Activity' in&#xD;&#xA;let suffixes : Sequence(String) = Sequence {'', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'} in &#xD;&#xA;let space : Namespace = self.namespace in&#xD;&#xA;let allMissed : Sequence(String) = suffixes->&#xD;&#xA; select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))&#xD;&#xA; ) in&#xD;&#xA;let firstMissed : String = allMissed->first() in &#xD;&#xA;let noMisses : Boolean = firstMissed.oclIsUndefined() in&#xD;&#xA;let allNames : Set(String) = &#xD;&#xA; if noMisses &#xD;&#xA; then &#xD;&#xA; space.member->collect(e : NamedElement | &#xD;&#xA; if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) &lt;> base&#xD;&#xA; then '' &#xD;&#xA; else e.name &#xD;&#xA; endif)->asSet()->excluding('') else Set{'not in use'} &#xD;&#xA; endif in &#xD;&#xA;let longestName : String = &#xD;&#xA; if noMisses&#xD;&#xA; then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() &#xD;&#xA; else 'not in use' &#xD;&#xA; endif in &#xD;&#xA;if noMisses then &#xD;&#xA; if longestName.oclIsUndefined() &#xD;&#xA; then base &#xD;&#xA; else longestName.concat('1') &#xD;&#xA; endif &#xD;&#xA;else &#xD;&#xA; base.concat(firstMissed) &#xD;&#xA;endif "/>
- <expressions
- xsi:type="gmfgen:GenConstraint"
- body="self.incoming->isEmpty()"/>
- <expressions
- xsi:type="gmfgen:GenConstraint"
- body="true"/>
- <expressions
- xsi:type="gmfgen:GenConstraint"
- body="self.outgoing->isEmpty()"/>
- </providers>
- </expressionProviders>
- <labelParsers
- extensibleViaService="true">
- <implementations
- xsi:type="gmfgen:PredefinedParser"
- uses="//@diagram/@childNodes.1/@labelModelFacet //@diagram/@childNodes.2/@labelModelFacet //@diagram/@topLevelNodes.0/@labels.0/@modelFacet"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="//@diagram/@topLevelNodes.0/@labels.1/@modelFacet"
- qualifiedName="org.eclipse.papyrus.diagram.activity.parser.custom.ActivitySingleExecutionParser"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="//@diagram/@childNodes.0/@labelModelFacet"
- qualifiedName="org.eclipse.papyrus.diagram.activity.parser.custom.ParameterParser"/>
- </labelParsers>
- <contextMenus
- iD="org.eclipse.papyrus.diagram.activity.part.LoadResourceAction"
- context="//@diagram">
- <items
- xsi:type="gmfgen:LoadResourceAction"/>
- </contextMenus>
-</gmfgen:GenEditorGenerator>
+ iD="org.eclipse.uml2.uml.diagram.general"
+ name="UML Diagram">
+ <children
+ xsi:type="gmfgen:GenStandardPreferencePage"
+ iD="org.eclipse.uml2.uml.diagram.appearance"
+ name="Appearance"
+ kind="Appearance"/>
+ <children
+ xsi:type="gmfgen:GenStandardPreferencePage"
+ iD="org.eclipse.uml2.uml.diagram.connections"
+ name="Connections"
+ kind="Connections"/>
+ <children
+ xsi:type="gmfgen:GenStandardPreferencePage"
+ iD="org.eclipse.uml2.uml.diagram.printing"
+ name="Printing"
+ kind="Printing"/>
+ <children
+ xsi:type="gmfgen:GenStandardPreferencePage"
+ iD="org.eclipse.uml2.uml.diagram.rulersAndGrid"
+ name="Rulers And Grid"
+ kind="RulersAndGrid"/>
+ </preferencePages>
+ </diagram>
+ <plugin
+ iD="org.eclipse.papyrus.diagram.activity"
+ name="Papyrus activity editor Plugin"
+ provider="Papyrus"
+ version="0.0.1.qualifier">
+ <requiredPlugins>org.eclipse.draw2d</requiredPlugins>
+ <requiredPlugins>org.eclipse.papyrus.diagram.common</requiredPlugins>
+ <requiredPlugins>org.eclipse.gmf.runtime.draw2d.ui</requiredPlugins>
+ </plugin>
+ <editor/>
+ <navigator>
+ <childReferences
+ child="/0/@diagram"/>
+ <childReferences
+ parent="/0/@diagram/@topLevelNodes.0"
+ child="/0/@diagram/@childNodes.0"/>
+ <childReferences
+ parent="/0/@diagram/@topLevelNodes.0"
+ child="/0/@diagram/@childNodes.1"/>
+ <childReferences
+ parent="/0/@diagram/@topLevelNodes.0"
+ child="/0/@diagram/@childNodes.2"/>
+ <childReferences
+ parent="/0/@diagram/@topLevelNodes.0"
+ child="/0/@diagram/@childNodes.3"/>
+ <childReferences
+ parent="/0/@diagram/@topLevelNodes.0"
+ child="/0/@diagram/@childNodes.4"/>
+ <childReferences
+ parent="/0/@diagram/@topLevelNodes.0"
+ child="/0/@diagram/@childNodes.5"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.6"
+ child="/0/@diagram/@childNodes.7"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.6"
+ child="/0/@diagram/@childNodes.8"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.6"
+ child="/0/@diagram/@childNodes.9"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.6"
+ child="/0/@diagram/@childNodes.10"/>
+ <childReferences
+ parent="/0/@diagram/@topLevelNodes.0"
+ child="/0/@diagram/@childNodes.6"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.11"
+ child="/0/@diagram/@childNodes.12"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.11"
+ child="/0/@diagram/@childNodes.13"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.11"
+ child="/0/@diagram/@childNodes.14"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.11"
+ child="/0/@diagram/@childNodes.15"/>
+ <childReferences
+ parent="/0/@diagram/@topLevelNodes.0"
+ child="/0/@diagram/@childNodes.11"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.16"
+ child="/0/@diagram/@childNodes.17"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.16"
+ child="/0/@diagram/@childNodes.18"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.16"
+ child="/0/@diagram/@childNodes.19"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.16"
+ child="/0/@diagram/@childNodes.20"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.16"
+ child="/0/@diagram/@childNodes.21"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.16"
+ child="/0/@diagram/@childNodes.22"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.16"
+ child="/0/@diagram/@childNodes.23"/>
+ <childReferences
+ parent="/0/@diagram/@topLevelNodes.0"
+ child="/0/@diagram/@childNodes.16"/>
+ <childReferences
+ parent="/0/@diagram/@topLevelNodes.0"
+ child="/0/@diagram/@childNodes.24"/>
+ <childReferences
+ parent="/0/@diagram/@topLevelNodes.0"
+ child="/0/@diagram/@childNodes.25"/>
+ <childReferences
+ parent="/0/@diagram/@topLevelNodes.0"
+ child="/0/@diagram/@childNodes.26"/>
+ <childReferences
+ parent="/0/@diagram/@topLevelNodes.0"
+ child="/0/@diagram/@childNodes.27"/>
+ <childReferences
+ parent="/0/@diagram"
+ child="/0/@diagram/@topLevelNodes.0"/>
+ <childReferences
+ parent="/0/@diagram"
+ child="/0/@diagram/@links.0"
+ groupName="links"
+ groupIcon="icons/linksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.0"
+ child="/0/@diagram/@childNodes.1"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.1"
+ child="/0/@diagram/@links.0"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.0"
+ child="/0/@diagram/@childNodes.2"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.2"
+ child="/0/@diagram/@links.0"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.0"
+ child="/0/@diagram/@childNodes.24"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.24"
+ child="/0/@diagram/@links.0"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.0"
+ child="/0/@diagram/@childNodes.25"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.25"
+ child="/0/@diagram/@links.0"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.0"
+ child="/0/@diagram/@childNodes.6"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.6"
+ child="/0/@diagram/@links.0"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.0"
+ child="/0/@diagram/@childNodes.11"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.11"
+ child="/0/@diagram/@links.0"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.0"
+ child="/0/@diagram/@childNodes.16"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.16"
+ child="/0/@diagram/@links.0"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram"
+ child="/0/@diagram/@links.1"
+ groupName="links"
+ groupIcon="icons/linksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.1"
+ child="/0/@diagram/@childNodes.1"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.1"
+ child="/0/@diagram/@links.1"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.1"
+ child="/0/@diagram/@childNodes.2"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.2"
+ child="/0/@diagram/@links.1"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.1"
+ child="/0/@diagram/@childNodes.24"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.24"
+ child="/0/@diagram/@links.1"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.1"
+ child="/0/@diagram/@childNodes.25"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.25"
+ child="/0/@diagram/@links.1"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.1"
+ child="/0/@diagram/@childNodes.6"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.6"
+ child="/0/@diagram/@links.1"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.1"
+ child="/0/@diagram/@childNodes.11"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.11"
+ child="/0/@diagram/@links.1"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.1"
+ child="/0/@diagram/@childNodes.16"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.16"
+ child="/0/@diagram/@links.1"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram"
+ child="/0/@diagram/@links.2"
+ groupName="links"
+ groupIcon="icons/linksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.2"
+ child="/0/@diagram/@topLevelNodes.0"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@topLevelNodes.0"
+ child="/0/@diagram/@links.2"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.2"
+ child="/0/@diagram/@childNodes.26"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.26"
+ child="/0/@diagram/@links.2"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.2"
+ child="/0/@diagram/@childNodes.27"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.27"
+ child="/0/@diagram/@links.2"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram"
+ child="/0/@diagram/@links.3"
+ groupName="links"
+ groupIcon="icons/linksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.3"
+ child="/0/@diagram/@topLevelNodes.0"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@topLevelNodes.0"
+ child="/0/@diagram/@links.3"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.3"
+ child="/0/@diagram/@childNodes.26"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.26"
+ child="/0/@diagram/@links.3"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.3"
+ child="/0/@diagram/@childNodes.27"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.27"
+ child="/0/@diagram/@links.3"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram"
+ child="/0/@diagram/@links.4"
+ groupName="links"
+ groupIcon="icons/linksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.3"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.3"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.4"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.4"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.5"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.5"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.6"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.6"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.7"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.7"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.8"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.8"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.9"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.9"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.10"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.10"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.11"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.11"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.12"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.12"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.13"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.13"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.14"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.14"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.15"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.15"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.16"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.16"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.17"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.17"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.18"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.18"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.19"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.19"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.20"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.20"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.21"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.21"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.22"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.22"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.23"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.23"
+ child="/0/@diagram/@links.4"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.3"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.3"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.4"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.4"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.5"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.5"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.6"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.6"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.7"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.7"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.8"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.8"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.9"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.9"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.10"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.10"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.11"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.11"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.12"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.12"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.13"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.13"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.14"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.14"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.15"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.15"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.16"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.16"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.17"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.17"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.18"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.18"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.19"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.19"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.20"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.20"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.21"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.21"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.22"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.22"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.4"
+ child="/0/@diagram/@childNodes.23"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.23"
+ child="/0/@diagram/@links.4"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram"
+ child="/0/@diagram/@links.5"
+ groupName="links"
+ groupIcon="icons/linksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.3"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.3"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.4"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.4"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.5"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.5"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.6"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.6"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.7"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.7"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.8"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.8"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.9"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.9"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.10"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.10"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.11"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.11"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.12"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.12"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.13"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.13"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.14"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.14"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.15"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.15"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.16"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.16"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.17"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.17"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.18"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.18"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.19"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.19"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.20"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.20"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.21"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.21"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.22"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.22"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.23"
+ referenceType="out_target"
+ groupName="target"
+ groupIcon="icons/linkTargetNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.23"
+ child="/0/@diagram/@links.5"
+ referenceType="in_source"
+ groupName="incoming links"
+ groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.3"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.3"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.4"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.4"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.5"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.5"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.6"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.6"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.7"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.7"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.8"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.8"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.9"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.9"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.10"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.10"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.11"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.11"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.12"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.12"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.13"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.13"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.14"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.14"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.15"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.15"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.16"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.16"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.17"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.17"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.18"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.18"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.19"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.19"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.20"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.20"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.21"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.21"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.22"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.22"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@links.5"
+ child="/0/@diagram/@childNodes.23"
+ referenceType="in_source"
+ groupName="source"
+ groupIcon="icons/linkSourceNavigatorGroup.gif"/>
+ <childReferences
+ parent="/0/@diagram/@childNodes.23"
+ child="/0/@diagram/@links.5"
+ referenceType="out_target"
+ groupName="outgoing links"
+ groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
+ </navigator>
+ <diagramUpdater/>
+ <propertySheet>
+ <tabs
+ xsi:type="gmfgen:GenStandardPropertyTab"
+ iD="appearance"/>
+ <tabs
+ xsi:type="gmfgen:GenStandardPropertyTab"
+ iD="diagram"/>
+ <tabs
+ xsi:type="gmfgen:GenCustomPropertyTab"
+ iD="domain"
+ label="Core">
+ <filter
+ xsi:type="gmfgen:TypeTabFilter">
+ <types>org.eclipse.gmf.runtime.notation.View</types>
+ <types>org.eclipse.gef.EditPart</types>
+ <generatedTypes>abstractNavigatorItem</generatedTypes>
+ </filter>
+ </tabs>
+ </propertySheet>
+ <domainGenModel
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#/"/>
+ <expressionProviders>
+ <providers
+ xsi:type="gmfgen:GenJavaExpressionProvider"
+ injectExpressionBody="true">
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ <expressions
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"/>
+ </providers>
+ <providers
+ xsi:type="gmfgen:GenExpressionInterpreter">
+ <expressions
+ xsi:type="gmfgen:GenConstraint"
+ body="if self.owner.oclIsKindOf(Action)&#xD;&#xA;then self.owner.oclAsType(Action).localPrecondition->includes(self)&#xD;&#xA;else false endif"/>
+ <expressions
+ xsi:type="gmfgen:GenConstraint"
+ body="if self.owner.oclIsKindOf(Action)&#xD;&#xA;then self.owner.oclAsType(Action).localPostcondition->includes(self)&#xD;&#xA;else false endif"/>
+ <expressions
+ xsi:type="gmfgen:GenConstraint"
+ body="self.incoming->isEmpty()"/>
+ <expressions
+ xsi:type="gmfgen:GenConstraint"
+ body="true"/>
+ <expressions
+ xsi:type="gmfgen:GenConstraint"
+ body="self.outgoing->isEmpty()"/>
+ </providers>
+ </expressionProviders>
+ <labelParsers
+ extensibleViaService="true">
+ <implementations
+ xsi:type="gmfgen:PredefinedParser"
+ uses="/0/@diagram/@childNodes.1/@labelModelFacet /0/@diagram/@childNodes.2/@labelModelFacet /0/@diagram/@childNodes.6/@labels.0/@modelFacet /0/@diagram/@childNodes.24/@labels.0/@modelFacet /0/@diagram/@childNodes.25/@labels.0/@modelFacet /0/@diagram/@childNodes.26/@labels.0/@modelFacet /0/@diagram/@childNodes.27/@labels.0/@modelFacet /0/@diagram/@topLevelNodes.0/@labels.0/@modelFacet /0/@diagram/@links.4/@labels.0/@modelFacet /0/@diagram/@links.5/@labels.0/@modelFacet"/>
+ <implementations
+ xsi:type="gmfgen:CustomParser"
+ uses="/0/@diagram/@topLevelNodes.0/@labels.1/@modelFacet"
+ qualifiedName="org.eclipse.papyrus.diagram.activity.parser.custom.ActivitySingleExecutionParser"/>
+ <implementations
+ xsi:type="gmfgen:CustomParser"
+ uses="/0/@diagram/@childNodes.0/@labelModelFacet"
+ qualifiedName="org.eclipse.papyrus.diagram.activity.parser.custom.ParameterParser"/>
+ <implementations
+ xsi:type="gmfgen:CustomParser"
+ uses="/0/@diagram/@childNodes.16/@labels.0/@modelFacet"
+ qualifiedName="org.eclipse.papyrus.diagram.activity.parser.custom.CallOperationActionParser"/>
+ <implementations
+ xsi:type="gmfgen:CustomParser"
+ uses="/0/@diagram/@childNodes.11/@labels.0/@modelFacet"
+ qualifiedName="org.eclipse.papyrus.diagram.activity.parser.custom.CallBehaviorActionParser"/>
+ <implementations
+ xsi:type="gmfgen:CustomParser"
+ uses="/0/@diagram/@childNodes.18/@labels.0/@modelFacet /0/@diagram/@childNodes.8/@labels.0/@modelFacet /0/@diagram/@childNodes.14/@labels.0/@modelFacet /0/@diagram/@childNodes.15/@labels.0/@modelFacet /0/@diagram/@childNodes.19/@labels.0/@modelFacet /0/@diagram/@childNodes.23/@labels.0/@modelFacet /0/@diagram/@childNodes.20/@labels.0/@modelFacet /0/@diagram/@childNodes.13/@labels.0/@modelFacet /0/@diagram/@childNodes.22/@labels.0/@modelFacet /0/@diagram/@childNodes.10/@labels.0/@modelFacet /0/@diagram/@childNodes.7/@labels.0/@modelFacet /0/@diagram/@childNodes.9/@labels.0/@modelFacet /0/@diagram/@childNodes.12/@labels.0/@modelFacet /0/@diagram/@childNodes.17/@labels.0/@modelFacet /0/@diagram/@childNodes.21/@labels.0/@modelFacet"
+ qualifiedName="org.eclipse.papyrus.diagram.activity.parser.custom.PinParser"/>
+ <implementations
+ xsi:type="gmfgen:CustomParser"
+ uses="/0/@diagram/@childNodes.22/@labels.1/@modelFacet /0/@diagram/@childNodes.12/@labels.1/@modelFacet /0/@diagram/@childNodes.21/@labels.1/@modelFacet /0/@diagram/@childNodes.8/@labels.1/@modelFacet /0/@diagram/@childNodes.18/@labels.1/@modelFacet /0/@diagram/@childNodes.17/@labels.1/@modelFacet /0/@diagram/@childNodes.7/@labels.1/@modelFacet /0/@diagram/@childNodes.13/@labels.1/@modelFacet"
+ qualifiedName="org.eclipse.papyrus.diagram.activity.parser.custom.PinValueParser"/>
+ <implementations
+ xsi:type="gmfgen:CustomParser"
+ uses="/0/@diagram/@links.4/@labels.1/@modelFacet /0/@diagram/@links.5/@labels.1/@modelFacet"
+ qualifiedName="org.eclipse.papyrus.diagram.activity.parser.custom.ActivityEdgeWeightParser"/>
+ </labelParsers>
+ <contextMenus
+ iD="org.eclipse.papyrus.diagram.activity.part.LoadResourceAction"
+ context="/0/@diagram">
+ <items
+ xsi:type="gmfgen:LoadResourceAction"/>
+ </contextMenus>
+ </gmfgen:GenEditorGenerator>
+ <papyrusgmfgenextension:PapyrusExtensionRootNode
+ comment="Papyrus Extensions">
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:ExtendedGenView"
+ comment="This extension enables to draw a rake on a CallBehaviorActionEditPart linked to an activity"
+ genView="/0/@diagram/@childNodes.11">
+ <propRefreshHook
+ comment="Add/Remove the RakeFigure when an Activity is selected as behavior or deselected"
+ classpath=""
+ triggeringCondition="resolveSemanticElement() instanceof CallBehaviorAction &amp;&amp; resolveSemanticElement().equals(event.getNotifier()) &amp;&amp; event.getFeature().equals(UMLPackage.eINSTANCE.getCallBehaviorAction_Behavior())"
+ action="CallBehaviorAction action = (CallBehaviorAction)resolveSemanticElement(); Polyline rake = getPrimaryShape().getOptionalRakeFigure(); if(action.getBehavior() instanceof Activity) { Dimension size = ActivityFigureDrawer.getNodeSize(this, null); ActivityFigureDrawer.redrawRake(rake, getMapMode(), size); } else { ActivityFigureDrawer.undrawFigure(rake); }"/>
+ </extensionNodes>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:ExtendedGenView"
+ comment="This extension enables to refresh the rake on a CallBehaviorActionEditPart linked to an activity"
+ genView="/0/@diagram/@childNodes.11">
+ <propRefreshHook
+ comment="Refresh the RakeFigure if an Activity is selected as behavior when figure is resized"
+ classpath=""
+ triggeringCondition="event.getNotifier() instanceof Bounds &amp;&amp; resolveSemanticElement() instanceof CallBehaviorAction"
+ action="CallBehaviorAction action = (CallBehaviorAction)resolveSemanticElement(); Polyline rake = getPrimaryShape().getOptionalRakeFigure(); if(action.getBehavior() instanceof Activity) { Dimension size = ActivityFigureDrawer.getNodeSize(this, event); ActivityFigureDrawer.redrawRake(rake, getMapMode(), size); }"/>
+ </extensionNodes>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:SpecificLocator"
+ comment="Affixed Input Pin locator for OpaqueAction"
+ classpath="org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator"
+ genChildSideAffixedNode="/0/@diagram/@childNodes.9"/>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:SpecificLocator"
+ comment="Affixed Action Input Pin locator for OpaqueAction"
+ classpath="org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator"
+ genChildSideAffixedNode="/0/@diagram/@childNodes.8"/>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:SpecificLocator"
+ comment="Affixed Value Pin locator for OpaqueAction"
+ classpath="org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator"
+ genChildSideAffixedNode="/0/@diagram/@childNodes.7"/>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:SpecificLocator"
+ comment="Affixed Output Pin locator for OpaqueAction"
+ classpath="org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator"
+ genChildSideAffixedNode="/0/@diagram/@childNodes.10"/>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:SpecificLocator"
+ comment="Affixed Input Pin 2 locator for CallBehaviorAction"
+ classpath="org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator"
+ genChildSideAffixedNode="/0/@diagram/@childNodes.14"/>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:SpecificLocator"
+ comment="Affixed Action Input Pin 2 locator for CallBehaviorAction"
+ classpath="org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator"
+ genChildSideAffixedNode="/0/@diagram/@childNodes.13"/>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:SpecificLocator"
+ comment="Affixed Value Pin 2 locator for CallBehaviorAction"
+ classpath="org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator"
+ genChildSideAffixedNode="/0/@diagram/@childNodes.12"/>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:SpecificLocator"
+ comment="Affixed Output Pin 2 locator for CallBehaviorAction"
+ classpath="org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator"
+ genChildSideAffixedNode="/0/@diagram/@childNodes.15"/>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:SpecificLocator"
+ comment="Affixed Input Pin 3 locator for CallOperationAction argument"
+ classpath="org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator"
+ genChildSideAffixedNode="/0/@diagram/@childNodes.19"/>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:SpecificLocator"
+ comment="Affixed Action Input Pin 3 locator for CallOperationAction argument"
+ classpath="org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator"
+ genChildSideAffixedNode="/0/@diagram/@childNodes.17"/>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:SpecificLocator"
+ comment="Affixed Value Pin 3 locator for CallOperationAction argument"
+ classpath="org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator"
+ genChildSideAffixedNode="/0/@diagram/@childNodes.18"/>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:SpecificLocator"
+ comment="Affixed Output Pin 3 locator for CallOperationAction"
+ classpath="org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator"
+ genChildSideAffixedNode="/0/@diagram/@childNodes.20"/>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:SpecificLocator"
+ comment="Affixed Input Pin 4 locator for CallOperationAction target"
+ classpath="org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator"
+ genChildSideAffixedNode="/0/@diagram/@childNodes.23"/>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:SpecificLocator"
+ comment="Affixed Action Input Pin 4 locator for CallOperationAction target"
+ classpath="org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator"
+ genChildSideAffixedNode="/0/@diagram/@childNodes.22"/>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:SpecificLocator"
+ comment="Affixed Value Pin 4 locator for CallOperationAction target"
+ classpath="org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator"
+ genChildSideAffixedNode="/0/@diagram/@childNodes.21"/>
+ </papyrusgmfgenextension:PapyrusExtensionRootNode>
+</xmi:XMI>
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfgraph b/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfgraph
index e103e0ec648..a772d238579 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfgraph
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfgraph
@@ -179,29 +179,17 @@
figure="//@figures.0/@descriptors.0/@actualFigure/@children.0/@children.3"/>
</descriptors>
<descriptors
- name="ActivityParameterFigure">
+ name="CommonLabelFigure">
<actualFigure
xsi:type="gmfgraph:Label"
- name="ParameterLabel"
+ name="CommonLabel"
text=""/>
</descriptors>
<descriptors
- name="ActivityPreconditionFigure">
- <actualFigure
- xsi:type="gmfgraph:Label"
- name="PreconditionLabel"/>
- </descriptors>
- <descriptors
- name="ActivityPostconditionFigure">
- <actualFigure
- xsi:type="gmfgraph:Label"
- name="PostconditionLabel"/>
- </descriptors>
- <descriptors
name="InitialNodeFigure">
<actualFigure
xsi:type="gmfgraph:Rectangle"
- name="InitialNodeFigure"
+ name="InitialNodeRect"
outline="false"
fill="false">
<maximumSize
@@ -232,7 +220,7 @@
name="ActivityFinalNodeFigure">
<actualFigure
xsi:type="gmfgraph:Rectangle"
- name="ActivityFinalNodeFigure"
+ name="ActivityFinalNodeRect"
outline="false"
fill="false">
<maximumSize
@@ -273,7 +261,7 @@
name="FlowFinalNodeFigure">
<actualFigure
xsi:type="gmfgraph:Rectangle"
- name="ActivityFinalNodeFigure"
+ name="FlowFinalNodeRect"
outline="false"
fill="false">
<maximumSize
@@ -317,28 +305,142 @@
</children>
</actualFigure>
</descriptors>
+ <descriptors
+ name="ActionFigure">
+ <actualFigure
+ xsi:type="gmfgraph:RoundedRectangle"
+ name="ActionRectangle"
+ cornerWidth="16"
+ cornerHeight="16">
+ <layout
+ xsi:type="gmfgraph:CustomLayout"
+ qualifiedClassName="org.eclipse.papyrus.diagram.common.draw2d.CenterLayout"/>
+ <children
+ xsi:type="gmfgraph:CustomFigure"
+ name="ActionLabel"
+ qualifiedClassName="org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel"/>
+ <children
+ xsi:type="gmfgraph:Polyline"
+ name="RakeFigure"
+ fill="false"
+ lineWidth="2"/>
+ </actualFigure>
+ <accessors
+ accessor="getActionLabel"
+ figure="//@figures.0/@descriptors.5/@actualFigure/@children.0"/>
+ <accessors
+ accessor="getOptionalRakeFigure"
+ figure="//@figures.0/@descriptors.5/@actualFigure/@children.1"/>
+ </descriptors>
+ <descriptors
+ name="CornerBentWithTextFigure">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="CornerBentCustFigure"
+ qualifiedClassName="org.eclipse.papyrus.diagram.common.figure.node.CornerBentFigure">
+ <backgroundColor
+ xsi:type="gmfgraph:RGBColor"
+ red="248"
+ green="249"
+ blue="214"/>
+ <children
+ xsi:type="gmfgraph:CustomFigure"
+ name="CornerBentContentLabel"
+ qualifiedClassName="org.eclipse.papyrus.diagram.activity.figures.WrappedLabel"/>
+ </actualFigure>
+ <accessors
+ accessor="getCornerBentContent"
+ figure="//@figures.0/@descriptors.6/@actualFigure/@children.0"/>
+ </descriptors>
+ <descriptors
+ name="DashedLinkDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:PolylineConnection"
+ name="DashedLinkPolyline"
+ lineKind="LINE_DASH"/>
+ </descriptors>
+ <descriptors
+ name="PinDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:Rectangle"
+ name="PinOutline">
+ <preferredSize
+ dx="16"
+ dy="16"/>
+ <children
+ xsi:type="gmfgraph:Polyline"
+ name="OptionalArrow"/>
+ </actualFigure>
+ <accessors
+ accessor="getOptionalArrowFigure"
+ figure="//@figures.0/@descriptors.8/@actualFigure/@children.0"/>
+ </descriptors>
+ <descriptors
+ name="ActivityEdgeDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:PolylineConnection"
+ name="ActivityEdgePolyline"
+ targetDecoration="//@figures.0/@descriptors.9/@actualFigure/@children.0">
+ <children
+ xsi:type="gmfgraph:PolylineDecoration"
+ name="ActivityEdgeArrow">
+ <template
+ x="-2"
+ y="2"/>
+ <template/>
+ <template
+ x="-2"
+ y="-2"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:CustomFigure"
+ name="ActivityEdgeName"
+ qualifiedClassName="org.eclipse.papyrus.diagram.activity.figures.WrappedLabel"/>
+ <children
+ xsi:type="gmfgraph:CustomFigure"
+ name="ActivityEdgeWeight"
+ qualifiedClassName="org.eclipse.papyrus.diagram.activity.figures.WrappedLabel"/>
+ </actualFigure>
+ <accessors
+ accessor="getEdgeName"
+ figure="//@figures.0/@descriptors.9/@actualFigure/@children.1"/>
+ <accessors
+ accessor="getEdgeWeight"
+ figure="//@figures.0/@descriptors.9/@actualFigure/@children.2"/>
+ </descriptors>
</figures>
<nodes
name="ActivityNode"
figure="CustomActivityRectangleFigure"/>
<nodes
- name="ActivityParameterNode"
- figure="ActivityParameterFigure"/>
- <nodes
- name="ActivityPreconditionNode"
- figure="ActivityPreconditionFigure"/>
- <nodes
- name="ActivityPostconditionNode"
- figure="ActivityPostconditionFigure"/>
- <nodes
name="InitialNode"
- figure="InitialNodeFigure"/>
+ figure="InitialNodeFigure"
+ resizeConstraint="NONE"/>
<nodes
name="ActivityFinalNode"
figure="ActivityFinalNodeFigure"/>
<nodes
name="FlowFinalNode"
figure="FlowFinalNodeFigure"/>
+ <nodes
+ name="ActionNode"
+ figure="ActionFigure"/>
+ <nodes
+ name="LocalCondition"
+ figure="CornerBentWithTextFigure"/>
+ <nodes
+ name="ObjectFlowBehavior"
+ figure="CornerBentWithTextFigure"/>
+ <nodes
+ name="PinNode"
+ figure="PinDescriptor"
+ affixedParentSide="NSEW"/>
+ <connections
+ name="CornerBentWithTextLinkConnection"
+ figure="DashedLinkDescriptor"/>
+ <connections
+ name="ActivityEdgeConnection"
+ figure="ActivityEdgeDescriptor"/>
<compartments
name="ActivityParametersCompartment"
figure="CustomActivityRectangleFigure"
@@ -365,30 +467,77 @@
</labels>
<labels
name="ActivityParameter"
- figure="ActivityParameterFigure"
+ figure="CommonLabelFigure"
elementIcon="false">
<facets
xsi:type="gmfgraph:AlignmentFacet"/>
</labels>
<labels
- name="ActivityPrecondition"
- figure="ActivityPreconditionFigure"
+ name="ActivityCondition"
+ figure="CommonLabelFigure"
elementIcon="false">
<facets
xsi:type="gmfgraph:AlignmentFacet"/>
</labels>
<labels
- name="ActivityPostcondition"
- figure="ActivityPostconditionFigure"
- elementIcon="false">
+ name="ActivitySingleExecution"
+ figure="CustomActivityRectangleFigure"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.4">
<facets
xsi:type="gmfgraph:AlignmentFacet"/>
</labels>
<labels
- name="ActivitySingleExecution"
- figure="CustomActivityRectangleFigure"
+ name="ActionName"
+ figure="ActionFigure"
elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.4">
+ accessor="//@figures.0/@descriptors.5/@accessors.0">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"
+ alignment="CENTER"/>
+ </labels>
+ <labels
+ name="ActionLocalConditionContent"
+ figure="CornerBentWithTextFigure"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.6/@accessors.0">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"/>
+ </labels>
+ <labels
+ name="ObjectFlowBehaviorSpecification"
+ figure="CornerBentWithTextFigure"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.6/@accessors.0">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"/>
+ </labels>
+ <labels
+ name="PinName"
+ figure="CommonLabelFigure"
+ elementIcon="false">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"/>
+ </labels>
+ <labels
+ name="PinValue"
+ figure="CommonLabelFigure"
+ elementIcon="false">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"
+ alignment="CENTER"/>
+ </labels>
+ <labels
+ name="EdgeName"
+ figure="CommonLabelFigure"
+ elementIcon="false">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"/>
+ </labels>
+ <labels
+ name="EdgeWeight"
+ figure="CommonLabelFigure"
+ elementIcon="false">
<facets
xsi:type="gmfgraph:AlignmentFacet"/>
</labels>
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfmap b/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfmap
index 7cd165fc694..aba69be9ea6 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfmap
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfmap
@@ -19,7 +19,8 @@
xsi:type="ecore:EAttribute"
href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
<value
- body="let base : String = 'Activity' in&#xD;&#xA;let suffixes : Sequence(String) = Sequence {'', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'} in &#xD;&#xA;let space : Namespace = self.namespace in&#xD;&#xA;let allMissed : Sequence(String) = suffixes->&#xD;&#xA; select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))&#xD;&#xA; ) in&#xD;&#xA;let firstMissed : String = allMissed->first() in &#xD;&#xA;let noMisses : Boolean = firstMissed.oclIsUndefined() in&#xD;&#xA;let allNames : Set(String) = &#xD;&#xA; if noMisses &#xD;&#xA; then &#xD;&#xA; space.member->collect(e : NamedElement | &#xD;&#xA; if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) &lt;> base&#xD;&#xA; then '' &#xD;&#xA; else e.name &#xD;&#xA; endif)->asSet()->excluding('') else Set{'not in use'} &#xD;&#xA; endif in &#xD;&#xA;let longestName : String = &#xD;&#xA; if noMisses&#xD;&#xA; then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() &#xD;&#xA; else 'not in use' &#xD;&#xA; endif in &#xD;&#xA;if noMisses then &#xD;&#xA; if longestName.oclIsUndefined() &#xD;&#xA; then base &#xD;&#xA; else longestName.concat('1') &#xD;&#xA; endif &#xD;&#xA;else &#xD;&#xA; base.concat(firstMissed) &#xD;&#xA;endif "/>
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
</initializers>
</domainInitializer>
<labelMappings
@@ -53,6 +54,18 @@
relatedDiagrams="//@diagram">
<domainMetaElement
href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Parameter"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
<labelMappings>
<diagramLabel
href="activityDiagram.gmfgraph#ActivityParameter"/>
@@ -72,18 +85,30 @@
relatedDiagrams="//@diagram">
<domainMetaElement
href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Constraint"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
<labelMappings
xsi:type="gmfmap:FeatureLabelMapping"
viewPattern="&lt;&lt;precondition>> {0}"
editorPattern="{0}"
editPattern="{0}">
<diagramLabel
- href="activityDiagram.gmfgraph#ActivityPrecondition"/>
+ href="activityDiagram.gmfgraph#ActivityCondition"/>
<features
href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
</labelMappings>
<diagramNode
- href="activityDiagram.gmfgraph#ActivityPrecondition"/>
+ href="activityDiagram.gmfgraph#ActivityCondition"/>
</ownedChild>
</children>
<children
@@ -97,18 +122,30 @@
relatedDiagrams="//@diagram">
<domainMetaElement
href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Constraint"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
<labelMappings
xsi:type="gmfmap:FeatureLabelMapping"
viewPattern="&lt;&lt;postcondition>> {0}"
editorPattern="{0}"
editPattern="{0}">
<diagramLabel
- href="activityDiagram.gmfgraph#ActivityPostcondition"/>
+ href="activityDiagram.gmfgraph#ActivityCondition"/>
<features
href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
</labelMappings>
<diagramNode
- href="activityDiagram.gmfgraph#ActivityPostcondition"/>
+ href="activityDiagram.gmfgraph#ActivityCondition"/>
</ownedChild>
</children>
<children
@@ -122,6 +159,18 @@
relatedDiagrams="//@diagram">
<domainMetaElement
href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InitialNode"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
<tool
xsi:type="gmftool:CreationTool"
href="activityDiagram.gmftool#//@palette/@tools.0/@tools.0"/>
@@ -140,6 +189,18 @@
relatedDiagrams="//@diagram">
<domainMetaElement
href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ActivityFinalNode"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
<tool
xsi:type="gmftool:CreationTool"
href="activityDiagram.gmftool#//@palette/@tools.0/@tools.1"/>
@@ -158,6 +219,18 @@
relatedDiagrams="//@diagram">
<domainMetaElement
href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//FlowFinalNode"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
<tool
xsi:type="gmftool:CreationTool"
href="activityDiagram.gmftool#//@palette/@tools.0/@tools.2"/>
@@ -165,6 +238,793 @@
href="activityDiagram.gmfgraph#FlowFinalNode"/>
</ownedChild>
</children>
+ <children
+ compartment="//@nodes.0/@ownedChild/@compartments.3"
+ referencedChild="//@nodes.0/@ownedChild/@children.6/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Activity/node"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Activity/node"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//OpaqueAction"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings
+ xsi:type="gmfmap:FeatureLabelMapping">
+ <diagramLabel
+ href="activityDiagram.gmfgraph#ActionName"/>
+ <features
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.1/@tools.0"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#ActionNode"/>
+ <children
+ referencedChild="//@nodes.0/@ownedChild/@children.6/@ownedChild/@children.0/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//OpaqueAction/inputValue"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//OpaqueAction/inputValue"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ValuePin"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinName"/>
+ </labelMappings>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinValue"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.2/@tools.3"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#PinNode"/>
+ </ownedChild>
+ </children>
+ <children
+ referencedChild="//@nodes.0/@ownedChild/@children.6/@ownedChild/@children.1/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//OpaqueAction/inputValue"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//OpaqueAction/inputValue"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ActionInputPin"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinName"/>
+ </labelMappings>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinValue"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.2/@tools.2"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#PinNode"/>
+ </ownedChild>
+ </children>
+ <children
+ referencedChild="//@nodes.0/@ownedChild/@children.6/@ownedChild/@children.2/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//OpaqueAction/inputValue"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//OpaqueAction/inputValue"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InputPin"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinName"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.2/@tools.1"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#PinNode"/>
+ </ownedChild>
+ </children>
+ <children
+ referencedChild="//@nodes.0/@ownedChild/@children.6/@ownedChild/@children.3/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//OpaqueAction/outputValue"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//OpaqueAction/outputValue"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//OutputPin"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinName"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.2/@tools.0"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#PinNode"/>
+ </ownedChild>
+ </children>
+ </ownedChild>
+ </children>
+ <children
+ compartment="//@nodes.0/@ownedChild/@compartments.3"
+ referencedChild="//@nodes.0/@ownedChild/@children.7/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Activity/node"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Activity/node"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//CallBehaviorAction"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#ActionName"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.1/@tools.1"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#ActionNode"/>
+ <children
+ referencedChild="//@nodes.0/@ownedChild/@children.7/@ownedChild/@children.0/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InvocationAction/argument"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InvocationAction/argument"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ValuePin"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinName"/>
+ </labelMappings>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinValue"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.2/@tools.3"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#PinNode"/>
+ </ownedChild>
+ </children>
+ <children
+ referencedChild="//@nodes.0/@ownedChild/@children.7/@ownedChild/@children.1/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InvocationAction/argument"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InvocationAction/argument"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ActionInputPin"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinName"/>
+ </labelMappings>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinValue"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.2/@tools.2"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#PinNode"/>
+ </ownedChild>
+ </children>
+ <children
+ referencedChild="//@nodes.0/@ownedChild/@children.7/@ownedChild/@children.2/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InvocationAction/argument"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InvocationAction/argument"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InputPin"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinName"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.2/@tools.1"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#PinNode"/>
+ </ownedChild>
+ </children>
+ <children
+ referencedChild="//@nodes.0/@ownedChild/@children.7/@ownedChild/@children.3/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//CallAction/result"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//CallAction/result"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//OutputPin"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinName"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.2/@tools.0"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#PinNode"/>
+ </ownedChild>
+ </children>
+ </ownedChild>
+ </children>
+ <children
+ compartment="//@nodes.0/@ownedChild/@compartments.3"
+ referencedChild="//@nodes.0/@ownedChild/@children.8/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Activity/node"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Activity/node"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//CallOperationAction"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#ActionName"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.1/@tools.2"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#ActionNode"/>
+ <children
+ referencedChild="//@nodes.0/@ownedChild/@children.8/@ownedChild/@children.0/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InvocationAction/argument"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InvocationAction/argument"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ActionInputPin"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinName"/>
+ </labelMappings>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinValue"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.2/@tools.2"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#PinNode"/>
+ </ownedChild>
+ </children>
+ <children
+ referencedChild="//@nodes.0/@ownedChild/@children.8/@ownedChild/@children.1/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InvocationAction/argument"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InvocationAction/argument"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ValuePin"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinName"/>
+ </labelMappings>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinValue"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.2/@tools.3"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#PinNode"/>
+ </ownedChild>
+ </children>
+ <children
+ referencedChild="//@nodes.0/@ownedChild/@children.8/@ownedChild/@children.2/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InvocationAction/argument"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InvocationAction/argument"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InputPin"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinName"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.2/@tools.1"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#PinNode"/>
+ </ownedChild>
+ </children>
+ <children
+ referencedChild="//@nodes.0/@ownedChild/@children.8/@ownedChild/@children.3/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//CallAction/result"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//CallAction/result"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//OutputPin"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinName"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.2/@tools.0"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#PinNode"/>
+ </ownedChild>
+ </children>
+ <children
+ referencedChild="//@nodes.0/@ownedChild/@children.8/@ownedChild/@children.4/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//CallOperationAction/target"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//CallOperationAction/target"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ValuePin"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinName"/>
+ </labelMappings>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinValue"/>
+ </labelMappings>
+ <diagramNode
+ href="activityDiagram.gmfgraph#PinNode"/>
+ </ownedChild>
+ </children>
+ <children
+ referencedChild="//@nodes.0/@ownedChild/@children.8/@ownedChild/@children.5/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//CallOperationAction/target"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//CallOperationAction/target"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ActionInputPin"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinName"/>
+ </labelMappings>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinValue"/>
+ </labelMappings>
+ <diagramNode
+ href="activityDiagram.gmfgraph#PinNode"/>
+ </ownedChild>
+ </children>
+ <children
+ referencedChild="//@nodes.0/@ownedChild/@children.8/@ownedChild/@children.6/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//CallOperationAction/target"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//CallOperationAction/target"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//InputPin"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#PinName"/>
+ </labelMappings>
+ <diagramNode
+ href="activityDiagram.gmfgraph#PinNode"/>
+ </ownedChild>
+ </children>
+ </ownedChild>
+ </children>
+ <children
+ compartment="//@nodes.0/@ownedChild/@compartments.3"
+ referencedChild="//@nodes.0/@ownedChild/@children.9/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Action/localPrecondition"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Action/localPrecondition"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Constraint"/>
+ <domainSpecialization
+ body="if self.owner.oclIsKindOf(Action)&#xD;&#xA;then self.owner.oclAsType(Action).localPrecondition->includes(self)&#xD;&#xA;else false endif"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings
+ xsi:type="gmfmap:FeatureLabelMapping"
+ viewPattern="&lt;&lt;localPrecondition>>\n{0}"
+ editorPattern="{0}"
+ editPattern="{0}">
+ <diagramLabel
+ href="activityDiagram.gmfgraph#ActionLocalConditionContent"/>
+ <features
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.4/@tools.0"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#LocalCondition"/>
+ </ownedChild>
+ </children>
+ <children
+ compartment="//@nodes.0/@ownedChild/@compartments.3"
+ referencedChild="//@nodes.0/@ownedChild/@children.10/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Action/localPostcondition"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Action/localPostcondition"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Constraint"/>
+ <domainSpecialization
+ body="if self.owner.oclIsKindOf(Action)&#xD;&#xA;then self.owner.oclAsType(Action).localPostcondition->includes(self)&#xD;&#xA;else false endif"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings
+ xsi:type="gmfmap:FeatureLabelMapping"
+ viewPattern="&lt;&lt;localPostcondition>>\n{0}"
+ editorPattern="{0}"
+ editPattern="{0}">
+ <diagramLabel
+ href="activityDiagram.gmfgraph#ActionLocalConditionContent"/>
+ <features
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.4/@tools.5"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#LocalCondition"/>
+ </ownedChild>
+ </children>
+ <children
+ compartment="//@nodes.0/@ownedChild/@compartments.3"
+ referencedChild="//@nodes.0/@ownedChild/@children.11/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Package/packagedElement"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ObjectFlow/selection"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Activity"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings
+ xsi:type="gmfmap:FeatureLabelMapping"
+ viewPattern="&lt;&lt;selection>>\n{0}"
+ editorPattern="{0}"
+ editPattern="{0}">
+ <diagramLabel
+ href="activityDiagram.gmfgraph#ActionLocalConditionContent"/>
+ <features
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:GenericTool"
+ href="activityDiagram.gmftool#//@palette/@tools.5/@tools.0"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#ObjectFlowBehavior"/>
+ </ownedChild>
+ </children>
+ <children
+ compartment="//@nodes.0/@ownedChild/@compartments.3"
+ referencedChild="//@nodes.0/@ownedChild/@children.12/@ownedChild">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Package/packagedElement"/>
+ <childrenFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ObjectFlow/transformation"/>
+ <ownedChild
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Activity"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings
+ xsi:type="gmfmap:FeatureLabelMapping"
+ viewPattern="&lt;&lt;transformation>>\n{0}"
+ editorPattern="{0}"
+ editPattern="{0}">
+ <diagramLabel
+ href="activityDiagram.gmfgraph#ActionLocalConditionContent"/>
+ <features
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ </labelMappings>
+ <tool
+ xsi:type="gmftool:GenericTool"
+ href="activityDiagram.gmftool#//@palette/@tools.5/@tools.1"/>
+ <diagramNode
+ href="activityDiagram.gmfgraph#ObjectFlowBehavior"/>
+ </ownedChild>
+ </children>
<compartments
children="//@nodes.0/@ownedChild/@children.0">
<compartment
@@ -181,12 +1041,126 @@
href="activityDiagram.gmfgraph#ActivityPostConditionsCompartment"/>
</compartments>
<compartments
- children="//@nodes.0/@ownedChild/@children.5 //@nodes.0/@ownedChild/@children.3 //@nodes.0/@ownedChild/@children.4">
+ children="//@nodes.0/@ownedChild/@children.5 //@nodes.0/@ownedChild/@children.3 //@nodes.0/@ownedChild/@children.4 //@nodes.0/@ownedChild/@children.6 //@nodes.0/@ownedChild/@children.9 //@nodes.0/@ownedChild/@children.7 //@nodes.0/@ownedChild/@children.8 //@nodes.0/@ownedChild/@children.10 //@nodes.0/@ownedChild/@children.11 //@nodes.0/@ownedChild/@children.12">
<compartment
href="activityDiagram.gmfgraph#ActivityContentCompartment"/>
</compartments>
</ownedChild>
</nodes>
+ <links
+ relatedDiagrams="//@diagram">
+ <diagramLink
+ href="activityDiagram.gmfgraph#CornerBentWithTextLinkConnection"/>
+ <linkMetaFeature
+ xsi:type="ecore:EReference"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Action/localPrecondition"/>
+ </links>
+ <links
+ relatedDiagrams="//@diagram">
+ <diagramLink
+ href="activityDiagram.gmfgraph#CornerBentWithTextLinkConnection"/>
+ <linkMetaFeature
+ xsi:type="ecore:EReference"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Action/localPostcondition"/>
+ </links>
+ <links
+ relatedDiagrams="//@diagram">
+ <diagramLink
+ href="activityDiagram.gmfgraph#CornerBentWithTextLinkConnection"/>
+ <linkMetaFeature
+ xsi:type="ecore:EReference"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ObjectFlow/selection"/>
+ </links>
+ <links
+ relatedDiagrams="//@diagram">
+ <diagramLink
+ href="activityDiagram.gmfgraph#CornerBentWithTextLinkConnection"/>
+ <linkMetaFeature
+ xsi:type="ecore:EReference"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ObjectFlow/transformation"/>
+ </links>
+ <links
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ObjectFlow"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings
+ xsi:type="gmfmap:FeatureLabelMapping">
+ <diagramLabel
+ href="activityDiagram.gmfgraph#EdgeName"/>
+ <features
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ </labelMappings>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#EdgeWeight"/>
+ </labelMappings>
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Activity/edge"/>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.3/@tools.1"/>
+ <diagramLink
+ href="activityDiagram.gmfgraph#ActivityEdgeConnection"/>
+ <sourceMetaFeature
+ xsi:type="ecore:EReference"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ActivityEdge/source"/>
+ <linkMetaFeature
+ xsi:type="ecore:EReference"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ActivityEdge/target"/>
+ </links>
+ <links
+ relatedDiagrams="//@diagram">
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ControlFlow"/>
+ <domainInitializer
+ xsi:type="gmfmap:FeatureSeqInitializer">
+ <initializers
+ xsi:type="gmfmap:FeatureValueSpec">
+ <feature
+ xsi:type="ecore:EAttribute"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ <value
+ body="return org.eclipse.papyrus.diagram.common.actions.LabelHelper.INSTANCE.findName(self.eContainer(), self);"
+ language="java"/>
+ </initializers>
+ </domainInitializer>
+ <labelMappings
+ xsi:type="gmfmap:FeatureLabelMapping">
+ <diagramLabel
+ href="activityDiagram.gmfgraph#EdgeName"/>
+ <features
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
+ </labelMappings>
+ <labelMappings>
+ <diagramLabel
+ href="activityDiagram.gmfgraph#EdgeWeight"/>
+ </labelMappings>
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Activity/edge"/>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="activityDiagram.gmftool#//@palette/@tools.3/@tools.0"/>
+ <diagramLink
+ href="activityDiagram.gmfgraph#ActivityEdgeConnection"/>
+ <sourceMetaFeature
+ xsi:type="ecore:EReference"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ActivityEdge/source"/>
+ <linkMetaFeature
+ xsi:type="ecore:EReference"
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ActivityEdge/target"/>
+ </links>
<diagram>
<diagramCanvas
href="activityDiagram.gmfgraph#cnvActivities"/>
@@ -199,7 +1173,7 @@
</diagram>
<audits
id="org.eclipse.uml2.uml.util.UMLValidator.validate"
- name="validateNoIncomingEdges"
+ name="validateUMLModel"
description="Validate the UML model">
<childContainers
id="org.eclipse.uml2.uml.util.UMLValidator.validateInitialNode"
@@ -253,5 +1227,37 @@
</target>
</audits>
</childContainers>
+ <childContainers
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateCallBehaviorAction"
+ name="validateCallBehaviorAction"
+ description="Validate a call behavior action"/>
+ <childContainers
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateCallOperationAction"
+ name="validateCallOperationAction"
+ description="Validate a call operation action"/>
+ <childContainers
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateCallAction"
+ name="validateCallAction"
+ description="Validate a call action"/>
+ <childContainers
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateInvocationAction"
+ name="validateInvocationAction"
+ description="Validate an invocation action"/>
+ <childContainers
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateActivityNode"
+ name="validateActivityNode"
+ description="Validate an activity node"/>
+ <childContainers
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateRedefinableElement"
+ name="validateRedefinableElement"
+ description="Validate a redefineable element"/>
+ <childContainers
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateNamedElement"
+ name="validateNamedElement"
+ description="Validate a named element"/>
+ <childContainers
+ id="org.eclipse.uml2.uml.util.UMLValidator.validateElement"
+ name="validateElement"
+ description="Validate an element"/>
</audits>
</gmfmap:Mapping>
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmftool b/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmftool
index 640a8dfaba6..0186110e92f 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmftool
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmftool
@@ -9,18 +9,388 @@
<tools
xsi:type="gmftool:ToolGroup"
title="Objects">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/"/>
<tools
xsi:type="gmftool:CreationTool"
title="Initial node"
- description="Create an Initial node"/>
+ description="Create an Initial node">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/InitialNode.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/InitialNode.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
<tools
xsi:type="gmftool:CreationTool"
title="Activity final"
- description="Create an Activity final node"/>
+ description="Create an Activity final node">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/ActivityFinalNode.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/ActivityFinalNode.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
<tools
xsi:type="gmftool:CreationTool"
title="Flow final"
- description="Create a Flow final node"/>
+ description="Create a Flow final node">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/FlowFinalNode.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/FlowFinalNode.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ </tools>
+ <tools
+ xsi:type="gmftool:ToolGroup"
+ title="Actions">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/"/>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Opaque Action"
+ description="Create an Opaque Action node">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/OpaqueAction.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/OpaqueAction.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Call Behavior Action"
+ description="Create an Call Behavior Action node">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/CallBehaviorAction.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/CallBehaviorAction.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Call Operation Action"
+ description="Create a Call Operation Action node">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/CallOperationAction.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/CallOperationAction.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ </tools>
+ <tools
+ xsi:type="gmftool:ToolGroup"
+ title="Pins">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/"/>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Output Pin"
+ description="Create an Output Pin">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/OutputPin.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/OutputPin.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Input Pin"
+ description="Create an Input Pin">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/InputPin.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/InputPin.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Action Input Pin"
+ description="Create an Action Input Pin">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/ActionInputPin.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/ActionInputPin.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Value Pin"
+ description="Create a Value Pin">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/ValuePin.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/ValuePin.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ </tools>
+ <tools
+ xsi:type="gmftool:ToolGroup"
+ title="Edges">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/"/>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Control Flow"
+ description="Create a Control Flow">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/ControlFlow.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/ControlFlow.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Object Flow"
+ description="Create an Object Flow">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/ObjectFlow.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/ObjectFlow.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ </tools>
+ <tools
+ xsi:type="gmftool:ToolGroup"
+ title="Actions' Local Conditions">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/"/>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Local Precondition Constraint"
+ description="Create a Constraint as Local Precondition for an Action">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/Constraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/Constraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Local Precondition Interaction Constraint"
+ description="Create an Interaction Constraint as Local Precondition for an Action">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/InteractionConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/InteractionConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Local Precondition Interval Constraint"
+ description="Create an Interval Constraint as Local Precondition for an Action">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/IntervalConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/IntervalConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Local Precondition Duration Constraint"
+ description="Create a Duration Constraint as Local Precondition for an Action">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/DurationConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/DurationConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Local Precondition Time Constraint"
+ description="Create a Time Constraint as Local Precondition for an Action">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/TimeConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/TimeConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Local Postcondition Constraint"
+ description="Create a Constraint as Local Postcondition for an Action">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/Constraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/Constraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Local Postcondition Interaction Constraint"
+ description="Create an Interaction Constraint as Local Postcondition for an Action">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/InteractionConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/InteractionConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Local Postcondition Interval Constraint"
+ description="Create an Interval Constraint as Local Postcondition for an Action">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/IntervalConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/IntervalConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Local Postcondition Duration Constraint"
+ description="Create a Duration Constraint as Local Postcondition for an Action">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/DurationConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/DurationConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Local Postcondition Time Constraint"
+ description="Create a Time Constraint as Local Postcondition for an Action">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/TimeConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/TimeConstraint.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ </tools>
+ <tools
+ xsi:type="gmftool:ToolGroup"
+ title="Object Flows' Specifications">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/"/>
+ <tools
+ xsi:type="gmftool:GenericTool"
+ title="Selection Behavior"
+ description="Create a new Behavior or choose an exisitng one as Selection for an Object Flow"
+ toolClass="org.eclipse.papyrus.diagram.activity.edit.commands.CreateObjectFlowActivitySelection">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/Behavior.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/Behavior.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:GenericTool"
+ title="Transformation Behavior"
+ description="Create a new Behavior or choose an exisitng one as Transformation for an Object Flow"
+ toolClass="org.eclipse.papyrus.diagram.activity.edit.commands.CreateObjectFlowActivityTransformation">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/Behavior.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="icons/full/obj16/Behavior.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit/"/>
+ </tools>
</tools>
</palette>
</gmftool:ToolRegistry>
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.trace b/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.trace
index 540e61c6f4e..e6be4312152 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.trace
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/model/activityDiagram.trace
@@ -42,4 +42,214 @@
<childNodeTraces
visualID="3006"
queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'FlowFinalNode') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Activity') and _containmentMF_.name = 'node')"/>
+ <childNodeTraces
+ visualID="3007"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'OpaqueAction') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Activity') and _containmentMF_.name = 'node')">
+ <nodeLabelTraces
+ visualID="5003"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3008"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'CallBehaviorAction') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Activity') and _containmentMF_.name = 'node')">
+ <nodeLabelTraces
+ visualID="5004"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3010"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'CallOperationAction') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Activity') and _containmentMF_.name = 'node')">
+ <nodeLabelTraces
+ visualID="5006"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3011"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Constraint') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Action') and _containmentMF_.name = 'localPrecondition')">
+ <nodeLabelTraces
+ visualID="5007"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3012"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Constraint') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Action') and _containmentMF_.name = 'localPostcondition')">
+ <nodeLabelTraces
+ visualID="5008"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3013"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'InputPin') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'OpaqueAction') and _containmentMF_.name = 'inputValue')">
+ <nodeLabelTraces
+ visualID="5009"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3014"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'OutputPin') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'OpaqueAction') and _containmentMF_.name = 'outputValue')">
+ <nodeLabelTraces
+ visualID="5010"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3015"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'ValuePin') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'OpaqueAction') and _containmentMF_.name = 'inputValue')">
+ <nodeLabelTraces
+ visualID="5011"
+ queryText="true"/>
+ <nodeLabelTraces
+ visualID="5024"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3016"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'ActionInputPin') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'OpaqueAction') and _containmentMF_.name = 'inputValue')">
+ <nodeLabelTraces
+ visualID="5012"
+ queryText="true"/>
+ <nodeLabelTraces
+ visualID="5025"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3017"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'ValuePin') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'InvocationAction') and _containmentMF_.name = 'argument')">
+ <nodeLabelTraces
+ visualID="5013"
+ queryText="true"/>
+ <nodeLabelTraces
+ visualID="5026"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3018"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'ActionInputPin') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'InvocationAction') and _containmentMF_.name = 'argument')">
+ <nodeLabelTraces
+ visualID="5014"
+ queryText="true"/>
+ <nodeLabelTraces
+ visualID="5027"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3019"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'InputPin') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'InvocationAction') and _containmentMF_.name = 'argument')">
+ <nodeLabelTraces
+ visualID="5015"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3020"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'OutputPin') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'CallAction') and _containmentMF_.name = 'result')">
+ <nodeLabelTraces
+ visualID="5016"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3021"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'ActionInputPin') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'InvocationAction') and _containmentMF_.name = 'argument')">
+ <nodeLabelTraces
+ visualID="5017"
+ queryText="true"/>
+ <nodeLabelTraces
+ visualID="5028"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3022"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'ValuePin') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'InvocationAction') and _containmentMF_.name = 'argument')">
+ <nodeLabelTraces
+ visualID="5018"
+ queryText="true"/>
+ <nodeLabelTraces
+ visualID="5029"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3023"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'InputPin') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'InvocationAction') and _containmentMF_.name = 'argument')">
+ <nodeLabelTraces
+ visualID="5019"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3024"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'OutputPin') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'CallAction') and _containmentMF_.name = 'result')">
+ <nodeLabelTraces
+ visualID="5020"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3025"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'ValuePin') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'CallOperationAction') and _containmentMF_.name = 'target')">
+ <nodeLabelTraces
+ visualID="5021"
+ queryText="true"/>
+ <nodeLabelTraces
+ visualID="5030"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3026"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'ActionInputPin') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'CallOperationAction') and _containmentMF_.name = 'target')">
+ <nodeLabelTraces
+ visualID="5022"
+ queryText="true"/>
+ <nodeLabelTraces
+ visualID="5031"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3027"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'InputPin') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'CallOperationAction') and _containmentMF_.name = 'target')">
+ <nodeLabelTraces
+ visualID="5023"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3028"
+ queryText="let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Activity'">
+ <nodeLabelTraces
+ visualID="5032"
+ queryText="true"/>
+ </childNodeTraces>
+ <childNodeTraces
+ visualID="3029"
+ queryText="let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Activity'">
+ <nodeLabelTraces
+ visualID="5033"
+ queryText="true"/>
+ </childNodeTraces>
+ <linkTraces
+ visualID="4001"
+ queryText="modelFacet.oclIsKindOf(gmfgen::FeatureLinkModelFacet) and (let _feature_:ecore::EStructuralFeature = modelFacet.oclAsType(gmfgen::FeatureLinkModelFacet).metaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _feature_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Action') and _feature_.name = 'localPrecondition')"/>
+ <linkTraces
+ visualID="4002"
+ queryText="modelFacet.oclIsKindOf(gmfgen::FeatureLinkModelFacet) and (let _feature_:ecore::EStructuralFeature = modelFacet.oclAsType(gmfgen::FeatureLinkModelFacet).metaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _feature_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Action') and _feature_.name = 'localPostcondition')"/>
+ <linkTraces
+ visualID="4003"
+ queryText="modelFacet.oclIsKindOf(gmfgen::TypeLinkModelFacet) and (let _eClass_:ecore::EClass = modelFacet.oclAsType(gmfgen::TypeLinkModelFacet).metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'ObjectFlow')">
+ <linkLabelTraces
+ visualID="6001"
+ queryText="true"/>
+ <linkLabelTraces
+ visualID="6002"
+ queryText="true"/>
+ </linkTraces>
+ <linkTraces
+ visualID="4004"
+ queryText="modelFacet.oclIsKindOf(gmfgen::TypeLinkModelFacet) and (let _eClass_:ecore::EClass = modelFacet.oclAsType(gmfgen::TypeLinkModelFacet).metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'ControlFlow')">
+ <linkLabelTraces
+ visualID="6003"
+ queryText="true"/>
+ <linkLabelTraces
+ visualID="6004"
+ queryText="true"/>
+ </linkTraces>
+ <linkTraces
+ visualID="4005"
+ queryText="modelFacet.oclIsKindOf(gmfgen::FeatureLinkModelFacet) and (let _feature_:ecore::EStructuralFeature = modelFacet.oclAsType(gmfgen::FeatureLinkModelFacet).metaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _feature_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'ObjectFlow') and _feature_.name = 'selection')"/>
+ <linkTraces
+ visualID="4006"
+ queryText="modelFacet.oclIsKindOf(gmfgen::FeatureLinkModelFacet) and (let _feature_:ecore::EStructuralFeature = modelFacet.oclAsType(gmfgen::FeatureLinkModelFacet).metaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _feature_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'ObjectFlow') and _feature_.name = 'transformation')"/>
</trace:TraceModel>
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/plugin.properties b/plugins/uml/org.eclipse.papyrus.diagram.activity/plugin.properties
index 90575477218..751e6119f1e 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/plugin.properties
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/plugin.properties
@@ -60,3 +60,32 @@ metatype.name.Constraint_3003=Constraint
metatype.name.InitialNode_3004=InitialNode
metatype.name.ActivityFinalNode_3005=ActivityFinalNode
metatype.name.FlowFinalNode_3006=FlowFinalNode
+metatype.name.OpaqueAction_3007=OpaqueAction
+metatype.name.CallBehaviorAction_3008=CallBehaviorAction
+metatype.name.CallBehaviorAction_3009=CallBehaviorAction
+metatype.name.CallOperationAction_3010=CallOperationAction
+metatype.name.Constraint_3011=Constraint
+metatype.name.Constraint_3012=Constraint
+metatype.name.ActionLocalPrecondition_4001=Undefined
+metatype.name.ActionLocalPostcondition_4002=Undefined
+metatype.name.InputPin_3013=InputPin
+metatype.name.OutputPin_3014=OutputPin
+metatype.name.ValuePin_3015=ValuePin
+metatype.name.ActionInputPin_3016=ActionInputPin
+metatype.name.ValuePin_3017=ValuePin
+metatype.name.ActionInputPin_3018=ActionInputPin
+metatype.name.InputPin_3019=InputPin
+metatype.name.OutputPin_3020=OutputPin
+metatype.name.ActionInputPin_3021=ActionInputPin
+metatype.name.ValuePin_3022=ValuePin
+metatype.name.InputPin_3023=InputPin
+metatype.name.OutputPin_3024=OutputPin
+metatype.name.ValuePin_3025=ValuePin
+metatype.name.ActionInputPin_3026=ActionInputPin
+metatype.name.InputPin_3027=InputPin
+metatype.name.ObjectFlow_4003=ObjectFlow
+metatype.name.ControlFlow_4004=ControlFlow
+metatype.name.Activity_3028=Activity
+metatype.name.Activity_3029=Activity
+metatype.name.ObjectFlowSelection_4005=Undefined
+metatype.name.ObjectFlowTransformation_4006=Undefined
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/plugin.xml b/plugins/uml/org.eclipse.papyrus.diagram.activity/plugin.xml
index e23ae25ff55..0b26ceddbec 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/plugin.xml
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/plugin.xml
@@ -1,6 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
+ <extension point="org.eclipse.gmf.runtime.common.ui.services.action.contributionItemProviders">
+ <contributionItemProvider checkPluginLoaded="false" class="org.eclipse.papyrus.diagram.activity.providers.ActivityDiagramContributionItemProvider">
+ <Priority name="Low"/>
+ <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
+ <popupStructuredContributionCriteria objectClass="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"/>
+ <popupAction id="papyrus.restoreRelatedLinksAction" path="/navigateMenu/additions"/>
+ </popupContribution>
+ </contributionItemProvider>
+ </extension>
<extension
point="org.eclipse.ui.commands">
<command
@@ -206,9 +215,9 @@
id="createInitialnode1CreationTool"
kind="tool"
label="Initial node"
- large_icon=""
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InitialNode.gif"
path=""
- small_icon="">
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InitialNode.gif">
</entry>
<entry
defineOnly="true"
@@ -216,9 +225,9 @@
id="createActivityfinal2CreationTool"
kind="tool"
label="Activity final"
- large_icon=""
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ActivityFinalNode.gif"
path=""
- small_icon="">
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ActivityFinalNode.gif">
</entry>
<entry
defineOnly="true"
@@ -226,9 +235,139 @@
id="createFlowfinal3CreationTool"
kind="tool"
label="Flow final"
- large_icon=""
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/FlowFinalNode.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/FlowFinalNode.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an Opaque Action node"
+ id="createOpaqueAction1CreationTool"
+ kind="tool"
+ label="Opaque Action"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/OpaqueAction.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/OpaqueAction.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an Call Behavior Action node"
+ id="createCallBehaviorAction2CreationTool"
+ kind="tool"
+ label="Call Behavior Action"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/CallBehaviorAction.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/CallBehaviorAction.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Call Operation Action node"
+ id="createCallOperationAction3CreationTool"
+ kind="tool"
+ label="Call Operation Action"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/CallOperationAction.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/CallOperationAction.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an Output Pin"
+ id="createOutputPin1CreationTool"
+ kind="tool"
+ label="Output Pin"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/OutputPin.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/OutputPin.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an Input Pin"
+ id="createInputPin2CreationTool"
+ kind="tool"
+ label="Input Pin"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InputPin.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InputPin.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an Action Input Pin"
+ id="createActionInputPin3CreationTool"
+ kind="tool"
+ label="Action Input Pin"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ActionInputPin.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ActionInputPin.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Value Pin"
+ id="createValuePin4CreationTool"
+ kind="tool"
+ label="Value Pin"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ValuePin.gif"
path=""
- small_icon="">
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ValuePin.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Control Flow"
+ id="createControlFlow1CreationTool"
+ kind="tool"
+ label="Control Flow"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ControlFlow.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ControlFlow.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an Object Flow"
+ id="createObjectFlow2CreationTool"
+ kind="tool"
+ label="Object Flow"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ObjectFlow.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ObjectFlow.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Constraint as Local Precondition for an Action"
+ id="createLocalPreconditionConstraint1CreationTool"
+ kind="tool"
+ label="Local Precondition Constraint"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Constraint as Local Postcondition for an Action"
+ id="createLocalPostconditionConstraint6CreationTool"
+ kind="tool"
+ label="Local Postcondition Constraint"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a new Behavior or choose an exisitng one as Selection for an Object Flow"
+ id="createSelectionBehavior1CreationTool"
+ kind="tool"
+ label="Selection Behavior"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Behavior.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Behavior.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a new Behavior or choose an exisitng one as Transformation for an Object Flow"
+ id="createTransformationBehavior2CreationTool"
+ kind="tool"
+ label="Transformation Behavior"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Behavior.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Behavior.gif">
</entry>
</contribution>
@@ -256,9 +395,9 @@
id="createObjects1Group"
kind="drawer"
label="Objects"
- large_icon=""
+ large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
path="/"
- small_icon="">
+ small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
</entry>
<predefinedEntry
@@ -274,6 +413,145 @@
path="/createObjects1Group">
</predefinedEntry>
+ <entry
+ description=""
+ id="createActions2Group"
+ kind="drawer"
+ label="Actions"
+ large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ path="/"
+ small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ </entry>
+
+ <predefinedEntry
+ id="createOpaqueAction1CreationTool"
+ path="/createActions2Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createCallBehaviorAction2CreationTool"
+ path="/createActions2Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createCallOperationAction3CreationTool"
+ path="/createActions2Group">
+ </predefinedEntry>
+
+ <entry
+ description=""
+ id="createPins3Group"
+ kind="drawer"
+ label="Pins"
+ large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ path="/"
+ small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ </entry>
+
+ <predefinedEntry
+ id="createOutputPin1CreationTool"
+ path="/createPins3Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createInputPin2CreationTool"
+ path="/createPins3Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createActionInputPin3CreationTool"
+ path="/createPins3Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createValuePin4CreationTool"
+ path="/createPins3Group">
+ </predefinedEntry>
+
+ <entry
+ description=""
+ id="createEdges4Group"
+ kind="drawer"
+ label="Edges"
+ large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ path="/"
+ small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ </entry>
+
+ <predefinedEntry
+ id="createControlFlow1CreationTool"
+ path="/createEdges4Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createObjectFlow2CreationTool"
+ path="/createEdges4Group">
+ </predefinedEntry>
+
+ <entry
+ description=""
+ id="createActionsLocalConditions5Group"
+ kind="drawer"
+ label="Actions' Local Conditions"
+ large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ path="/"
+ small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ </entry>
+
+ <predefinedEntry
+ id="createLocalPreconditionConstraint1CreationTool"
+ path="/createActionsLocalConditions5Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createLocalPreconditionInteractionConstraint2CreationTool"
+ path="/createActionsLocalConditions5Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createLocalPreconditionIntervalConstraint3CreationTool"
+ path="/createActionsLocalConditions5Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createLocalPreconditionDurationConstraint4CreationTool"
+ path="/createActionsLocalConditions5Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createLocalPreconditionTimeConstraint5CreationTool"
+ path="/createActionsLocalConditions5Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createLocalPostconditionConstraint6CreationTool"
+ path="/createActionsLocalConditions5Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createLocalPostconditionInteractionConstraint7CreationTool"
+ path="/createActionsLocalConditions5Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createLocalPostconditionIntervalConstraint8CreationTool"
+ path="/createActionsLocalConditions5Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createLocalPostconditionDurationConstraint9CreationTool"
+ path="/createActionsLocalConditions5Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createLocalPostconditionTimeConstraint10CreationTool"
+ path="/createActionsLocalConditions5Group">
+ </predefinedEntry>
+
+ <entry
+ description=""
+ id="createObjectFlowsSpecifications6Group"
+ kind="drawer"
+ label="Object Flows' Specifications"
+ large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ path="/"
+ small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ </entry>
+
+ <predefinedEntry
+ id="createSelectionBehavior1CreationTool"
+ path="/createObjectFlowsSpecifications6Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createTransformationBehavior2CreationTool"
+ path="/createObjectFlowsSpecifications6Group">
+ </predefinedEntry>
+
</contribution>
<editor id="org.eclipse.papyrus.diagram.activity"/>
@@ -379,9 +657,9 @@
<?gmfgen generated="true"?>
<page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLActivityDiagram"
- class="org.eclipse.papyrus.diagram.activity.preferences.ActivityPreferencePage"
- id="org.eclipse.papyrus.diagram.activity.preferences.ActivityPreferencePage"
- name="Activity" />
+ class="org.eclipse.papyrus.diagram.activity.preferences.OpaqueActionPreferencePage"
+ id="org.eclipse.papyrus.diagram.activity.preferences.OpaqueActionPreferencePage"
+ name="OpaqueAction" />
<?gmfgen generated="true"?>
@@ -393,6 +671,20 @@
<?gmfgen generated="true"?>
<page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLActivityDiagram"
+ class="org.eclipse.papyrus.diagram.activity.preferences.CallBehaviorActionPreferencePage"
+ id="org.eclipse.papyrus.diagram.activity.preferences.CallBehaviorActionPreferencePage"
+ name="CallBehaviorAction" />
+
+
+ <?gmfgen generated="true"?>
+ <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLActivityDiagram"
+ class="org.eclipse.papyrus.diagram.activity.preferences.OutputPinPreferencePage"
+ id="org.eclipse.papyrus.diagram.activity.preferences.OutputPinPreferencePage"
+ name="OutputPin" />
+
+
+ <?gmfgen generated="true"?>
+ <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLActivityDiagram"
class="org.eclipse.papyrus.diagram.activity.preferences.FlowFinalNodePreferencePage"
id="org.eclipse.papyrus.diagram.activity.preferences.FlowFinalNodePreferencePage"
name="FlowFinalNode" />
@@ -414,12 +706,62 @@
<?gmfgen generated="true"?>
<page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLActivityDiagram"
+ class="org.eclipse.papyrus.diagram.activity.preferences.ActivityPreferencePage"
+ id="org.eclipse.papyrus.diagram.activity.preferences.ActivityPreferencePage"
+ name="Activity" />
+
+
+ <?gmfgen generated="true"?>
+ <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLActivityDiagram"
+ class="org.eclipse.papyrus.diagram.activity.preferences.InputPinPreferencePage"
+ id="org.eclipse.papyrus.diagram.activity.preferences.InputPinPreferencePage"
+ name="InputPin" />
+
+
+ <?gmfgen generated="true"?>
+ <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLActivityDiagram"
+ class="org.eclipse.papyrus.diagram.activity.preferences.ValuePinPreferencePage"
+ id="org.eclipse.papyrus.diagram.activity.preferences.ValuePinPreferencePage"
+ name="ValuePin" />
+
+
+ <?gmfgen generated="true"?>
+ <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLActivityDiagram"
+ class="org.eclipse.papyrus.diagram.activity.preferences.CallOperationActionPreferencePage"
+ id="org.eclipse.papyrus.diagram.activity.preferences.CallOperationActionPreferencePage"
+ name="CallOperationAction" />
+
+
+ <?gmfgen generated="true"?>
+ <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLActivityDiagram"
+ class="org.eclipse.papyrus.diagram.activity.preferences.ActionInputPinPreferencePage"
+ id="org.eclipse.papyrus.diagram.activity.preferences.ActionInputPinPreferencePage"
+ name="ActionInputPin" />
+
+
+ <?gmfgen generated="true"?>
+ <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLActivityDiagram"
class="org.eclipse.papyrus.diagram.activity.preferences.ParameterPreferencePage"
id="org.eclipse.papyrus.diagram.activity.preferences.ParameterPreferencePage"
name="Parameter" />
+
+ <?gmfgen generated="true"?>
+ <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLActivityDiagram"
+ class="org.eclipse.papyrus.diagram.activity.preferences.ObjectFlowPreferencePage"
+ id="org.eclipse.papyrus.diagram.activity.preferences.ObjectFlowPreferencePage"
+ name="ObjectFlow" />
+
+
+
+ <?gmfgen generated="true"?>
+ <page category="org.eclipse.papyrus.preferences.diagrams.PapyrusUMLActivityDiagram"
+ class="org.eclipse.papyrus.diagram.activity.preferences.ControlFlowPreferencePage"
+ id="org.eclipse.papyrus.diagram.activity.preferences.ControlFlowPreferencePage"
+ name="ControlFlow" />
+
</extension>
@@ -433,8 +775,8 @@
<viewProvider class="org.eclipse.papyrus.diagram.activity.providers.UMLViewProvider">
<Priority name="Lowest"/>
<context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="PapyrusUMLActivityDiagram"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="2001,3001,3002,3003,3004,3005,3006"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints=""/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="2001,3001,3002,3003,3004,3005,3006,3007,3015,3016,3013,3014,3008,3017,3018,3019,3020,3010,3021,3022,3023,3024,3025,3026,3027,3011,3012,3028,3029"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4001,4002,4005,4006,4003,4004"/>
</viewProvider>
</extension>
@@ -446,13 +788,13 @@
<method name="getType()" value="PapyrusUMLActivityDiagram"/>
</object>
<object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
- <method name="getType()" value="2001,3001,3002,3003,3004,3005,3006"/>
+ <method name="getType()" value="2001,3001,3002,3003,3004,3005,3006,3007,3015,3016,3013,3014,3008,3017,3018,3019,3020,3010,3021,3022,3023,3024,3025,3026,3027,3011,3012,3028,3029"/>
</object>
<object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
- <method name="getType()" value=""/>
+ <method name="getType()" value="4001,4002,4005,4006,4003,4004"/>
</object>
<object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
- <method name="getType()" value="5001,5002"/>
+ <method name="getType()" value="5001,5002,5003,5011,5024,5012,5025,5009,5010,5004,5013,5026,5014,5027,5015,5016,5006,5017,5028,5018,5029,5019,5020,5021,5030,5022,5031,5023,5007,5008,5032,5033"/>
</object>
<object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
<method name="getType()" value="7001,7002,7003,7004"/>
@@ -566,6 +908,267 @@
<param name="semanticHint" value="3006"/>
</metamodelType>
</metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.diagram.activity.OpaqueAction_3007"
+ name="%metatype.name.OpaqueAction_3007"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="OpaqueAction"
+ edithelper="org.eclipse.papyrus.diagram.activity.edit.helpers.OpaqueActionEditHelper">
+ <param name="semanticHint" value="3007"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.diagram.activity.ValuePin_3015"
+ name="%metatype.name.ValuePin_3015"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="ValuePin"
+ edithelper="org.eclipse.papyrus.diagram.activity.edit.helpers.ValuePinEditHelper">
+ <param name="semanticHint" value="3015"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.diagram.activity.ActionInputPin_3016"
+ name="%metatype.name.ActionInputPin_3016"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="ActionInputPin"
+ edithelper="org.eclipse.papyrus.diagram.activity.edit.helpers.ActionInputPinEditHelper">
+ <param name="semanticHint" value="3016"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.diagram.activity.InputPin_3013"
+ name="%metatype.name.InputPin_3013"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="InputPin"
+ edithelper="org.eclipse.papyrus.diagram.activity.edit.helpers.InputPinEditHelper">
+ <param name="semanticHint" value="3013"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.diagram.activity.OutputPin_3014"
+ name="%metatype.name.OutputPin_3014"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="OutputPin"
+ edithelper="org.eclipse.papyrus.diagram.activity.edit.helpers.OutputPinEditHelper">
+ <param name="semanticHint" value="3014"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.diagram.activity.CallBehaviorAction_3008"
+ name="%metatype.name.CallBehaviorAction_3008"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="CallBehaviorAction"
+ edithelper="org.eclipse.papyrus.diagram.activity.edit.helpers.CallBehaviorActionEditHelper">
+ <param name="semanticHint" value="3008"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.ValuePin_3017"
+ name="%metatype.name.ValuePin_3017"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.diagram.activity.ValuePin_3015"/>
+ <param name="semanticHint" value="3017"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.ActionInputPin_3018"
+ name="%metatype.name.ActionInputPin_3018"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.diagram.activity.ActionInputPin_3016"/>
+ <param name="semanticHint" value="3018"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.InputPin_3019"
+ name="%metatype.name.InputPin_3019"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.diagram.activity.InputPin_3013"/>
+ <param name="semanticHint" value="3019"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.OutputPin_3020"
+ name="%metatype.name.OutputPin_3020"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.diagram.activity.OutputPin_3014"/>
+ <param name="semanticHint" value="3020"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.diagram.activity.CallOperationAction_3010"
+ name="%metatype.name.CallOperationAction_3010"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="CallOperationAction"
+ edithelper="org.eclipse.papyrus.diagram.activity.edit.helpers.CallOperationActionEditHelper">
+ <param name="semanticHint" value="3010"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.ActionInputPin_3021"
+ name="%metatype.name.ActionInputPin_3021"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.diagram.activity.ActionInputPin_3016"/>
+ <param name="semanticHint" value="3021"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.ValuePin_3022"
+ name="%metatype.name.ValuePin_3022"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.diagram.activity.ValuePin_3015"/>
+ <param name="semanticHint" value="3022"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.InputPin_3023"
+ name="%metatype.name.InputPin_3023"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.diagram.activity.InputPin_3013"/>
+ <param name="semanticHint" value="3023"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.OutputPin_3024"
+ name="%metatype.name.OutputPin_3024"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.diagram.activity.OutputPin_3014"/>
+ <param name="semanticHint" value="3024"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.ValuePin_3025"
+ name="%metatype.name.ValuePin_3025"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.diagram.activity.ValuePin_3015"/>
+ <param name="semanticHint" value="3025"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.ActionInputPin_3026"
+ name="%metatype.name.ActionInputPin_3026"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.diagram.activity.ActionInputPin_3016"/>
+ <param name="semanticHint" value="3026"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.InputPin_3027"
+ name="%metatype.name.InputPin_3027"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.diagram.activity.InputPin_3013"/>
+ <param name="semanticHint" value="3027"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.Constraint_3011"
+ name="%metatype.name.Constraint_3011"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.diagram.activity.Constraint_3002"/>
+ <param name="semanticHint" value="3011"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.Constraint_3012"
+ name="%metatype.name.Constraint_3012"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.diagram.activity.Constraint_3002"/>
+ <param name="semanticHint" value="3012"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.Activity_3028"
+ name="%metatype.name.Activity_3028"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.diagram.activity.Activity_2001"/>
+ <param name="semanticHint" value="3028"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.Activity_3029"
+ name="%metatype.name.Activity_3029"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.diagram.activity.Activity_2001"/>
+ <param name="semanticHint" value="3029"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.ActionLocalPrecondition_4001"
+ name="%metatype.name.ActionLocalPrecondition_4001"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
+ <param name="semanticHint" value="4001"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.ActionLocalPostcondition_4002"
+ name="%metatype.name.ActionLocalPostcondition_4002"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
+ <param name="semanticHint" value="4002"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.ObjectFlowSelection_4005"
+ name="%metatype.name.ObjectFlowSelection_4005"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
+ <param name="semanticHint" value="4005"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.diagram.activity.ObjectFlowTransformation_4006"
+ name="%metatype.name.ObjectFlowTransformation_4006"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
+ <param name="semanticHint" value="4006"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.diagram.activity.ObjectFlow_4003"
+ name="%metatype.name.ObjectFlow_4003"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="ObjectFlow"
+ edithelper="org.eclipse.papyrus.diagram.activity.edit.helpers.ObjectFlowEditHelper">
+ <param name="semanticHint" value="4003"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.diagram.activity.ControlFlow_4004"
+ name="%metatype.name.ControlFlow_4004"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="ControlFlow"
+ edithelper="org.eclipse.papyrus.diagram.activity.edit.helpers.ControlFlowEditHelper">
+ <param name="semanticHint" value="4004"/>
+ </metamodelType>
+ </metamodel>
</extension>
<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
@@ -586,6 +1189,34 @@
<elementType ref="org.eclipse.papyrus.diagram.activity.InitialNode_3004"/>
<elementType ref="org.eclipse.papyrus.diagram.activity.ActivityFinalNode_3005"/>
<elementType ref="org.eclipse.papyrus.diagram.activity.FlowFinalNode_3006"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.OpaqueAction_3007"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.ValuePin_3015"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.ActionInputPin_3016"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.InputPin_3013"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.OutputPin_3014"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.CallBehaviorAction_3008"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.ValuePin_3017"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.ActionInputPin_3018"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.InputPin_3019"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.OutputPin_3020"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.CallOperationAction_3010"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.ActionInputPin_3021"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.ValuePin_3022"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.InputPin_3023"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.OutputPin_3024"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.ValuePin_3025"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.ActionInputPin_3026"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.InputPin_3027"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.Constraint_3011"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.Constraint_3012"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.Activity_3028"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.Activity_3029"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.ActionLocalPrecondition_4001"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.ActionLocalPostcondition_4002"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.ObjectFlowSelection_4005"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.ObjectFlowTransformation_4006"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.ObjectFlow_4003"/>
+ <elementType ref="org.eclipse.papyrus.diagram.activity.ControlFlow_4004"/>
<advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
</binding>
</extension>
@@ -768,7 +1399,7 @@
<persistent value="true"/>
</extension><extension point="org.eclipse.emf.validation.constraintProviders">
<?gmfgen generated="true"?>
- <category id="org.eclipse.uml2.uml.util.UMLValidator.validate" mandatory="false" name="validateNoIncomingEdges">
+ <category id="org.eclipse.uml2.uml.util.UMLValidator.validate" mandatory="false" name="validateUMLModel">
<![CDATA[Validate the UML model]]>
</category>
<category id="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateInitialNode" mandatory="false" name="validateInitialNode">
@@ -777,6 +1408,30 @@
<category id="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateFinalNode" mandatory="false" name="validateFinalNode">
<![CDATA[Validate a final node]]>
</category>
+ <category id="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateCallBehaviorAction" mandatory="false" name="validateCallBehaviorAction">
+ <![CDATA[Validate a call behavior action]]>
+ </category>
+ <category id="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateCallOperationAction" mandatory="false" name="validateCallOperationAction">
+ <![CDATA[Validate a call operation action]]>
+ </category>
+ <category id="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateCallAction" mandatory="false" name="validateCallAction">
+ <![CDATA[Validate a call action]]>
+ </category>
+ <category id="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateInvocationAction" mandatory="false" name="validateInvocationAction">
+ <![CDATA[Validate an invocation action]]>
+ </category>
+ <category id="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateActivityNode" mandatory="false" name="validateActivityNode">
+ <![CDATA[Validate an activity node]]>
+ </category>
+ <category id="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateRedefinableElement" mandatory="false" name="validateRedefinableElement">
+ <![CDATA[Validate a redefineable element]]>
+ </category>
+ <category id="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateNamedElement" mandatory="false" name="validateNamedElement">
+ <![CDATA[Validate a named element]]>
+ </category>
+ <category id="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateElement" mandatory="false" name="validateElement">
+ <![CDATA[Validate an element]]>
+ </category>
<constraintProvider cache="true">
<package namespaceUri="http://www.eclipse.org/uml2/3.0.0/UML"/>
<constraints categories="org.eclipse.uml2.uml.util.UMLValidator.validate">
@@ -815,6 +1470,22 @@
<target class="uml.FinalNode"/>
</constraint>
</constraints>
+ <constraints categories="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateCallBehaviorAction">
+ </constraints>
+ <constraints categories="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateCallOperationAction">
+ </constraints>
+ <constraints categories="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateCallAction">
+ </constraints>
+ <constraints categories="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateInvocationAction">
+ </constraints>
+ <constraints categories="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateActivityNode">
+ </constraints>
+ <constraints categories="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateRedefinableElement">
+ </constraints>
+ <constraints categories="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateNamedElement">
+ </constraints>
+ <constraints categories="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateElement">
+ </constraints>
</constraintProvider>
</extension>
@@ -830,6 +1501,45 @@
</binding>
</extension>
+
+<extension point="org.eclipse.emf.validation.constraintProviders">
+ <?gmfgen generated="false"?>
+ <category id="org.eclipse.uml2.uml.util.UMLValidator.validate/pinAndParameterSynchronization" mandatory="false" name="validatePinAndParameterSynchronization">
+ <![CDATA[Validate that Pin and corresponding Parameter are correctly synchronized]]>
+ </category>
+ <constraintProvider cache="true">
+ <package namespaceUri="http://www.eclipse.org/uml2/3.0.0/UML"/>
+ <constraints categories="org.eclipse.uml2.uml.util.UMLValidator.validate/pinAndParameterSynchronization">
+ <constraint id="org.eclipse.papyrus.diagram.activity.helper.PinAndParameterSynchronizer"
+ lang="Java"
+ name="PinAndParameterSynchronizer"
+ class="org.eclipse.papyrus.diagram.activity.helper.PinAndParameterSynchronizer"
+ mode="Live"
+ severity="ERROR" statusCode="200">
+ <description><![CDATA[Action's Pins and invoked object's Parameters are synchronized]]></description>
+ <message><![CDATA[Action's Pins must correspond to the called object's Parameters]]></message>
+ <target class="uml.Pin"/>
+ <target class="uml.Parameter"/>
+ <target class="uml.CallOperationAction"/>
+ <target class="uml.Operation"/>
+ <target class="uml.CallBehaviorAction"/>
+ <target class="uml.Behavior"/>
+ <target class="uml.ValueSpecification"/>
+ </constraint>
+ </constraints>
+ </constraintProvider>
+ </extension>
+
+<extension point="org.eclipse.emf.validation.constraintBindings">
+ <?gmfgen generated="false"?>
+ <clientContext default="false" id="org.eclipse.papyrus.diagram.activityDefaultCtx">
+ <selector class="org.eclipse.papyrus.diagram.activity.providers.UMLValidationProvider$DefaultCtx"/>
+ </clientContext>
+ <binding context="org.eclipse.papyrus.diagram.activityDefaultCtx">
+ <constraint ref="org.eclipse.papyrus.diagram.activity.helper.PinAndParameterSynchronizer"/>
+ </binding>
+
+ </extension>
<!-- optionally, specify keybindings -->
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInCallBeActCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInCallBeActCreateCommand.java
new file mode 100644
index 00000000000..d922e869438
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInCallBeActCreateCommand.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.ActionInputPin;
+import org.eclipse.uml2.uml.InvocationAction;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInCallBeActCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCallBeActCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static ActionInputPinInCallBeActCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new ActionInputPinInCallBeActCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCallBeActCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ ActionInputPin newElement = UMLFactory.eINSTANCE.createActionInputPin();
+
+ InvocationAction owner = (InvocationAction)getElementToEdit();
+ owner.getArguments().add(newElement);
+
+
+ UMLElementTypes.init_ActionInputPin_3018(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(ActionInputPin newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInCallOpActAsTargetCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInCallOpActAsTargetCreateCommand.java
new file mode 100644
index 00000000000..9602c485900
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInCallOpActAsTargetCreateCommand.java
@@ -0,0 +1,138 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.ActionInputPin;
+import org.eclipse.uml2.uml.CallOperationAction;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInCallOpActAsTargetCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCallOpActAsTargetCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static ActionInputPinInCallOpActAsTargetCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new ActionInputPinInCallOpActAsTargetCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCallOpActAsTargetCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ CallOperationAction container = (CallOperationAction)getElementToEdit();
+ if(container.getTarget() != null) {
+ return false;
+ }
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ ActionInputPin newElement = UMLFactory.eINSTANCE.createActionInputPin();
+
+ CallOperationAction owner = (CallOperationAction)getElementToEdit();
+ owner.setTarget(newElement);
+
+
+ UMLElementTypes.init_ActionInputPin_3026(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(ActionInputPin newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInCallOpActCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInCallOpActCreateCommand.java
new file mode 100644
index 00000000000..be59d6b5514
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInCallOpActCreateCommand.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.ActionInputPin;
+import org.eclipse.uml2.uml.InvocationAction;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInCallOpActCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCallOpActCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static ActionInputPinInCallOpActCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new ActionInputPinInCallOpActCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCallOpActCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ ActionInputPin newElement = UMLFactory.eINSTANCE.createActionInputPin();
+
+ InvocationAction owner = (InvocationAction)getElementToEdit();
+ owner.getArguments().add(newElement);
+
+
+ UMLElementTypes.init_ActionInputPin_3021(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(ActionInputPin newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInOpaqueActCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInOpaqueActCreateCommand.java
new file mode 100644
index 00000000000..8a0d447a11e
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionInputPinInOpaqueActCreateCommand.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.ActionInputPin;
+import org.eclipse.uml2.uml.OpaqueAction;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInOpaqueActCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInOpaqueActCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static ActionInputPinInOpaqueActCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new ActionInputPinInOpaqueActCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInOpaqueActCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ ActionInputPin newElement = UMLFactory.eINSTANCE.createActionInputPin();
+
+ OpaqueAction owner = (OpaqueAction)getElementToEdit();
+ owner.getInputValues().add(newElement);
+
+
+ UMLElementTypes.init_ActionInputPin_3016(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(ActionInputPin newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPostconditionCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPostconditionCreateCommand.java
new file mode 100644
index 00000000000..cb145195886
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPostconditionCreateCommand.java
@@ -0,0 +1,109 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLBaseItemSemanticEditPolicy;
+import org.eclipse.uml2.uml.Action;
+import org.eclipse.uml2.uml.Constraint;
+
+/**
+ * @generated
+ */
+public class ActionLocalPostconditionCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private final EObject source;
+
+ /**
+ * @generated
+ */
+ private final EObject target;
+
+ /**
+ * @generated
+ */
+ public ActionLocalPostconditionCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
+ super(request.getLabel(), null, request);
+ this.source = source;
+ this.target = target;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ if(source == null && target == null) {
+ return false;
+ }
+ if(source != null && false == source instanceof Action) {
+ return false;
+ }
+ if(target != null && false == target instanceof Constraint) {
+ return false;
+ }
+ if(getSource() == null) {
+ return true; // link creation is in progress; source is not defined yet
+ }
+ // target may be null here but it's possible to check constraint
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canCreateActionLocalPostcondition_4002(getSource(), getTarget());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(!canExecute()) {
+ throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
+ }
+
+ if(getSource() != null && getTarget() != null) {
+ getSource().getLocalPostconditions().add(getTarget());
+ }
+ return CommandResult.newOKCommandResult();
+
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void setElementToEdit(EObject element) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @generated
+ */
+ protected Action getSource() {
+ return (Action)source;
+ }
+
+ /**
+ * @generated
+ */
+ protected Constraint getTarget() {
+ return (Constraint)target;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPostconditionReorientCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPostconditionReorientCommand.java
new file mode 100644
index 00000000000..96abe68ee36
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPostconditionReorientCommand.java
@@ -0,0 +1,161 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLBaseItemSemanticEditPolicy;
+import org.eclipse.uml2.uml.Action;
+import org.eclipse.uml2.uml.Constraint;
+
+/**
+ * @generated
+ */
+public class ActionLocalPostconditionReorientCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private final int reorientDirection;
+
+ /**
+ * @generated
+ */
+ private final EObject referenceOwner;
+
+ /**
+ * @generated
+ */
+ private final EObject oldEnd;
+
+ /**
+ * @generated
+ */
+ private final EObject newEnd;
+
+ /**
+ * @generated
+ */
+ public ActionLocalPostconditionReorientCommand(ReorientReferenceRelationshipRequest request) {
+ super(request.getLabel(), null, request);
+ reorientDirection = request.getDirection();
+ referenceOwner = request.getReferenceOwner();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ if(false == referenceOwner instanceof Action) {
+ return false;
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ return canReorientSource();
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ return canReorientTarget();
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientSource() {
+ if(!(oldEnd instanceof Constraint && newEnd instanceof Action)) {
+ return false;
+ }
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canExistActionLocalPostcondition_4002(getNewSource(), getOldTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientTarget() {
+ if(!(oldEnd instanceof Constraint && newEnd instanceof Constraint)) {
+ return false;
+ }
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canExistActionLocalPostcondition_4002(getOldSource(), getNewTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(!canExecute()) {
+ throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ return reorientSource();
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ return reorientTarget();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientSource() throws ExecutionException {
+ getOldSource().getLocalPostconditions().remove(getOldTarget());
+ getNewSource().getLocalPostconditions().add(getOldTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientTarget() throws ExecutionException {
+ getOldSource().getLocalPostconditions().remove(getOldTarget());
+ getOldSource().getLocalPostconditions().add(getNewTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected Action getOldSource() {
+ return (Action)referenceOwner;
+ }
+
+ /**
+ * @generated
+ */
+ protected Action getNewSource() {
+ return (Action)newEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected Constraint getOldTarget() {
+ return (Constraint)oldEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected Constraint getNewTarget() {
+ return (Constraint)newEnd;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPreconditionCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPreconditionCreateCommand.java
new file mode 100644
index 00000000000..01140deda78
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPreconditionCreateCommand.java
@@ -0,0 +1,109 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLBaseItemSemanticEditPolicy;
+import org.eclipse.uml2.uml.Action;
+import org.eclipse.uml2.uml.Constraint;
+
+/**
+ * @generated
+ */
+public class ActionLocalPreconditionCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private final EObject source;
+
+ /**
+ * @generated
+ */
+ private final EObject target;
+
+ /**
+ * @generated
+ */
+ public ActionLocalPreconditionCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
+ super(request.getLabel(), null, request);
+ this.source = source;
+ this.target = target;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ if(source == null && target == null) {
+ return false;
+ }
+ if(source != null && false == source instanceof Action) {
+ return false;
+ }
+ if(target != null && false == target instanceof Constraint) {
+ return false;
+ }
+ if(getSource() == null) {
+ return true; // link creation is in progress; source is not defined yet
+ }
+ // target may be null here but it's possible to check constraint
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canCreateActionLocalPrecondition_4001(getSource(), getTarget());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(!canExecute()) {
+ throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
+ }
+
+ if(getSource() != null && getTarget() != null) {
+ getSource().getLocalPreconditions().add(getTarget());
+ }
+ return CommandResult.newOKCommandResult();
+
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void setElementToEdit(EObject element) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @generated
+ */
+ protected Action getSource() {
+ return (Action)source;
+ }
+
+ /**
+ * @generated
+ */
+ protected Constraint getTarget() {
+ return (Constraint)target;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPreconditionReorientCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPreconditionReorientCommand.java
new file mode 100644
index 00000000000..6de11a53be0
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActionLocalPreconditionReorientCommand.java
@@ -0,0 +1,161 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLBaseItemSemanticEditPolicy;
+import org.eclipse.uml2.uml.Action;
+import org.eclipse.uml2.uml.Constraint;
+
+/**
+ * @generated
+ */
+public class ActionLocalPreconditionReorientCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private final int reorientDirection;
+
+ /**
+ * @generated
+ */
+ private final EObject referenceOwner;
+
+ /**
+ * @generated
+ */
+ private final EObject oldEnd;
+
+ /**
+ * @generated
+ */
+ private final EObject newEnd;
+
+ /**
+ * @generated
+ */
+ public ActionLocalPreconditionReorientCommand(ReorientReferenceRelationshipRequest request) {
+ super(request.getLabel(), null, request);
+ reorientDirection = request.getDirection();
+ referenceOwner = request.getReferenceOwner();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ if(false == referenceOwner instanceof Action) {
+ return false;
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ return canReorientSource();
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ return canReorientTarget();
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientSource() {
+ if(!(oldEnd instanceof Constraint && newEnd instanceof Action)) {
+ return false;
+ }
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canExistActionLocalPrecondition_4001(getNewSource(), getOldTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientTarget() {
+ if(!(oldEnd instanceof Constraint && newEnd instanceof Constraint)) {
+ return false;
+ }
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canExistActionLocalPrecondition_4001(getOldSource(), getNewTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(!canExecute()) {
+ throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ return reorientSource();
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ return reorientTarget();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientSource() throws ExecutionException {
+ getOldSource().getLocalPreconditions().remove(getOldTarget());
+ getNewSource().getLocalPreconditions().add(getOldTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientTarget() throws ExecutionException {
+ getOldSource().getLocalPreconditions().remove(getOldTarget());
+ getOldSource().getLocalPreconditions().add(getNewTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected Action getOldSource() {
+ return (Action)referenceOwner;
+ }
+
+ /**
+ * @generated
+ */
+ protected Action getNewSource() {
+ return (Action)newEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected Constraint getOldTarget() {
+ return (Constraint)oldEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected Constraint getNewTarget() {
+ return (Constraint)newEnd;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActivityAsSelectionCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActivityAsSelectionCreateCommand.java
new file mode 100644
index 00000000000..76df4202301
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActivityAsSelectionCreateCommand.java
@@ -0,0 +1,136 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.ObjectFlow;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class ActivityAsSelectionCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public ActivityAsSelectionCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static ActivityAsSelectionCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new ActivityAsSelectionCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public ActivityAsSelectionCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated NOT this command is fake for generation and disabled
+ */
+ public boolean canExecute() {
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ Activity newElement = UMLFactory.eINSTANCE.createActivity();
+
+ Package owner = (Package)getElementToEdit();
+ owner.getPackagedElements().add(newElement);
+ ObjectFlow childHolder = (ObjectFlow)getElementToEdit();
+ childHolder.setSelection(newElement);
+
+
+ UMLElementTypes.init_Activity_3028(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(Activity newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActivityAsTransformationCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActivityAsTransformationCreateCommand.java
new file mode 100644
index 00000000000..f48ded7b853
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActivityAsTransformationCreateCommand.java
@@ -0,0 +1,136 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.ObjectFlow;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class ActivityAsTransformationCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public ActivityAsTransformationCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static ActivityAsTransformationCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new ActivityAsTransformationCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public ActivityAsTransformationCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated NOT this command is fake for generation and disabled
+ */
+ public boolean canExecute() {
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ Activity newElement = UMLFactory.eINSTANCE.createActivity();
+
+ Package owner = (Package)getElementToEdit();
+ owner.getPackagedElements().add(newElement);
+ ObjectFlow childHolder = (ObjectFlow)getElementToEdit();
+ childHolder.setTransformation(newElement);
+
+
+ UMLElementTypes.init_Activity_3029(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(Activity newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActivityFinalNodeCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActivityFinalNodeCreateCommand.java
index 8883dc4ca1d..4a91c1eeba0 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActivityFinalNodeCreateCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ActivityFinalNodeCreateCommand.java
@@ -25,6 +25,7 @@ import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
import org.eclipse.uml2.uml.Activity;
import org.eclipse.uml2.uml.ActivityFinalNode;
import org.eclipse.uml2.uml.UMLFactory;
@@ -105,6 +106,7 @@ public class ActivityFinalNodeCreateCommand extends EditElementCommand {
owner.getNodes().add(newElement);
+ UMLElementTypes.init_ActivityFinalNode_3005(newElement);
doConfigure(newElement, monitor, info);
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/CallBehaviorActionCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/CallBehaviorActionCreateCommand.java
new file mode 100644
index 00000000000..3edecd267d1
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/CallBehaviorActionCreateCommand.java
@@ -0,0 +1,151 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallBehaviorActionDialog;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+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.UMLFactory;
+
+/**
+ * @generated
+ */
+public class CallBehaviorActionCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public CallBehaviorActionCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static CallBehaviorActionCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new CallBehaviorActionCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public CallBehaviorActionCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated NOT use the initialization popup
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ Activity owner = (Activity)getElementToEdit();
+
+ CallBehaviorAction newElement = UMLFactory.eINSTANCE.createCallBehaviorAction();
+
+ CreateCallBehaviorActionDialog dialog = new CreateCallBehaviorActionDialog(Display.getDefault().getActiveShell(), owner);
+ if(IDialogConstants.OK_ID == dialog.open()) {
+ // initialize the invoked element (no need to use a command, since action is being created)
+ EObject behavior = dialog.getSelectedInvoked();
+ if(behavior instanceof Behavior) {
+ newElement.setBehavior((Behavior)behavior);
+ }
+ // initialize synchronous
+ newElement.setIsSynchronous(dialog.getIsSynchronous());
+ } else {
+ return CommandResult.newCancelledCommandResult();
+ }
+
+ owner.getNodes().add(newElement);
+
+
+ UMLElementTypes.init_CallBehaviorAction_3008(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(CallBehaviorAction newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/CallOperationActionCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/CallOperationActionCreateCommand.java
new file mode 100644
index 00000000000..2dca6a44af0
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/CallOperationActionCreateCommand.java
@@ -0,0 +1,151 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.papyrus.diagram.activity.edit.dialogs.CreateCallOperationActionDialog;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.CallOperationAction;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class CallOperationActionCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public CallOperationActionCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static CallOperationActionCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new CallOperationActionCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public CallOperationActionCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated NOT use the initialization popup
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ Activity owner = (Activity)getElementToEdit();
+
+ CallOperationAction newElement = UMLFactory.eINSTANCE.createCallOperationAction();
+
+ CreateCallOperationActionDialog dialog = new CreateCallOperationActionDialog(Display.getDefault().getActiveShell(), owner);
+ if(IDialogConstants.OK_ID == dialog.open()) {
+ // initialize the invoked element (no need to use a command, since action is being created)
+ EObject operation = dialog.getSelectedInvoked();
+ if(operation instanceof Operation) {
+ newElement.setOperation((Operation)operation);
+ }
+ // initialize synchronous
+ newElement.setIsSynchronous(dialog.getIsSynchronous());
+ } else {
+ return CommandResult.newCancelledCommandResult();
+ }
+
+ owner.getNodes().add(newElement);
+
+
+ UMLElementTypes.init_CallOperationAction_3010(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(CallOperationAction newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintAsLocalPostcondCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintAsLocalPostcondCreateCommand.java
new file mode 100644
index 00000000000..3e82ea91f8f
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintAsLocalPostcondCreateCommand.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.Action;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class ConstraintAsLocalPostcondCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public ConstraintAsLocalPostcondCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static ConstraintAsLocalPostcondCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new ConstraintAsLocalPostcondCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public ConstraintAsLocalPostcondCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ Constraint newElement = UMLFactory.eINSTANCE.createConstraint();
+
+ Action owner = (Action)getElementToEdit();
+ owner.getLocalPostconditions().add(newElement);
+
+
+ UMLElementTypes.init_Constraint_3012(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(Constraint newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintAsLocalPrecondCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintAsLocalPrecondCreateCommand.java
new file mode 100644
index 00000000000..e10ce3803ed
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintAsLocalPrecondCreateCommand.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.Action;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class ConstraintAsLocalPrecondCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public ConstraintAsLocalPrecondCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static ConstraintAsLocalPrecondCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new ConstraintAsLocalPrecondCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public ConstraintAsLocalPrecondCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ Constraint newElement = UMLFactory.eINSTANCE.createConstraint();
+
+ Action owner = (Action)getElementToEdit();
+ owner.getLocalPreconditions().add(newElement);
+
+
+ UMLElementTypes.init_Constraint_3011(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(Constraint newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintInActivityAsPostcondCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintInActivityAsPostcondCreateCommand.java
new file mode 100644
index 00000000000..0f13f41cadc
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintInActivityAsPostcondCreateCommand.java
@@ -0,0 +1,137 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.Namespace;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class ConstraintInActivityAsPostcondCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public ConstraintInActivityAsPostcondCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static ConstraintInActivityAsPostcondCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new ConstraintInActivityAsPostcondCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public ConstraintInActivityAsPostcondCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ Constraint newElement = UMLFactory.eINSTANCE.createConstraint();
+
+ Namespace owner = (Namespace)getElementToEdit();
+ owner.getOwnedRules().add(newElement);
+ Behavior childHolder = (Behavior)getElementToEdit();
+ childHolder.getPostconditions().add(newElement);
+
+
+ UMLElementTypes.init_Constraint_3003(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(Constraint newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintInActivityAsPrecondCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintInActivityAsPrecondCreateCommand.java
new file mode 100644
index 00000000000..19527e2a161
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ConstraintInActivityAsPrecondCreateCommand.java
@@ -0,0 +1,137 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.Namespace;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class ConstraintInActivityAsPrecondCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public ConstraintInActivityAsPrecondCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static ConstraintInActivityAsPrecondCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new ConstraintInActivityAsPrecondCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public ConstraintInActivityAsPrecondCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ Constraint newElement = UMLFactory.eINSTANCE.createConstraint();
+
+ Namespace owner = (Namespace)getElementToEdit();
+ owner.getOwnedRules().add(newElement);
+ Behavior childHolder = (Behavior)getElementToEdit();
+ childHolder.getPreconditions().add(newElement);
+
+
+ UMLElementTypes.init_Constraint_3002(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(Constraint newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ControlFlowCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ControlFlowCreateCommand.java
new file mode 100644
index 00000000000..3caf2c9e01e
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ControlFlowCreateCommand.java
@@ -0,0 +1,171 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLBaseItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.ActivityNode;
+import org.eclipse.uml2.uml.ControlFlow;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class ControlFlowCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private final EObject source;
+
+ /**
+ * @generated
+ */
+ private final EObject target;
+
+
+ /**
+ * @generated
+ */
+ private final Activity container;
+
+ /**
+ * @generated
+ */
+ public ControlFlowCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
+ super(request.getLabel(), null, request);
+ this.source = source;
+ this.target = target;
+ container = deduceContainer(source, target);
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ if(source == null && target == null) {
+ return false;
+ }
+ if(source != null && false == source instanceof ActivityNode) {
+ return false;
+ }
+ if(target != null && false == target instanceof ActivityNode) {
+ return false;
+ }
+ if(getSource() == null) {
+ return true; // link creation is in progress; source is not defined yet
+ }
+ // target may be null here but it's possible to check constraint
+ if(getContainer() == null) {
+ return false;
+ }
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canCreateControlFlow_4004(getContainer(), getSource(), getTarget());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(!canExecute()) {
+ throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
+ }
+
+ ControlFlow newElement = UMLFactory.eINSTANCE.createControlFlow();
+ getContainer().getEdges().add(newElement);
+ newElement.setSource(getSource());
+ newElement.setTarget(getTarget());
+ UMLElementTypes.init_ControlFlow_4004(newElement);
+ doConfigure(newElement, monitor, info);
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(ControlFlow newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
+ configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setElementToEdit(EObject element) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @generated
+ */
+ protected ActivityNode getSource() {
+ return (ActivityNode)source;
+ }
+
+ /**
+ * @generated
+ */
+ protected ActivityNode getTarget() {
+ return (ActivityNode)target;
+ }
+
+ /**
+ * @generated
+ */
+ public Activity getContainer() {
+ return container;
+ }
+
+ /**
+ * Default approach is to traverse ancestors of the source to find instance of container.
+ * Modify with appropriate logic.
+ *
+ * @generated
+ */
+ private static Activity deduceContainer(EObject source, EObject target) {
+ // Find container element for the new link.
+ // Climb up by containment hierarchy starting from the source
+ // and return the first element that is instance of the container class.
+ for(EObject element = source; element != null; element = element.eContainer()) {
+ if(element instanceof Activity) {
+ return (Activity)element;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ControlFlowReorientCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ControlFlowReorientCommand.java
new file mode 100644
index 00000000000..a499ad2a350
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ControlFlowReorientCommand.java
@@ -0,0 +1,170 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLBaseItemSemanticEditPolicy;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.ActivityNode;
+import org.eclipse.uml2.uml.ControlFlow;
+
+/**
+ * @generated
+ */
+public class ControlFlowReorientCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private final int reorientDirection;
+
+ /**
+ * @generated
+ */
+ private final EObject oldEnd;
+
+ /**
+ * @generated
+ */
+ private final EObject newEnd;
+
+ /**
+ * @generated
+ */
+ public ControlFlowReorientCommand(ReorientRelationshipRequest request) {
+ super(request.getLabel(), request.getRelationship(), request);
+ reorientDirection = request.getDirection();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ if(false == getElementToEdit() instanceof ControlFlow) {
+ return false;
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ return canReorientSource();
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ return canReorientTarget();
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientSource() {
+ if(!(oldEnd instanceof ActivityNode && newEnd instanceof ActivityNode)) {
+ return false;
+ }
+ ActivityNode target = getLink().getTarget();
+ if(!(getLink().eContainer() instanceof Activity)) {
+ return false;
+ }
+ Activity container = (Activity)getLink().eContainer();
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canExistControlFlow_4004(container, getNewSource(), target);
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientTarget() {
+ if(!(oldEnd instanceof ActivityNode && newEnd instanceof ActivityNode)) {
+ return false;
+ }
+ ActivityNode source = getLink().getSource();
+ if(!(getLink().eContainer() instanceof Activity)) {
+ return false;
+ }
+ Activity container = (Activity)getLink().eContainer();
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canExistControlFlow_4004(container, source, getNewTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(!canExecute()) {
+ throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ return reorientSource();
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ return reorientTarget();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientSource() throws ExecutionException {
+ getLink().setSource(getNewSource());
+ return CommandResult.newOKCommandResult(getLink());
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientTarget() throws ExecutionException {
+ getLink().setTarget(getNewTarget());
+ return CommandResult.newOKCommandResult(getLink());
+ }
+
+ /**
+ * @generated
+ */
+ protected ControlFlow getLink() {
+ return (ControlFlow)getElementToEdit();
+ }
+
+ /**
+ * @generated
+ */
+ protected ActivityNode getOldSource() {
+ return (ActivityNode)oldEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected ActivityNode getNewSource() {
+ return (ActivityNode)newEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected ActivityNode getOldTarget() {
+ return (ActivityNode)oldEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected ActivityNode getNewTarget() {
+ return (ActivityNode)newEnd;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/FlowFinalNodeCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/FlowFinalNodeCreateCommand.java
index 8b2ef48fc65..d053700d726 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/FlowFinalNodeCreateCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/FlowFinalNodeCreateCommand.java
@@ -25,6 +25,7 @@ import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
import org.eclipse.uml2.uml.Activity;
import org.eclipse.uml2.uml.FlowFinalNode;
import org.eclipse.uml2.uml.UMLFactory;
@@ -105,6 +106,7 @@ public class FlowFinalNodeCreateCommand extends EditElementCommand {
owner.getNodes().add(newElement);
+ UMLElementTypes.init_FlowFinalNode_3006(newElement);
doConfigure(newElement, monitor, info);
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InitialNodeCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InitialNodeCreateCommand.java
index 5be2816fa91..4d74a590082 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InitialNodeCreateCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InitialNodeCreateCommand.java
@@ -25,6 +25,7 @@ import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
import org.eclipse.uml2.uml.Activity;
import org.eclipse.uml2.uml.InitialNode;
import org.eclipse.uml2.uml.UMLFactory;
@@ -105,6 +106,7 @@ public class InitialNodeCreateCommand extends EditElementCommand {
owner.getNodes().add(newElement);
+ UMLElementTypes.init_InitialNode_3004(newElement);
doConfigure(newElement, monitor, info);
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInCallBeActCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInCallBeActCreateCommand.java
new file mode 100644
index 00000000000..d5184740936
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInCallBeActCreateCommand.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.InvocationAction;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class InputPinInCallBeActCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public InputPinInCallBeActCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static InputPinInCallBeActCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new InputPinInCallBeActCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public InputPinInCallBeActCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ InputPin newElement = UMLFactory.eINSTANCE.createInputPin();
+
+ InvocationAction owner = (InvocationAction)getElementToEdit();
+ owner.getArguments().add(newElement);
+
+
+ UMLElementTypes.init_InputPin_3019(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(InputPin newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInCallOpActAsTargetCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInCallOpActAsTargetCreateCommand.java
new file mode 100644
index 00000000000..0b2eda9acb1
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInCallOpActAsTargetCreateCommand.java
@@ -0,0 +1,138 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.CallOperationAction;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class InputPinInCallOpActAsTargetCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public InputPinInCallOpActAsTargetCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static InputPinInCallOpActAsTargetCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new InputPinInCallOpActAsTargetCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public InputPinInCallOpActAsTargetCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ CallOperationAction container = (CallOperationAction)getElementToEdit();
+ if(container.getTarget() != null) {
+ return false;
+ }
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ InputPin newElement = UMLFactory.eINSTANCE.createInputPin();
+
+ CallOperationAction owner = (CallOperationAction)getElementToEdit();
+ owner.setTarget(newElement);
+
+
+ UMLElementTypes.init_InputPin_3027(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(InputPin newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInCallOpActCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInCallOpActCreateCommand.java
new file mode 100644
index 00000000000..e33a5064a5e
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInCallOpActCreateCommand.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.InvocationAction;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class InputPinInCallOpActCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public InputPinInCallOpActCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static InputPinInCallOpActCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new InputPinInCallOpActCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public InputPinInCallOpActCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ InputPin newElement = UMLFactory.eINSTANCE.createInputPin();
+
+ InvocationAction owner = (InvocationAction)getElementToEdit();
+ owner.getArguments().add(newElement);
+
+
+ UMLElementTypes.init_InputPin_3023(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(InputPin newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInOpaqueActCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInOpaqueActCreateCommand.java
new file mode 100644
index 00000000000..8da1ae0c1e6
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInOpaqueActCreateCommand.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.OpaqueAction;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class InputPinInOpaqueActCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public InputPinInOpaqueActCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static InputPinInOpaqueActCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new InputPinInOpaqueActCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public InputPinInOpaqueActCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ InputPin newElement = UMLFactory.eINSTANCE.createInputPin();
+
+ OpaqueAction owner = (OpaqueAction)getElementToEdit();
+ owner.getInputValues().add(newElement);
+
+
+ UMLElementTypes.init_InputPin_3013(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(InputPin newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowCreateCommand.java
new file mode 100644
index 00000000000..ae4cd6de6c7
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowCreateCommand.java
@@ -0,0 +1,171 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLBaseItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.ActivityNode;
+import org.eclipse.uml2.uml.ObjectFlow;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class ObjectFlowCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private final EObject source;
+
+ /**
+ * @generated
+ */
+ private final EObject target;
+
+
+ /**
+ * @generated
+ */
+ private final Activity container;
+
+ /**
+ * @generated
+ */
+ public ObjectFlowCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
+ super(request.getLabel(), null, request);
+ this.source = source;
+ this.target = target;
+ container = deduceContainer(source, target);
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ if(source == null && target == null) {
+ return false;
+ }
+ if(source != null && false == source instanceof ActivityNode) {
+ return false;
+ }
+ if(target != null && false == target instanceof ActivityNode) {
+ return false;
+ }
+ if(getSource() == null) {
+ return true; // link creation is in progress; source is not defined yet
+ }
+ // target may be null here but it's possible to check constraint
+ if(getContainer() == null) {
+ return false;
+ }
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canCreateObjectFlow_4003(getContainer(), getSource(), getTarget());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(!canExecute()) {
+ throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
+ }
+
+ ObjectFlow newElement = UMLFactory.eINSTANCE.createObjectFlow();
+ getContainer().getEdges().add(newElement);
+ newElement.setSource(getSource());
+ newElement.setTarget(getTarget());
+ UMLElementTypes.init_ObjectFlow_4003(newElement);
+ doConfigure(newElement, monitor, info);
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(ObjectFlow newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
+ configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setElementToEdit(EObject element) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @generated
+ */
+ protected ActivityNode getSource() {
+ return (ActivityNode)source;
+ }
+
+ /**
+ * @generated
+ */
+ protected ActivityNode getTarget() {
+ return (ActivityNode)target;
+ }
+
+ /**
+ * @generated
+ */
+ public Activity getContainer() {
+ return container;
+ }
+
+ /**
+ * Default approach is to traverse ancestors of the source to find instance of container.
+ * Modify with appropriate logic.
+ *
+ * @generated
+ */
+ private static Activity deduceContainer(EObject source, EObject target) {
+ // Find container element for the new link.
+ // Climb up by containment hierarchy starting from the source
+ // and return the first element that is instance of the container class.
+ for(EObject element = source; element != null; element = element.eContainer()) {
+ if(element instanceof Activity) {
+ return (Activity)element;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowReorientCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowReorientCommand.java
new file mode 100644
index 00000000000..0ff637d309c
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowReorientCommand.java
@@ -0,0 +1,170 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLBaseItemSemanticEditPolicy;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.ActivityNode;
+import org.eclipse.uml2.uml.ObjectFlow;
+
+/**
+ * @generated
+ */
+public class ObjectFlowReorientCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private final int reorientDirection;
+
+ /**
+ * @generated
+ */
+ private final EObject oldEnd;
+
+ /**
+ * @generated
+ */
+ private final EObject newEnd;
+
+ /**
+ * @generated
+ */
+ public ObjectFlowReorientCommand(ReorientRelationshipRequest request) {
+ super(request.getLabel(), request.getRelationship(), request);
+ reorientDirection = request.getDirection();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ if(false == getElementToEdit() instanceof ObjectFlow) {
+ return false;
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ return canReorientSource();
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ return canReorientTarget();
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientSource() {
+ if(!(oldEnd instanceof ActivityNode && newEnd instanceof ActivityNode)) {
+ return false;
+ }
+ ActivityNode target = getLink().getTarget();
+ if(!(getLink().eContainer() instanceof Activity)) {
+ return false;
+ }
+ Activity container = (Activity)getLink().eContainer();
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canExistObjectFlow_4003(container, getNewSource(), target);
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientTarget() {
+ if(!(oldEnd instanceof ActivityNode && newEnd instanceof ActivityNode)) {
+ return false;
+ }
+ ActivityNode source = getLink().getSource();
+ if(!(getLink().eContainer() instanceof Activity)) {
+ return false;
+ }
+ Activity container = (Activity)getLink().eContainer();
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canExistObjectFlow_4003(container, source, getNewTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(!canExecute()) {
+ throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ return reorientSource();
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ return reorientTarget();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientSource() throws ExecutionException {
+ getLink().setSource(getNewSource());
+ return CommandResult.newOKCommandResult(getLink());
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientTarget() throws ExecutionException {
+ getLink().setTarget(getNewTarget());
+ return CommandResult.newOKCommandResult(getLink());
+ }
+
+ /**
+ * @generated
+ */
+ protected ObjectFlow getLink() {
+ return (ObjectFlow)getElementToEdit();
+ }
+
+ /**
+ * @generated
+ */
+ protected ActivityNode getOldSource() {
+ return (ActivityNode)oldEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected ActivityNode getNewSource() {
+ return (ActivityNode)newEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected ActivityNode getOldTarget() {
+ return (ActivityNode)oldEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected ActivityNode getNewTarget() {
+ return (ActivityNode)newEnd;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowSelectionCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowSelectionCreateCommand.java
new file mode 100644
index 00000000000..a01b196f3c9
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowSelectionCreateCommand.java
@@ -0,0 +1,109 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLBaseItemSemanticEditPolicy;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.ObjectFlow;
+
+/**
+ * @generated
+ */
+public class ObjectFlowSelectionCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private final EObject source;
+
+ /**
+ * @generated
+ */
+ private final EObject target;
+
+ /**
+ * @generated
+ */
+ public ObjectFlowSelectionCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
+ super(request.getLabel(), null, request);
+ this.source = source;
+ this.target = target;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ if(source == null && target == null) {
+ return false;
+ }
+ if(source != null && false == source instanceof ObjectFlow) {
+ return false;
+ }
+ if(target != null && false == target instanceof Behavior) {
+ return false;
+ }
+ if(getSource() == null) {
+ return true; // link creation is in progress; source is not defined yet
+ }
+ // target may be null here but it's possible to check constraint
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canCreateObjectFlowSelection_4005(getSource(), getTarget());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(!canExecute()) {
+ throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
+ }
+
+ if(getSource() != null && getTarget() != null) {
+ getSource().setSelection(getTarget());
+ }
+ return CommandResult.newOKCommandResult();
+
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void setElementToEdit(EObject element) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @generated
+ */
+ protected ObjectFlow getSource() {
+ return (ObjectFlow)source;
+ }
+
+ /**
+ * @generated
+ */
+ protected Behavior getTarget() {
+ return (Behavior)target;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowSelectionReorientCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowSelectionReorientCommand.java
new file mode 100644
index 00000000000..c4b2e052e67
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowSelectionReorientCommand.java
@@ -0,0 +1,160 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLBaseItemSemanticEditPolicy;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.ObjectFlow;
+
+/**
+ * @generated
+ */
+public class ObjectFlowSelectionReorientCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private final int reorientDirection;
+
+ /**
+ * @generated
+ */
+ private final EObject referenceOwner;
+
+ /**
+ * @generated
+ */
+ private final EObject oldEnd;
+
+ /**
+ * @generated
+ */
+ private final EObject newEnd;
+
+ /**
+ * @generated
+ */
+ public ObjectFlowSelectionReorientCommand(ReorientReferenceRelationshipRequest request) {
+ super(request.getLabel(), null, request);
+ reorientDirection = request.getDirection();
+ referenceOwner = request.getReferenceOwner();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ if(false == referenceOwner instanceof ObjectFlow) {
+ return false;
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ return canReorientSource();
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ return canReorientTarget();
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientSource() {
+ if(!(oldEnd instanceof Behavior && newEnd instanceof ObjectFlow)) {
+ return false;
+ }
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canExistObjectFlowSelection_4005(getNewSource(), getOldTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientTarget() {
+ if(!(oldEnd instanceof Behavior && newEnd instanceof Behavior)) {
+ return false;
+ }
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canExistObjectFlowSelection_4005(getOldSource(), getNewTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(!canExecute()) {
+ throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ return reorientSource();
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ return reorientTarget();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientSource() throws ExecutionException {
+ getOldSource().setSelection(null);
+ getNewSource().setSelection(getOldTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientTarget() throws ExecutionException {
+ getOldSource().setSelection(getNewTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected ObjectFlow getOldSource() {
+ return (ObjectFlow)referenceOwner;
+ }
+
+ /**
+ * @generated
+ */
+ protected ObjectFlow getNewSource() {
+ return (ObjectFlow)newEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected Behavior getOldTarget() {
+ return (Behavior)oldEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected Behavior getNewTarget() {
+ return (Behavior)newEnd;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowTransformationCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowTransformationCreateCommand.java
new file mode 100644
index 00000000000..e3f00a258d1
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowTransformationCreateCommand.java
@@ -0,0 +1,109 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLBaseItemSemanticEditPolicy;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.ObjectFlow;
+
+/**
+ * @generated
+ */
+public class ObjectFlowTransformationCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private final EObject source;
+
+ /**
+ * @generated
+ */
+ private final EObject target;
+
+ /**
+ * @generated
+ */
+ public ObjectFlowTransformationCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
+ super(request.getLabel(), null, request);
+ this.source = source;
+ this.target = target;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ if(source == null && target == null) {
+ return false;
+ }
+ if(source != null && false == source instanceof ObjectFlow) {
+ return false;
+ }
+ if(target != null && false == target instanceof Behavior) {
+ return false;
+ }
+ if(getSource() == null) {
+ return true; // link creation is in progress; source is not defined yet
+ }
+ // target may be null here but it's possible to check constraint
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canCreateObjectFlowTransformation_4006(getSource(), getTarget());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(!canExecute()) {
+ throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
+ }
+
+ if(getSource() != null && getTarget() != null) {
+ getSource().setTransformation(getTarget());
+ }
+ return CommandResult.newOKCommandResult();
+
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void setElementToEdit(EObject element) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @generated
+ */
+ protected ObjectFlow getSource() {
+ return (ObjectFlow)source;
+ }
+
+ /**
+ * @generated
+ */
+ protected Behavior getTarget() {
+ return (Behavior)target;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowTransformationReorientCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowTransformationReorientCommand.java
new file mode 100644
index 00000000000..98a09a096b7
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ObjectFlowTransformationReorientCommand.java
@@ -0,0 +1,160 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLBaseItemSemanticEditPolicy;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.ObjectFlow;
+
+/**
+ * @generated
+ */
+public class ObjectFlowTransformationReorientCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private final int reorientDirection;
+
+ /**
+ * @generated
+ */
+ private final EObject referenceOwner;
+
+ /**
+ * @generated
+ */
+ private final EObject oldEnd;
+
+ /**
+ * @generated
+ */
+ private final EObject newEnd;
+
+ /**
+ * @generated
+ */
+ public ObjectFlowTransformationReorientCommand(ReorientReferenceRelationshipRequest request) {
+ super(request.getLabel(), null, request);
+ reorientDirection = request.getDirection();
+ referenceOwner = request.getReferenceOwner();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ if(false == referenceOwner instanceof ObjectFlow) {
+ return false;
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ return canReorientSource();
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ return canReorientTarget();
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientSource() {
+ if(!(oldEnd instanceof Behavior && newEnd instanceof ObjectFlow)) {
+ return false;
+ }
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canExistObjectFlowTransformation_4006(getNewSource(), getOldTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientTarget() {
+ if(!(oldEnd instanceof Behavior && newEnd instanceof Behavior)) {
+ return false;
+ }
+ return UMLBaseItemSemanticEditPolicy.LinkConstraints.canExistObjectFlowTransformation_4006(getOldSource(), getNewTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(!canExecute()) {
+ throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ return reorientSource();
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ return reorientTarget();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientSource() throws ExecutionException {
+ getOldSource().setTransformation(null);
+ getNewSource().setTransformation(getOldTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientTarget() throws ExecutionException {
+ getOldSource().setTransformation(getNewTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected ObjectFlow getOldSource() {
+ return (ObjectFlow)referenceOwner;
+ }
+
+ /**
+ * @generated
+ */
+ protected ObjectFlow getNewSource() {
+ return (ObjectFlow)newEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected Behavior getOldTarget() {
+ return (Behavior)oldEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected Behavior getNewTarget() {
+ return (Behavior)newEnd;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OpaqueActionCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OpaqueActionCreateCommand.java
new file mode 100644
index 00000000000..0e7e6e8d2ed
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OpaqueActionCreateCommand.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.OpaqueAction;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class OpaqueActionCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public OpaqueActionCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static OpaqueActionCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new OpaqueActionCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public OpaqueActionCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ OpaqueAction newElement = UMLFactory.eINSTANCE.createOpaqueAction();
+
+ Activity owner = (Activity)getElementToEdit();
+ owner.getNodes().add(newElement);
+
+
+ UMLElementTypes.init_OpaqueAction_3007(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(OpaqueAction newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInCallBeActCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInCallBeActCreateCommand.java
new file mode 100644
index 00000000000..6553d1b7ea9
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInCallBeActCreateCommand.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.CallAction;
+import org.eclipse.uml2.uml.OutputPin;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class OutputPinInCallBeActCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public OutputPinInCallBeActCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static OutputPinInCallBeActCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new OutputPinInCallBeActCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public OutputPinInCallBeActCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ OutputPin newElement = UMLFactory.eINSTANCE.createOutputPin();
+
+ CallAction owner = (CallAction)getElementToEdit();
+ owner.getResults().add(newElement);
+
+
+ UMLElementTypes.init_OutputPin_3020(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(OutputPin newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInCallOpActCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInCallOpActCreateCommand.java
new file mode 100644
index 00000000000..6db82b8a722
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInCallOpActCreateCommand.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.CallAction;
+import org.eclipse.uml2.uml.OutputPin;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class OutputPinInCallOpActCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public OutputPinInCallOpActCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static OutputPinInCallOpActCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new OutputPinInCallOpActCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public OutputPinInCallOpActCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ OutputPin newElement = UMLFactory.eINSTANCE.createOutputPin();
+
+ CallAction owner = (CallAction)getElementToEdit();
+ owner.getResults().add(newElement);
+
+
+ UMLElementTypes.init_OutputPin_3024(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(OutputPin newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInOpaqueActCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInOpaqueActCreateCommand.java
new file mode 100644
index 00000000000..eb33e04c332
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInOpaqueActCreateCommand.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.OpaqueAction;
+import org.eclipse.uml2.uml.OutputPin;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class OutputPinInOpaqueActCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public OutputPinInOpaqueActCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static OutputPinInOpaqueActCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new OutputPinInOpaqueActCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public OutputPinInOpaqueActCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ OutputPin newElement = UMLFactory.eINSTANCE.createOutputPin();
+
+ OpaqueAction owner = (OpaqueAction)getElementToEdit();
+ owner.getOutputValues().add(newElement);
+
+
+ UMLElementTypes.init_OutputPin_3014(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(OutputPin newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ParameterCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ParameterCreateCommand.java
index d6100d404df..83b553394fa 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ParameterCreateCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ParameterCreateCommand.java
@@ -25,6 +25,7 @@ import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
import org.eclipse.uml2.uml.Behavior;
import org.eclipse.uml2.uml.Parameter;
import org.eclipse.uml2.uml.UMLFactory;
@@ -105,6 +106,7 @@ public class ParameterCreateCommand extends EditElementCommand {
owner.getOwnedParameters().add(newElement);
+ UMLElementTypes.init_Parameter_3001(newElement);
doConfigure(newElement, monitor, info);
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInCallBeActCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInCallBeActCreateCommand.java
new file mode 100644
index 00000000000..240cfece4fb
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInCallBeActCreateCommand.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.InvocationAction;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.ValuePin;
+
+/**
+ * @generated
+ */
+public class ValuePinInCallBeActCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public ValuePinInCallBeActCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static ValuePinInCallBeActCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new ValuePinInCallBeActCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public ValuePinInCallBeActCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ ValuePin newElement = UMLFactory.eINSTANCE.createValuePin();
+
+ InvocationAction owner = (InvocationAction)getElementToEdit();
+ owner.getArguments().add(newElement);
+
+
+ UMLElementTypes.init_ValuePin_3017(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(ValuePin newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInCallOpActAsTargetCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInCallOpActAsTargetCreateCommand.java
new file mode 100644
index 00000000000..38f2c653348
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInCallOpActAsTargetCreateCommand.java
@@ -0,0 +1,138 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.CallOperationAction;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.ValuePin;
+
+/**
+ * @generated
+ */
+public class ValuePinInCallOpActAsTargetCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public ValuePinInCallOpActAsTargetCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static ValuePinInCallOpActAsTargetCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new ValuePinInCallOpActAsTargetCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public ValuePinInCallOpActAsTargetCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ CallOperationAction container = (CallOperationAction)getElementToEdit();
+ if(container.getTarget() != null) {
+ return false;
+ }
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ ValuePin newElement = UMLFactory.eINSTANCE.createValuePin();
+
+ CallOperationAction owner = (CallOperationAction)getElementToEdit();
+ owner.setTarget(newElement);
+
+
+ UMLElementTypes.init_ValuePin_3025(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(ValuePin newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInCallOpActCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInCallOpActCreateCommand.java
new file mode 100644
index 00000000000..325d57d60ae
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInCallOpActCreateCommand.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.InvocationAction;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.ValuePin;
+
+/**
+ * @generated
+ */
+public class ValuePinInCallOpActCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public ValuePinInCallOpActCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static ValuePinInCallOpActCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new ValuePinInCallOpActCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public ValuePinInCallOpActCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ ValuePin newElement = UMLFactory.eINSTANCE.createValuePin();
+
+ InvocationAction owner = (InvocationAction)getElementToEdit();
+ owner.getArguments().add(newElement);
+
+
+ UMLElementTypes.init_ValuePin_3022(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(ValuePin newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInOpaqueActCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInOpaqueActCreateCommand.java
new file mode 100644
index 00000000000..525c16e31a5
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/ValuePinInOpaqueActCreateCommand.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.OpaqueAction;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.ValuePin;
+
+/**
+ * @generated
+ */
+public class ValuePinInOpaqueActCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public ValuePinInOpaqueActCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static ValuePinInOpaqueActCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new ValuePinInOpaqueActCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public ValuePinInOpaqueActCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+ ValuePin newElement = UMLFactory.eINSTANCE.createValuePin();
+
+ OpaqueAction owner = (OpaqueAction)getElementToEdit();
+ owner.getInputValues().add(newElement);
+
+
+ UMLElementTypes.init_ValuePin_3015(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(ValuePin newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ActionInputPinEditHelper.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ActionInputPinEditHelper.java
new file mode 100644
index 00000000000..7a4cf22559d
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ActionInputPinEditHelper.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.helpers;
+
+/**
+ * @generated
+ */
+public class ActionInputPinEditHelper extends UMLBaseEditHelper {
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/CallBehaviorActionEditHelper.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/CallBehaviorActionEditHelper.java
new file mode 100644
index 00000000000..202ba6c70bc
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/CallBehaviorActionEditHelper.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.helpers;
+
+/**
+ * @generated
+ */
+public class CallBehaviorActionEditHelper extends UMLBaseEditHelper {
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/CallOperationActionEditHelper.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/CallOperationActionEditHelper.java
new file mode 100644
index 00000000000..9f2feb170b1
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/CallOperationActionEditHelper.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.helpers;
+
+/**
+ * @generated
+ */
+public class CallOperationActionEditHelper extends UMLBaseEditHelper {
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ControlFlowEditHelper.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ControlFlowEditHelper.java
new file mode 100644
index 00000000000..0f0cf2e716f
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ControlFlowEditHelper.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.helpers;
+
+/**
+ * @generated
+ */
+public class ControlFlowEditHelper extends UMLBaseEditHelper {
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/InputPinEditHelper.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/InputPinEditHelper.java
new file mode 100644
index 00000000000..488f7d97cb4
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/InputPinEditHelper.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.helpers;
+
+/**
+ * @generated
+ */
+public class InputPinEditHelper extends UMLBaseEditHelper {
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ObjectFlowEditHelper.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ObjectFlowEditHelper.java
new file mode 100644
index 00000000000..f4ef134ca25
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ObjectFlowEditHelper.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.helpers;
+
+/**
+ * @generated
+ */
+public class ObjectFlowEditHelper extends UMLBaseEditHelper {
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/OpaqueActionEditHelper.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/OpaqueActionEditHelper.java
new file mode 100644
index 00000000000..70b7e423634
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/OpaqueActionEditHelper.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.helpers;
+
+/**
+ * @generated
+ */
+public class OpaqueActionEditHelper extends UMLBaseEditHelper {
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/OutputPinEditHelper.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/OutputPinEditHelper.java
new file mode 100644
index 00000000000..c16ca582549
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/OutputPinEditHelper.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.helpers;
+
+/**
+ * @generated
+ */
+public class OutputPinEditHelper extends UMLBaseEditHelper {
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ValuePinEditHelper.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ValuePinEditHelper.java
new file mode 100644
index 00000000000..a974a6ba986
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/helpers/ValuePinEditHelper.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.helpers;
+
+/**
+ * @generated
+ */
+public class ValuePinEditHelper extends UMLBaseEditHelper {
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCBActLabelEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCBActLabelEditPart.java
new file mode 100644
index 00000000000..6b582dee4ed
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCBActLabelEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInCBActLabelEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5014;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCBActLabelEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCBActLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ActionInputPin_3018, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCBActLabelEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCBActValueEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCBActValueEditPart.java
new file mode 100644
index 00000000000..6e304baa591
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCBActValueEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInCBActValueEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5027;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCBActValueEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCBActValueEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ActionInputPin_3018, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCBActValueEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActAsTargetLabelEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActAsTargetLabelEditPart.java
new file mode 100644
index 00000000000..802080a085f
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActAsTargetLabelEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInCOActAsTargetLabelEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5022;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActAsTargetLabelEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCOActAsTargetLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ActionInputPin_3026, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActAsTargetLabelEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActAsTargetValueEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActAsTargetValueEditPart.java
new file mode 100644
index 00000000000..648c4dd3bac
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActAsTargetValueEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInCOActAsTargetValueEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5031;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActAsTargetValueEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCOActAsTargetValueEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ActionInputPin_3026, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActAsTargetValueEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActLabelEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActLabelEditPart.java
new file mode 100644
index 00000000000..841cc9bb3ec
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActLabelEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInCOActLabelEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5017;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActLabelEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCOActLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ActionInputPin_3021, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActLabelEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActValueEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActValueEditPart.java
new file mode 100644
index 00000000000..dea2b02ffed
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCOActValueEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInCOActValueEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5028;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActValueEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCOActValueEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ActionInputPin_3021, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActValueEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCallBeActEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCallBeActEditPart.java
new file mode 100644
index 00000000000..265ba39e5cf
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCallBeActEditPart.java
@@ -0,0 +1,792 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ActionInputPinInCallBeActItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInCallBeActEditPart extends
+
+BorderedBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3018;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCallBeActEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ActionInputPinInCallBeActItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case ActionInputPinInCBActLabelEditPart.VISUAL_ID:
+ case ActionInputPinInCBActValueEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ PinDescriptor figure = new PinDescriptor();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public PinDescriptor getPrimaryShape() {
+ return (PinDescriptor)primaryShape;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof ActionInputPinInCBActLabelEditPart || borderItemEditPart instanceof ActionInputPinInCBActValueEditPart) {
+ BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ locator.setBorderItemOffset(new Dimension(-20, -20));
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 16);
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(ActionInputPinInCBActLabelEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCallOpActAsTargetEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCallOpActAsTargetEditPart.java
new file mode 100644
index 00000000000..201323d8e52
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCallOpActAsTargetEditPart.java
@@ -0,0 +1,792 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ActionInputPinInCallOpActAsTargetItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInCallOpActAsTargetEditPart extends
+
+BorderedBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3026;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCallOpActAsTargetEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ActionInputPinInCallOpActAsTargetItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case ActionInputPinInCOActAsTargetLabelEditPart.VISUAL_ID:
+ case ActionInputPinInCOActAsTargetValueEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ PinDescriptor figure = new PinDescriptor();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public PinDescriptor getPrimaryShape() {
+ return (PinDescriptor)primaryShape;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof ActionInputPinInCOActAsTargetLabelEditPart || borderItemEditPart instanceof ActionInputPinInCOActAsTargetValueEditPart) {
+ BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ locator.setBorderItemOffset(new Dimension(-20, -20));
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 16);
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(ActionInputPinInCOActAsTargetLabelEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCallOpActEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCallOpActEditPart.java
new file mode 100644
index 00000000000..151196dc87c
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInCallOpActEditPart.java
@@ -0,0 +1,792 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ActionInputPinInCallOpActItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInCallOpActEditPart extends
+
+BorderedBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3021;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCallOpActEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ActionInputPinInCallOpActItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case ActionInputPinInCOActLabelEditPart.VISUAL_ID:
+ case ActionInputPinInCOActValueEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ PinDescriptor figure = new PinDescriptor();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public PinDescriptor getPrimaryShape() {
+ return (PinDescriptor)primaryShape;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof ActionInputPinInCOActLabelEditPart || borderItemEditPart instanceof ActionInputPinInCOActValueEditPart) {
+ BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ locator.setBorderItemOffset(new Dimension(-20, -20));
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 16);
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(ActionInputPinInCOActLabelEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInOActLabelEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInOActLabelEditPart.java
new file mode 100644
index 00000000000..f1bdb52865e
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInOActLabelEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInOActLabelEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5012;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOActLabelEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInOActLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ActionInputPin_3016, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOActLabelEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInOActValueEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInOActValueEditPart.java
new file mode 100644
index 00000000000..a17c21e1e14
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInOActValueEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInOActValueEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5025;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOActValueEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInOActValueEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ActionInputPin_3016, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOActValueEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInOpaqueActEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInOpaqueActEditPart.java
new file mode 100644
index 00000000000..0afd0e67738
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionInputPinInOpaqueActEditPart.java
@@ -0,0 +1,792 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ActionInputPinInOpaqueActItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInOpaqueActEditPart extends
+
+BorderedBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3016;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInOpaqueActEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ActionInputPinInOpaqueActItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case ActionInputPinInOActLabelEditPart.VISUAL_ID:
+ case ActionInputPinInOActValueEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ PinDescriptor figure = new PinDescriptor();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public PinDescriptor getPrimaryShape() {
+ return (PinDescriptor)primaryShape;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof ActionInputPinInOActLabelEditPart || borderItemEditPart instanceof ActionInputPinInOActValueEditPart) {
+ BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ locator.setBorderItemOffset(new Dimension(-20, -20));
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 16);
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(ActionInputPinInOActLabelEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("ActionInputPin", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionLocalPostconditionEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionLocalPostconditionEditPart.java
new file mode 100644
index 00000000000..20e0471a5ee
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionLocalPostconditionEditPart.java
@@ -0,0 +1,101 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import org.eclipse.draw2d.Connection;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ActionLocalPostconditionItemSemanticEditPolicy;
+
+/**
+ * @generated
+ */
+public class ActionLocalPostconditionEditPart extends ConnectionNodeEditPart
+
+implements ITreeBranchEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 4002;
+
+ /**
+ * @generated
+ */
+ public ActionLocalPostconditionEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ActionLocalPostconditionItemSemanticEditPolicy());
+ }
+
+
+
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+
+ protected Connection createConnectionFigure() {
+ return new DashedLinkDescriptor();
+ }
+
+ /**
+ * @generated
+ */
+ public DashedLinkDescriptor getPrimaryShape() {
+ return (DashedLinkDescriptor)getFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class DashedLinkDescriptor extends PolylineConnectionEx {
+
+
+
+
+ /**
+ * @generated
+ */
+ public DashedLinkDescriptor() {
+ this.setLineWidth(1);
+ this.setLineStyle(Graphics.LINE_DASH);
+
+ }
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionLocalPreconditionEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionLocalPreconditionEditPart.java
new file mode 100644
index 00000000000..3b5fb81b505
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActionLocalPreconditionEditPart.java
@@ -0,0 +1,101 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import org.eclipse.draw2d.Connection;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ActionLocalPreconditionItemSemanticEditPolicy;
+
+/**
+ * @generated
+ */
+public class ActionLocalPreconditionEditPart extends ConnectionNodeEditPart
+
+implements ITreeBranchEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 4001;
+
+ /**
+ * @generated
+ */
+ public ActionLocalPreconditionEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ActionLocalPreconditionItemSemanticEditPolicy());
+ }
+
+
+
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+
+ protected Connection createConnectionFigure() {
+ return new DashedLinkDescriptor();
+ }
+
+ /**
+ * @generated
+ */
+ public DashedLinkDescriptor getPrimaryShape() {
+ return (DashedLinkDescriptor)getFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class DashedLinkDescriptor extends PolylineConnectionEx {
+
+
+
+
+ /**
+ * @generated
+ */
+ public DashedLinkDescriptor() {
+ this.setLineWidth(1);
+ this.setLineStyle(Graphics.LINE_DASH);
+
+ }
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsSelectionEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsSelectionEditPart.java
new file mode 100644
index 00000000000..1144ba1f420
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsSelectionEditPart.java
@@ -0,0 +1,387 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ActivityAsSelectionItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.WrappedLabel;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.common.figure.node.CornerBentFigure;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class ActivityAsSelectionEditPart extends
+
+ShapeNodeEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3028;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public ActivityAsSelectionEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ActivityAsSelectionItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ CornerBentWithTextFigure figure = new CornerBentWithTextFigure();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public CornerBentWithTextFigure getPrimaryShape() {
+ return (CornerBentWithTextFigure)primaryShape;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof ActivityAsSelectionNameEditPart) {
+ ((ActivityAsSelectionNameEditPart)childEditPart).setLabel(getPrimaryShape().getCornerBentContent());
+ return true;
+ }
+
+
+ return false;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected boolean removeFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof ActivityAsSelectionNameEditPart) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if(addFixedChild(childEditPart)) {
+ return;
+ }
+ super.addChildVisual(childEditPart, -1);
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeChildVisual(EditPart childEditPart) {
+ if(removeFixedChild(childEditPart)) {
+ return;
+ }
+ super.removeChildVisual(childEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
+ return getContentPane();
+ }
+
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createNodeFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ if(nodeShape.getLayoutManager() == null) {
+ ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
+ layout.setSpacing(5);
+ nodeShape.setLayoutManager(layout);
+ }
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(ActivityAsSelectionNameEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class CornerBentWithTextFigure extends CornerBentFigure {
+
+
+ /**
+ * @generated
+ */
+ private WrappedLabel fCornerBentContent;
+
+
+ /**
+ * @generated
+ */
+ public CornerBentWithTextFigure() {
+
+
+ this.setBackgroundColor(THIS_BACK);
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fCornerBentContent = new WrappedLabel();
+
+
+
+ this.add(fCornerBentContent);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = false;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public WrappedLabel getCornerBentContent() {
+ return fCornerBentContent;
+ }
+
+
+ }
+
+ /**
+ * @generated
+ */
+ static final Color THIS_BACK = new Color(null, 248, 249, 214);
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("Activity", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("Activity", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("Activity", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("Activity", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsSelectionNameEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsSelectionNameEditPart.java
new file mode 100644
index 00000000000..d3284e6e6d6
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsSelectionNameEditPart.java
@@ -0,0 +1,768 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.handles.NonResizableHandleKit;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.WrappedLabel;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ActivityAsSelectionNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5032;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ public ActivityAsSelectionNameEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy() {
+
+ protected List createSelectionHandles() {
+ List handles = new ArrayList();
+ NonResizableHandleKit.addMoveHandle((GraphicalEditPart)getHost(), handles);
+ ((MoveHandle)handles.get(0)).setBorder(null);
+ return handles;
+ }
+
+ public Command getCommand(Request request) {
+ return null;
+ }
+
+ public boolean understandsRequest(Request request) {
+ return false;
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(WrappedLabel figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.Activity_3028, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsSelectionNameEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void addNotationalListeners() {
+ super.addNotationalListeners();
+ addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeNotationalListeners() {
+ super.removeNotationalListeners();
+ removeListenerFilter("PrimaryView"); //$NON-NLS-1$
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ refreshLabel();
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+
+
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ // Parent should assign one using setLabel() method
+ return null;
+ }
+
+
+
+ private static final String ADD_PARENT_MODEL = "AddParentModel";
+
+
+ /**
+ * @generated
+ */
+ public void activate() {
+ super.activate();
+ addOwnerElementListeners();
+ }
+
+ /**
+ * @generated
+ */
+ protected void addOwnerElementListeners() {
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+
+ }
+
+ /**
+ * @generated
+ */
+ public void deactivate() {
+ removeOwnerElementListeners();
+ super.deactivate();
+
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void removeOwnerElementListeners() {
+ removeListenerFilter(ADD_PARENT_MODEL);
+
+ }
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsTransformationEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsTransformationEditPart.java
new file mode 100644
index 00000000000..a2a05aac8a4
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsTransformationEditPart.java
@@ -0,0 +1,387 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ActivityAsTransformationItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.WrappedLabel;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.common.figure.node.CornerBentFigure;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class ActivityAsTransformationEditPart extends
+
+ShapeNodeEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3029;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public ActivityAsTransformationEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ActivityAsTransformationItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ CornerBentWithTextFigure figure = new CornerBentWithTextFigure();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public CornerBentWithTextFigure getPrimaryShape() {
+ return (CornerBentWithTextFigure)primaryShape;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof ActivityAsTransformationNameEditPart) {
+ ((ActivityAsTransformationNameEditPart)childEditPart).setLabel(getPrimaryShape().getCornerBentContent());
+ return true;
+ }
+
+
+ return false;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected boolean removeFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof ActivityAsTransformationNameEditPart) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if(addFixedChild(childEditPart)) {
+ return;
+ }
+ super.addChildVisual(childEditPart, -1);
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeChildVisual(EditPart childEditPart) {
+ if(removeFixedChild(childEditPart)) {
+ return;
+ }
+ super.removeChildVisual(childEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
+ return getContentPane();
+ }
+
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createNodeFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ if(nodeShape.getLayoutManager() == null) {
+ ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
+ layout.setSpacing(5);
+ nodeShape.setLayoutManager(layout);
+ }
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(ActivityAsTransformationNameEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class CornerBentWithTextFigure extends CornerBentFigure {
+
+
+ /**
+ * @generated
+ */
+ private WrappedLabel fCornerBentContent;
+
+
+ /**
+ * @generated
+ */
+ public CornerBentWithTextFigure() {
+
+
+ this.setBackgroundColor(THIS_BACK);
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fCornerBentContent = new WrappedLabel();
+
+
+
+ this.add(fCornerBentContent);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = false;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public WrappedLabel getCornerBentContent() {
+ return fCornerBentContent;
+ }
+
+
+ }
+
+ /**
+ * @generated
+ */
+ static final Color THIS_BACK = new Color(null, 248, 249, 214);
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("Activity", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("Activity", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("Activity", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("Activity", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsTransformationNameEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsTransformationNameEditPart.java
new file mode 100644
index 00000000000..44a3d4fa81e
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityAsTransformationNameEditPart.java
@@ -0,0 +1,768 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.handles.NonResizableHandleKit;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.WrappedLabel;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ActivityAsTransformationNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5033;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ public ActivityAsTransformationNameEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy() {
+
+ protected List createSelectionHandles() {
+ List handles = new ArrayList();
+ NonResizableHandleKit.addMoveHandle((GraphicalEditPart)getHost(), handles);
+ ((MoveHandle)handles.get(0)).setBorder(null);
+ return handles;
+ }
+
+ public Command getCommand(Request request) {
+ return null;
+ }
+
+ public boolean understandsRequest(Request request) {
+ return false;
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(WrappedLabel figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.Activity_3029, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsTransformationNameEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void addNotationalListeners() {
+ super.addNotationalListeners();
+ addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeNotationalListeners() {
+ super.removeNotationalListeners();
+ removeListenerFilter("PrimaryView"); //$NON-NLS-1$
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ refreshLabel();
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+
+
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ // Parent should assign one using setLabel() method
+ return null;
+ }
+
+
+
+ private static final String ADD_PARENT_MODEL = "AddParentModel";
+
+
+ /**
+ * @generated
+ */
+ public void activate() {
+ super.activate();
+ addOwnerElementListeners();
+ }
+
+ /**
+ * @generated
+ */
+ protected void addOwnerElementListeners() {
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+
+ }
+
+ /**
+ * @generated
+ */
+ public void deactivate() {
+ removeOwnerElementListeners();
+ super.deactivate();
+
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void removeOwnerElementListeners() {
+ removeListenerFilter(ADD_PARENT_MODEL);
+
+ }
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityFinalNodeEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityFinalNodeEditPart.java
index 93281403b34..ef391b384d9 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityFinalNodeEditPart.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ActivityFinalNodeEditPart.java
@@ -13,6 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.diagram.activity.edit.parts;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Ellipse;
import org.eclipse.draw2d.IFigure;
@@ -29,9 +32,11 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.gmf.runtime.notation.NotationPackage;
@@ -40,6 +45,7 @@ import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.papyrus.diagram.activity.edit.policies.ActivityFinalNodeItemSemanticEditPolicy;
import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.graphics.Color;
@@ -202,6 +208,428 @@ ShapeNodeEditPart {
/**
* @generated
*/
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
public class ActivityFinalNodeFigure extends RectangleFigure {
/**
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallBehaviorActionEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallBehaviorActionEditPart.java
new file mode 100644
index 00000000000..fc83e512af7
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallBehaviorActionEditPart.java
@@ -0,0 +1,1012 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RoundedRectangle;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.Bounds;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.CallBehaviorActionItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel;
+import org.eclipse.papyrus.diagram.activity.helper.ActivityFigureDrawer;
+import org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.common.draw2d.CenterLayout;
+import org.eclipse.papyrus.diagram.common.editpolicies.BorderItemResizableEditPolicy;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.CallBehaviorAction;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * @generated
+ */
+public class CallBehaviorActionEditPart extends
+
+AbstractBorderedShapeEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3008;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public CallBehaviorActionEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CallBehaviorActionItemSemanticEditPolicy());
+ installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
+
+
+ //in Papyrus diagrams are not strongly synchronised
+ //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.activity.edit.policies.CallBehaviorActionCanonicalEditPolicy());
+
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ *Papyrus codeGen
+ *
+ * @generated
+ **/
+ protected void handleNotificationEvent(Notification event) {
+ super.handleNotificationEvent(event);
+
+ //Add/Remove the RakeFigure when an Activity is selected as behavior or deselected
+ if(resolveSemanticElement() != null) {
+ if(resolveSemanticElement() instanceof CallBehaviorAction && resolveSemanticElement().equals(event.getNotifier()) && event.getFeature().equals(UMLPackage.eINSTANCE.getCallBehaviorAction_Behavior())) {
+ CallBehaviorAction action = (CallBehaviorAction)resolveSemanticElement();
+ Polyline rake = getPrimaryShape().getOptionalRakeFigure();
+ if(action.getBehavior() instanceof Activity) {
+ Dimension size = ActivityFigureDrawer.getNodeSize(this, null);
+ ActivityFigureDrawer.redrawRake(rake, getMapMode(), size);
+ } else {
+ ActivityFigureDrawer.undrawFigure(rake);
+ };
+ refreshVisuals();
+ }
+ }
+
+ //Refresh the RakeFigure if an Activity is selected as behavior when figure is resized
+ if(resolveSemanticElement() != null) {
+ if(event.getNotifier() instanceof Bounds && resolveSemanticElement() instanceof CallBehaviorAction) {
+ CallBehaviorAction action = (CallBehaviorAction)resolveSemanticElement();
+ Polyline rake = getPrimaryShape().getOptionalRakeFigure();
+ if(action.getBehavior() instanceof Activity) {
+ Dimension size = ActivityFigureDrawer.getNodeSize(this, event);
+ ActivityFigureDrawer.redrawRake(rake, getMapMode(), size);
+ };
+ refreshVisuals();
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case ValuePinInCallBeActEditPart.VISUAL_ID:
+ case ActionInputPinInCallBeActEditPart.VISUAL_ID:
+ case InputPinInCallBeActEditPart.VISUAL_ID:
+ case OutputPinInCallBeActEditPart.VISUAL_ID:
+
+ return new BorderItemResizableEditPolicy();
+
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ ActionFigure figure = new ActionFigure();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public ActionFigure getPrimaryShape() {
+ return (ActionFigure)primaryShape;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof CallBehaviorActionNameEditPart) {
+ ((CallBehaviorActionNameEditPart)childEditPart).setLabel(getPrimaryShape().getActionLabel());
+ return true;
+ }
+
+
+
+
+
+ //Papyrus Gencode :Affixed Value Pin 2 locator for CallBehaviorAction
+ if(childEditPart instanceof ValuePinInCallBeActEditPart) {
+ BorderItemLocator locator = new PinPositionLocator(getMainFigure(), PositionConstants.WEST);
+ getBorderedFigure().getBorderItemContainer().add(((ValuePinInCallBeActEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+
+
+
+
+ //Papyrus Gencode :Affixed Action Input Pin 2 locator for CallBehaviorAction
+ if(childEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ BorderItemLocator locator = new PinPositionLocator(getMainFigure(), PositionConstants.WEST);
+ getBorderedFigure().getBorderItemContainer().add(((ActionInputPinInCallBeActEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+
+
+
+
+ //Papyrus Gencode :Affixed Input Pin 2 locator for CallBehaviorAction
+ if(childEditPart instanceof InputPinInCallBeActEditPart) {
+ BorderItemLocator locator = new PinPositionLocator(getMainFigure(), PositionConstants.WEST);
+ getBorderedFigure().getBorderItemContainer().add(((InputPinInCallBeActEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+
+
+
+
+ //Papyrus Gencode :Affixed Output Pin 2 locator for CallBehaviorAction
+ if(childEditPart instanceof OutputPinInCallBeActEditPart) {
+ BorderItemLocator locator = new PinPositionLocator(getMainFigure(), PositionConstants.EAST);
+ getBorderedFigure().getBorderItemContainer().add(((OutputPinInCallBeActEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+
+
+
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean removeFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof CallBehaviorActionNameEditPart) {
+ return true;
+ }
+ if(childEditPart instanceof ValuePinInCallBeActEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ValuePinInCallBeActEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ActionInputPinInCallBeActEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof InputPinInCallBeActEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((InputPinInCallBeActEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof OutputPinInCallBeActEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((OutputPinInCallBeActEditPart)childEditPart).getFigure());
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if(addFixedChild(childEditPart)) {
+ return;
+ }
+ super.addChildVisual(childEditPart, -1);
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeChildVisual(EditPart childEditPart) {
+ if(removeFixedChild(childEditPart)) {
+ return;
+ }
+ super.removeChildVisual(childEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
+ if(editPart instanceof IBorderItemEditPart) {
+ return getBorderedFigure().getBorderItemContainer();
+ }
+ return getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Refresh the children parts, including the rake if necessary
+ *
+ * @see org.eclipse.gef.editparts.AbstractEditPart#refreshChildren()
+ * @generated NOT
+ */
+ @Override
+ protected void refreshChildren() {
+ super.refreshChildren();
+ // add the rake if behavior is an activity
+ if(resolveSemanticElement() instanceof CallBehaviorAction) {
+ CallBehaviorAction action = (CallBehaviorAction)resolveSemanticElement();
+ Polyline rake = getPrimaryShape().getOptionalRakeFigure();
+ if(action.getBehavior() instanceof Activity) {
+ Dimension size = ActivityFigureDrawer.getNodeSize(this, null);
+ ActivityFigureDrawer.redrawRake(rake, getMapMode(), size);
+ };
+ }
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ if(nodeShape.getLayoutManager() == null) {
+ ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
+ layout.setSpacing(5);
+ nodeShape.setLayoutManager(layout);
+ }
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(CallBehaviorActionNameEditPart.VISUAL_ID));
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ActionLocalPrecondition_4001);
+ types.add(UMLElementTypes.ActionLocalPostcondition_4002);
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof ConstraintAsLocalPrecondEditPart) {
+ types.add(UMLElementTypes.ActionLocalPrecondition_4001);
+ }
+ if(targetEditPart instanceof ConstraintAsLocalPostcondEditPart) {
+ types.add(UMLElementTypes.ActionLocalPrecondition_4001);
+ }
+ if(targetEditPart instanceof ConstraintAsLocalPrecondEditPart) {
+ types.add(UMLElementTypes.ActionLocalPostcondition_4002);
+ }
+ if(targetEditPart instanceof ConstraintAsLocalPostcondEditPart) {
+ types.add(UMLElementTypes.ActionLocalPostcondition_4002);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ActionLocalPrecondition_4001) {
+ types.add(UMLElementTypes.Constraint_3011);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPrecondition_4001) {
+ types.add(UMLElementTypes.Constraint_3012);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPostcondition_4002) {
+ types.add(UMLElementTypes.Constraint_3011);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPostcondition_4002) {
+ types.add(UMLElementTypes.Constraint_3012);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public class ActionFigure extends RoundedRectangle {
+
+
+ /**
+ * @generated
+ */
+ private CenteredWrappedLabel fActionLabel;
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalRakeFigure;
+
+
+ /**
+ * @generated
+ */
+ public ActionFigure() {
+
+ CenterLayout layoutThis = new CenterLayout();
+
+
+ this.setLayoutManager(layoutThis);
+
+ this.setCornerDimensions(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ this.setLineWidth(1);
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fActionLabel = new CenteredWrappedLabel();
+
+
+
+ this.add(fActionLabel);
+
+
+
+ fOptionalRakeFigure = new Polyline();
+ fOptionalRakeFigure.setFill(false);
+ fOptionalRakeFigure.setLineWidth(2);
+
+ this.add(fOptionalRakeFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public CenteredWrappedLabel getActionLabel() {
+ return fActionLabel;
+ }
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalRakeFigure() {
+ return fOptionalRakeFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("CallBehaviorAction", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("CallBehaviorAction", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("CallBehaviorAction", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("CallBehaviorAction", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallBehaviorActionNameEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallBehaviorActionNameEditPart.java
new file mode 100644
index 00000000000..f7d4927c6cd
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallBehaviorActionNameEditPart.java
@@ -0,0 +1,768 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.handles.NonResizableHandleKit;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class CallBehaviorActionNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5004;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ public CallBehaviorActionNameEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy() {
+
+ protected List createSelectionHandles() {
+ List handles = new ArrayList();
+ NonResizableHandleKit.addMoveHandle((GraphicalEditPart)getHost(), handles);
+ ((MoveHandle)handles.get(0)).setBorder(null);
+ return handles;
+ }
+
+ public Command getCommand(Request request) {
+ return null;
+ }
+
+ public boolean understandsRequest(Request request) {
+ return false;
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(CenteredWrappedLabel figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.CallBehaviorAction_3008, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionNameEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void addNotationalListeners() {
+ super.addNotationalListeners();
+ addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeNotationalListeners() {
+ super.removeNotationalListeners();
+ removeListenerFilter("PrimaryView"); //$NON-NLS-1$
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ refreshLabel();
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+
+
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ // Parent should assign one using setLabel() method
+ return null;
+ }
+
+
+
+ private static final String ADD_PARENT_MODEL = "AddParentModel";
+
+
+ /**
+ * @generated
+ */
+ public void activate() {
+ super.activate();
+ addOwnerElementListeners();
+ }
+
+ /**
+ * @generated
+ */
+ protected void addOwnerElementListeners() {
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+
+ }
+
+ /**
+ * @generated
+ */
+ public void deactivate() {
+ removeOwnerElementListeners();
+ super.deactivate();
+
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void removeOwnerElementListeners() {
+ removeListenerFilter(ADD_PARENT_MODEL);
+
+ }
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallOperationActionEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallOperationActionEditPart.java
new file mode 100644
index 00000000000..46e34a811f1
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallOperationActionEditPart.java
@@ -0,0 +1,1012 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RoundedRectangle;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.CallOperationActionItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel;
+import org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.common.draw2d.CenterLayout;
+import org.eclipse.papyrus.diagram.common.editpolicies.BorderItemResizableEditPolicy;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class CallOperationActionEditPart extends
+
+AbstractBorderedShapeEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3010;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public CallOperationActionEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CallOperationActionItemSemanticEditPolicy());
+ installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
+
+
+ //in Papyrus diagrams are not strongly synchronised
+ //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.activity.edit.policies.CallOperationActionCanonicalEditPolicy());
+
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case ActionInputPinInCallOpActEditPart.VISUAL_ID:
+ case ValuePinInCallOpActEditPart.VISUAL_ID:
+ case InputPinInCallOpActEditPart.VISUAL_ID:
+ case OutputPinInCallOpActEditPart.VISUAL_ID:
+ case ValuePinInCallOpActAsTargetEditPart.VISUAL_ID:
+ case ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ case InputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+
+ return new BorderItemResizableEditPolicy();
+
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ ActionFigure figure = new ActionFigure();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public ActionFigure getPrimaryShape() {
+ return (ActionFigure)primaryShape;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof CallOperationActionNameEditPart) {
+ ((CallOperationActionNameEditPart)childEditPart).setLabel(getPrimaryShape().getActionLabel());
+ return true;
+ }
+
+
+
+
+
+ //Papyrus Gencode :Affixed Action Input Pin 3 locator for CallOperationAction argument
+ if(childEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ BorderItemLocator locator = new PinPositionLocator(getMainFigure(), PositionConstants.WEST);
+ getBorderedFigure().getBorderItemContainer().add(((ActionInputPinInCallOpActEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+
+
+
+
+ //Papyrus Gencode :Affixed Value Pin 3 locator for CallOperationAction argument
+ if(childEditPart instanceof ValuePinInCallOpActEditPart) {
+ BorderItemLocator locator = new PinPositionLocator(getMainFigure(), PositionConstants.WEST);
+ getBorderedFigure().getBorderItemContainer().add(((ValuePinInCallOpActEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+
+
+
+
+ //Papyrus Gencode :Affixed Input Pin 3 locator for CallOperationAction argument
+ if(childEditPart instanceof InputPinInCallOpActEditPart) {
+ BorderItemLocator locator = new PinPositionLocator(getMainFigure(), PositionConstants.WEST);
+ getBorderedFigure().getBorderItemContainer().add(((InputPinInCallOpActEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+
+
+
+
+ //Papyrus Gencode :Affixed Output Pin 3 locator for CallOperationAction
+ if(childEditPart instanceof OutputPinInCallOpActEditPart) {
+ BorderItemLocator locator = new PinPositionLocator(getMainFigure(), PositionConstants.EAST);
+ getBorderedFigure().getBorderItemContainer().add(((OutputPinInCallOpActEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+
+
+
+
+ //Papyrus Gencode :Affixed Value Pin 4 locator for CallOperationAction target
+ if(childEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ BorderItemLocator locator = new PinPositionLocator(getMainFigure(), PositionConstants.NORTH);
+ getBorderedFigure().getBorderItemContainer().add(((ValuePinInCallOpActAsTargetEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+
+
+
+
+ //Papyrus Gencode :Affixed Action Input Pin 4 locator for CallOperationAction target
+ if(childEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ BorderItemLocator locator = new PinPositionLocator(getMainFigure(), PositionConstants.NORTH);
+ getBorderedFigure().getBorderItemContainer().add(((ActionInputPinInCallOpActAsTargetEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+
+
+
+
+ //Papyrus Gencode :Affixed Input Pin 4 locator for CallOperationAction target
+ if(childEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ BorderItemLocator locator = new PinPositionLocator(getMainFigure(), PositionConstants.NORTH);
+ getBorderedFigure().getBorderItemContainer().add(((InputPinInCallOpActAsTargetEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+
+
+
+ return false;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected boolean removeFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof CallOperationActionNameEditPart) {
+ return true;
+ }
+ if(childEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ActionInputPinInCallOpActEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof ValuePinInCallOpActEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ValuePinInCallOpActEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof InputPinInCallOpActEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((InputPinInCallOpActEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof OutputPinInCallOpActEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((OutputPinInCallOpActEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ValuePinInCallOpActAsTargetEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ActionInputPinInCallOpActAsTargetEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((InputPinInCallOpActAsTargetEditPart)childEditPart).getFigure());
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if(addFixedChild(childEditPart)) {
+ return;
+ }
+ super.addChildVisual(childEditPart, -1);
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeChildVisual(EditPart childEditPart) {
+ if(removeFixedChild(childEditPart)) {
+ return;
+ }
+ super.removeChildVisual(childEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
+ if(editPart instanceof IBorderItemEditPart) {
+ return getBorderedFigure().getBorderItemContainer();
+ }
+ return getContentPane();
+ }
+
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ if(nodeShape.getLayoutManager() == null) {
+ ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
+ layout.setSpacing(5);
+ nodeShape.setLayoutManager(layout);
+ }
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(CallOperationActionNameEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ActionLocalPrecondition_4001);
+ types.add(UMLElementTypes.ActionLocalPostcondition_4002);
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof ConstraintAsLocalPrecondEditPart) {
+ types.add(UMLElementTypes.ActionLocalPrecondition_4001);
+ }
+ if(targetEditPart instanceof ConstraintAsLocalPostcondEditPart) {
+ types.add(UMLElementTypes.ActionLocalPrecondition_4001);
+ }
+ if(targetEditPart instanceof ConstraintAsLocalPrecondEditPart) {
+ types.add(UMLElementTypes.ActionLocalPostcondition_4002);
+ }
+ if(targetEditPart instanceof ConstraintAsLocalPostcondEditPart) {
+ types.add(UMLElementTypes.ActionLocalPostcondition_4002);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ActionLocalPrecondition_4001) {
+ types.add(UMLElementTypes.Constraint_3011);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPrecondition_4001) {
+ types.add(UMLElementTypes.Constraint_3012);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPostcondition_4002) {
+ types.add(UMLElementTypes.Constraint_3011);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPostcondition_4002) {
+ types.add(UMLElementTypes.Constraint_3012);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class ActionFigure extends RoundedRectangle {
+
+
+ /**
+ * @generated
+ */
+ private CenteredWrappedLabel fActionLabel;
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalRakeFigure;
+
+
+ /**
+ * @generated
+ */
+ public ActionFigure() {
+
+ CenterLayout layoutThis = new CenterLayout();
+
+
+ this.setLayoutManager(layoutThis);
+
+ this.setCornerDimensions(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ this.setLineWidth(1);
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fActionLabel = new CenteredWrappedLabel();
+
+
+
+ this.add(fActionLabel);
+
+
+
+ fOptionalRakeFigure = new Polyline();
+ fOptionalRakeFigure.setFill(false);
+ fOptionalRakeFigure.setLineWidth(2);
+
+ this.add(fOptionalRakeFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public CenteredWrappedLabel getActionLabel() {
+ return fActionLabel;
+ }
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalRakeFigure() {
+ return fOptionalRakeFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("CallOperationAction", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("CallOperationAction", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("CallOperationAction", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("CallOperationAction", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallOperationActionNameEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallOperationActionNameEditPart.java
new file mode 100644
index 00000000000..1698b36fb0d
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/CallOperationActionNameEditPart.java
@@ -0,0 +1,768 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.handles.NonResizableHandleKit;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class CallOperationActionNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5006;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ public CallOperationActionNameEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy() {
+
+ protected List createSelectionHandles() {
+ List handles = new ArrayList();
+ NonResizableHandleKit.addMoveHandle((GraphicalEditPart)getHost(), handles);
+ ((MoveHandle)handles.get(0)).setBorder(null);
+ return handles;
+ }
+
+ public Command getCommand(Request request) {
+ return null;
+ }
+
+ public boolean understandsRequest(Request request) {
+ return false;
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(CenteredWrappedLabel figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.CallOperationAction_3010, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionNameEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void addNotationalListeners() {
+ super.addNotationalListeners();
+ addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeNotationalListeners() {
+ super.removeNotationalListeners();
+ removeListenerFilter("PrimaryView"); //$NON-NLS-1$
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ refreshLabel();
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+
+
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ // Parent should assign one using setLabel() method
+ return null;
+ }
+
+
+
+ private static final String ADD_PARENT_MODEL = "AddParentModel";
+
+
+ /**
+ * @generated
+ */
+ public void activate() {
+ super.activate();
+ addOwnerElementListeners();
+ }
+
+ /**
+ * @generated
+ */
+ protected void addOwnerElementListeners() {
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+
+ }
+
+ /**
+ * @generated
+ */
+ public void deactivate() {
+ removeOwnerElementListeners();
+ super.deactivate();
+
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void removeOwnerElementListeners() {
+ removeListenerFilter(ADD_PARENT_MODEL);
+
+ }
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPostcondEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPostcondEditPart.java
new file mode 100644
index 00000000000..5e349e7ea31
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPostcondEditPart.java
@@ -0,0 +1,432 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ConstraintAsLocalPostcondItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.WrappedLabel;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.common.figure.node.CornerBentFigure;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class ConstraintAsLocalPostcondEditPart extends
+
+ShapeNodeEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3012;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public ConstraintAsLocalPostcondEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ConstraintAsLocalPostcondItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ CornerBentWithTextFigure figure = new CornerBentWithTextFigure();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public CornerBentWithTextFigure getPrimaryShape() {
+ return (CornerBentWithTextFigure)primaryShape;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof ConstraintAsLocalPostcondNameEditPart) {
+ ((ConstraintAsLocalPostcondNameEditPart)childEditPart).setLabel(getPrimaryShape().getCornerBentContent());
+ return true;
+ }
+
+
+ return false;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected boolean removeFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof ConstraintAsLocalPostcondNameEditPart) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if(addFixedChild(childEditPart)) {
+ return;
+ }
+ super.addChildVisual(childEditPart, -1);
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeChildVisual(EditPart childEditPart) {
+ if(removeFixedChild(childEditPart)) {
+ return;
+ }
+ super.removeChildVisual(childEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
+ return getContentPane();
+ }
+
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createNodeFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ if(nodeShape.getLayoutManager() == null) {
+ ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
+ layout.setSpacing(5);
+ nodeShape.setLayoutManager(layout);
+ }
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(ConstraintAsLocalPostcondNameEditPart.VISUAL_ID));
+ }
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ActionLocalPrecondition_4001);
+ types.add(UMLElementTypes.ActionLocalPostcondition_4002);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ActionLocalPrecondition_4001) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPrecondition_4001) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPrecondition_4001) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPostcondition_4002) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPostcondition_4002) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPostcondition_4002) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class CornerBentWithTextFigure extends CornerBentFigure {
+
+
+ /**
+ * @generated
+ */
+ private WrappedLabel fCornerBentContent;
+
+
+ /**
+ * @generated
+ */
+ public CornerBentWithTextFigure() {
+
+
+ this.setBackgroundColor(THIS_BACK);
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fCornerBentContent = new WrappedLabel();
+
+
+
+ this.add(fCornerBentContent);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = false;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public WrappedLabel getCornerBentContent() {
+ return fCornerBentContent;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ static final Color THIS_BACK = new Color(null, 248, 249, 214);
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPostcondNameEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPostcondNameEditPart.java
new file mode 100644
index 00000000000..056ea759df9
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPostcondNameEditPart.java
@@ -0,0 +1,768 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.handles.NonResizableHandleKit;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.WrappedLabel;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ConstraintAsLocalPostcondNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5008;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ public ConstraintAsLocalPostcondNameEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy() {
+
+ protected List createSelectionHandles() {
+ List handles = new ArrayList();
+ NonResizableHandleKit.addMoveHandle((GraphicalEditPart)getHost(), handles);
+ ((MoveHandle)handles.get(0)).setBorder(null);
+ return handles;
+ }
+
+ public Command getCommand(Request request) {
+ return null;
+ }
+
+ public boolean understandsRequest(Request request) {
+ return false;
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(WrappedLabel figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3012, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondNameEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void addNotationalListeners() {
+ super.addNotationalListeners();
+ addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeNotationalListeners() {
+ super.removeNotationalListeners();
+ removeListenerFilter("PrimaryView"); //$NON-NLS-1$
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ refreshLabel();
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+
+
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ // Parent should assign one using setLabel() method
+ return null;
+ }
+
+
+
+ private static final String ADD_PARENT_MODEL = "AddParentModel";
+
+
+ /**
+ * @generated
+ */
+ public void activate() {
+ super.activate();
+ addOwnerElementListeners();
+ }
+
+ /**
+ * @generated
+ */
+ protected void addOwnerElementListeners() {
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+
+ }
+
+ /**
+ * @generated
+ */
+ public void deactivate() {
+ removeOwnerElementListeners();
+ super.deactivate();
+
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void removeOwnerElementListeners() {
+ removeListenerFilter(ADD_PARENT_MODEL);
+
+ }
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPrecondEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPrecondEditPart.java
new file mode 100644
index 00000000000..5a2343e902c
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPrecondEditPart.java
@@ -0,0 +1,432 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ConstraintAsLocalPrecondItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.WrappedLabel;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.common.figure.node.CornerBentFigure;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class ConstraintAsLocalPrecondEditPart extends
+
+ShapeNodeEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3011;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public ConstraintAsLocalPrecondEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ConstraintAsLocalPrecondItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ CornerBentWithTextFigure figure = new CornerBentWithTextFigure();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public CornerBentWithTextFigure getPrimaryShape() {
+ return (CornerBentWithTextFigure)primaryShape;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof ConstraintAsLocalPrecondNameEditPart) {
+ ((ConstraintAsLocalPrecondNameEditPart)childEditPart).setLabel(getPrimaryShape().getCornerBentContent());
+ return true;
+ }
+
+
+ return false;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected boolean removeFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof ConstraintAsLocalPrecondNameEditPart) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if(addFixedChild(childEditPart)) {
+ return;
+ }
+ super.addChildVisual(childEditPart, -1);
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeChildVisual(EditPart childEditPart) {
+ if(removeFixedChild(childEditPart)) {
+ return;
+ }
+ super.removeChildVisual(childEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
+ return getContentPane();
+ }
+
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createNodeFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ if(nodeShape.getLayoutManager() == null) {
+ ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
+ layout.setSpacing(5);
+ nodeShape.setLayoutManager(layout);
+ }
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(ConstraintAsLocalPrecondNameEditPart.VISUAL_ID));
+ }
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ActionLocalPrecondition_4001);
+ types.add(UMLElementTypes.ActionLocalPostcondition_4002);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ActionLocalPrecondition_4001) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPrecondition_4001) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPrecondition_4001) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPostcondition_4002) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPostcondition_4002) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPostcondition_4002) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class CornerBentWithTextFigure extends CornerBentFigure {
+
+
+ /**
+ * @generated
+ */
+ private WrappedLabel fCornerBentContent;
+
+
+ /**
+ * @generated
+ */
+ public CornerBentWithTextFigure() {
+
+
+ this.setBackgroundColor(THIS_BACK);
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fCornerBentContent = new WrappedLabel();
+
+
+
+ this.add(fCornerBentContent);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = false;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public WrappedLabel getCornerBentContent() {
+ return fCornerBentContent;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ static final Color THIS_BACK = new Color(null, 248, 249, 214);
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("Constraint", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPrecondNameEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPrecondNameEditPart.java
new file mode 100644
index 00000000000..fd74ae2e287
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintAsLocalPrecondNameEditPart.java
@@ -0,0 +1,768 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.handles.NonResizableHandleKit;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.WrappedLabel;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ConstraintAsLocalPrecondNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5007;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ public ConstraintAsLocalPrecondNameEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy() {
+
+ protected List createSelectionHandles() {
+ List handles = new ArrayList();
+ NonResizableHandleKit.addMoveHandle((GraphicalEditPart)getHost(), handles);
+ ((MoveHandle)handles.get(0)).setBorder(null);
+ return handles;
+ }
+
+ public Command getCommand(Request request) {
+ return null;
+ }
+
+ public boolean understandsRequest(Request request) {
+ return false;
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(WrappedLabel figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3011, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondNameEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void addNotationalListeners() {
+ super.addNotationalListeners();
+ addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeNotationalListeners() {
+ super.removeNotationalListeners();
+ removeListenerFilter("PrimaryView"); //$NON-NLS-1$
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ refreshLabel();
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+
+
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ // Parent should assign one using setLabel() method
+ return null;
+ }
+
+
+
+ private static final String ADD_PARENT_MODEL = "AddParentModel";
+
+
+ /**
+ * @generated
+ */
+ public void activate() {
+ super.activate();
+ addOwnerElementListeners();
+ }
+
+ /**
+ * @generated
+ */
+ protected void addOwnerElementListeners() {
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+
+ }
+
+ /**
+ * @generated
+ */
+ public void deactivate() {
+ removeOwnerElementListeners();
+ super.deactivate();
+
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void removeOwnerElementListeners() {
+ removeListenerFilter(ADD_PARENT_MODEL);
+
+ }
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintInActivityAsPostcondEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintInActivityAsPostcondEditPart.java
new file mode 100644
index 00000000000..2c7e22b0e3c
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintInActivityAsPostcondEditPart.java
@@ -0,0 +1,750 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.requests.SelectionRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ConstraintInActivityAsPostcondItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextNonResizableEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ConstraintInActivityAsPostcondEditPart extends CompartmentEditPart implements ITextAwareEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3003;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ public ConstraintInActivityAsPostcondEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ public DragTracker getDragTracker(Request request) {
+ if(request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3) {
+ return null;
+ }
+ return new DragEditPartsTrackerEx(this);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ConstraintInActivityAsPostcondItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new UMLTextNonResizableEditPolicy());
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3003, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPostcondEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void addNotationalListeners() {
+ super.addNotationalListeners();
+ addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeNotationalListeners() {
+ super.removeNotationalListeners();
+ removeListenerFilter("PrimaryView"); //$NON-NLS-1$
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintInActivityAsPrecondEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintInActivityAsPrecondEditPart.java
new file mode 100644
index 00000000000..681f5154e9e
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ConstraintInActivityAsPrecondEditPart.java
@@ -0,0 +1,750 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.requests.SelectionRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ConstraintInActivityAsPrecondItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextNonResizableEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ConstraintInActivityAsPrecondEditPart extends CompartmentEditPart implements ITextAwareEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3002;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ public ConstraintInActivityAsPrecondEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ public DragTracker getDragTracker(Request request) {
+ if(request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3) {
+ return null;
+ }
+ return new DragEditPartsTrackerEx(this);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ConstraintInActivityAsPrecondItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new UMLTextNonResizableEditPolicy());
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3002, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPrecondEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void addNotationalListeners() {
+ super.addNotationalListeners();
+ addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeNotationalListeners() {
+ super.removeNotationalListeners();
+ removeListenerFilter("PrimaryView"); //$NON-NLS-1$
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ControlFlowEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ControlFlowEditPart.java
new file mode 100644
index 00000000000..fe444cd0fe5
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ControlFlowEditPart.java
@@ -0,0 +1,178 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import org.eclipse.draw2d.Connection;
+import org.eclipse.draw2d.PolylineDecoration;
+import org.eclipse.draw2d.RotatableDecoration;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ControlFlowItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.WrappedLabel;
+
+/**
+ * @generated
+ */
+public class ControlFlowEditPart extends ConnectionNodeEditPart
+
+implements ITreeBranchEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 4004;
+
+ /**
+ * @generated
+ */
+ public ControlFlowEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ControlFlowItemSemanticEditPolicy());
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if(addFixedChild(childEditPart)) {
+ return;
+ }
+ super.addChildVisual(childEditPart, -1);
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean removeFixedChild(EditPart childEditPart) {
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeChildVisual(EditPart childEditPart) {
+ if(removeFixedChild(childEditPart)) {
+ return;
+ }
+ super.removeChildVisual(childEditPart);
+ }
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+
+ protected Connection createConnectionFigure() {
+ return new ActivityEdgeDescriptor();
+ }
+
+ /**
+ * @generated
+ */
+ public ActivityEdgeDescriptor getPrimaryShape() {
+ return (ActivityEdgeDescriptor)getFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class ActivityEdgeDescriptor extends PolylineConnectionEx {
+
+
+
+
+ /**
+ * @generated
+ */
+ private WrappedLabel fEdgeName;
+
+ /**
+ * @generated
+ */
+ private WrappedLabel fEdgeWeight;
+
+ /**
+ * @generated
+ */
+ public ActivityEdgeDescriptor() {
+ this.setLineWidth(1);
+
+ setTargetDecoration(createTargetDecoration());
+ }
+
+ /**
+ * @generated NOT scale changed from default 7:3 to 5:2 to make a smaller arrow
+ */
+ private RotatableDecoration createTargetDecoration() {
+ PolylineDecoration df = new PolylineDecoration();
+ df.setLineWidth(1);
+ PointList pl = new PointList();
+ pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
+ pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
+ pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2));
+ df.setTemplate(pl);
+ df.setScale(getMapMode().DPtoLP(5), getMapMode().DPtoLP(2));
+ return df;
+ }
+
+ /**
+ * @generated
+ */
+ public WrappedLabel getEdgeName() {
+ return fEdgeName;
+ }
+
+ /**
+ * @generated
+ */
+ public WrappedLabel getEdgeWeight() {
+ return fEdgeWeight;
+ }
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ControlFlowNameEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ControlFlowNameEditPart.java
new file mode 100644
index 00000000000..3a968836abc
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ControlFlowNameEditPart.java
@@ -0,0 +1,743 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.ConnectionLocator;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ControlFlowNameEditPart extends LabelEditPart implements ITextAwareEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 6003;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowNameEditPart.VISUAL_ID), new Point(0, 40));
+ }
+
+ /**
+ * @generated
+ */
+ public ControlFlowNameEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableLabelEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ public int getKeyPoint() {
+ return ConnectionLocator.MIDDLE;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ControlFlow_4004, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowNameEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+
+
+
+
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ControlFlowWeightEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ControlFlowWeightEditPart.java
new file mode 100644
index 00000000000..3151c3c7086
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ControlFlowWeightEditPart.java
@@ -0,0 +1,746 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.ConnectionLocator;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ControlFlowWeightEditPart extends LabelEditPart implements ITextAwareEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 6004;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowWeightEditPart.VISUAL_ID), new Point(0, 60));
+ }
+
+ /**
+ * @generated
+ */
+ public ControlFlowWeightEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableLabelEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ public int getKeyPoint() {
+ return ConnectionLocator.MIDDLE;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ControlFlow_4004, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowWeightEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+
+
+
+
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/FlowFinalNodeEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/FlowFinalNodeEditPart.java
index fa8bda6aa48..179c062de1b 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/FlowFinalNodeEditPart.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/FlowFinalNodeEditPart.java
@@ -13,6 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.diagram.activity.edit.parts;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.draw2d.Ellipse;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Polyline;
@@ -29,9 +32,11 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.gmf.runtime.notation.NotationPackage;
@@ -40,6 +45,7 @@ import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.papyrus.diagram.activity.edit.policies.FlowFinalNodeItemSemanticEditPolicy;
import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.graphics.Color;
@@ -202,6 +208,428 @@ ShapeNodeEditPart {
/**
* @generated
*/
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
public class FlowFinalNodeFigure extends RectangleFigure {
/**
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InitialNodeEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InitialNodeEditPart.java
index cb1b48037d5..324e41e6e33 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InitialNodeEditPart.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InitialNodeEditPart.java
@@ -13,9 +13,13 @@
*****************************************************************************/
package org.eclipse.papyrus.diagram.activity.edit.parts;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Ellipse;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.RectangleFigure;
import org.eclipse.draw2d.Shape;
import org.eclipse.draw2d.StackLayout;
@@ -27,10 +31,13 @@ import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.editpolicies.ResizableEditPolicy;
import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.gmf.runtime.notation.NotationPackage;
@@ -39,6 +46,7 @@ import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.papyrus.diagram.activity.edit.policies.InitialNodeItemSemanticEditPolicy;
import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.graphics.Color;
@@ -133,6 +141,18 @@ ShapeNodeEditPart {
}
/**
+ * @generated
+ */
+ public EditPolicy getPrimaryDragEditPolicy() {
+ EditPolicy result = super.getPrimaryDragEditPolicy();
+ if(result instanceof ResizableEditPolicy) {
+ ResizableEditPolicy ep = (ResizableEditPolicy)result;
+ ep.setResizeDirections(PositionConstants.NONE);
+ }
+ return result;
+ }
+
+ /**
* Creates figure for this edit part.
*
* Body of this method does not depend on settings in generation model
@@ -201,6 +221,428 @@ ShapeNodeEditPart {
/**
* @generated
*/
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
public class InitialNodeFigure extends RectangleFigure {
/**
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCBActLabelEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCBActLabelEditPart.java
new file mode 100644
index 00000000000..69b7b08286f
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCBActLabelEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class InputPinInCBActLabelEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5015;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCBActLabelEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public InputPinInCBActLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.InputPin_3019, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCBActLabelEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCOActAsTargetLabelEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCOActAsTargetLabelEditPart.java
new file mode 100644
index 00000000000..344db38111c
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCOActAsTargetLabelEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class InputPinInCOActAsTargetLabelEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5023;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCOActAsTargetLabelEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public InputPinInCOActAsTargetLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.InputPin_3027, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCOActAsTargetLabelEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCOActLabelEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCOActLabelEditPart.java
new file mode 100644
index 00000000000..a097f4f00fb
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCOActLabelEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class InputPinInCOActLabelEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5019;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCOActLabelEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public InputPinInCOActLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.InputPin_3023, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCOActLabelEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCallBeActEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCallBeActEditPart.java
new file mode 100644
index 00000000000..d0628495d52
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCallBeActEditPart.java
@@ -0,0 +1,791 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.InputPinInCallBeActItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class InputPinInCallBeActEditPart extends
+
+BorderedBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3019;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public InputPinInCallBeActEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new InputPinInCallBeActItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case InputPinInCBActLabelEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ PinDescriptor figure = new PinDescriptor();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public PinDescriptor getPrimaryShape() {
+ return (PinDescriptor)primaryShape;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof InputPinInCBActLabelEditPart) {
+ BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ locator.setBorderItemOffset(new Dimension(-20, -20));
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 16);
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(InputPinInCBActLabelEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCallOpActAsTargetEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCallOpActAsTargetEditPart.java
new file mode 100644
index 00000000000..c50d0bc192f
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCallOpActAsTargetEditPart.java
@@ -0,0 +1,791 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.InputPinInCallOpActAsTargetItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class InputPinInCallOpActAsTargetEditPart extends
+
+BorderedBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3027;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public InputPinInCallOpActAsTargetEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new InputPinInCallOpActAsTargetItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case InputPinInCOActAsTargetLabelEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ PinDescriptor figure = new PinDescriptor();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public PinDescriptor getPrimaryShape() {
+ return (PinDescriptor)primaryShape;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof InputPinInCOActAsTargetLabelEditPart) {
+ BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ locator.setBorderItemOffset(new Dimension(-20, -20));
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 16);
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(InputPinInCOActAsTargetLabelEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCallOpActEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCallOpActEditPart.java
new file mode 100644
index 00000000000..6174811d4e5
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInCallOpActEditPart.java
@@ -0,0 +1,791 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.InputPinInCallOpActItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class InputPinInCallOpActEditPart extends
+
+BorderedBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3023;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public InputPinInCallOpActEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new InputPinInCallOpActItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case InputPinInCOActLabelEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ PinDescriptor figure = new PinDescriptor();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public PinDescriptor getPrimaryShape() {
+ return (PinDescriptor)primaryShape;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof InputPinInCOActLabelEditPart) {
+ BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ locator.setBorderItemOffset(new Dimension(-20, -20));
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 16);
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(InputPinInCOActLabelEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInOActLabelEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInOActLabelEditPart.java
new file mode 100644
index 00000000000..1ae25ef3c70
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInOActLabelEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class InputPinInOActLabelEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5009;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOActLabelEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public InputPinInOActLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.InputPin_3013, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOActLabelEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInOpaqueActEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInOpaqueActEditPart.java
new file mode 100644
index 00000000000..d7e5f91f81e
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinInOpaqueActEditPart.java
@@ -0,0 +1,791 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.InputPinInOpaqueActItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class InputPinInOpaqueActEditPart extends
+
+BorderedBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3013;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public InputPinInOpaqueActEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new InputPinInOpaqueActItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case InputPinInOActLabelEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ PinDescriptor figure = new PinDescriptor();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public PinDescriptor getPrimaryShape() {
+ return (PinDescriptor)primaryShape;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof InputPinInOActLabelEditPart) {
+ BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ locator.setBorderItemOffset(new Dimension(-20, -20));
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 16);
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(InputPinInOActLabelEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("InputPin", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinNameEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinNameEditPart.java
new file mode 100644
index 00000000000..888e7e6808e
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/InputPinNameEditPart.java
@@ -0,0 +1,806 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class InputPinNameEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5009;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.InputPinNameEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public InputPinNameEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.InputPin_3013, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.InputPinNameEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new PinDescriptor();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowEditPart.java
new file mode 100644
index 00000000000..935b571616f
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowEditPart.java
@@ -0,0 +1,181 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import org.eclipse.draw2d.Connection;
+import org.eclipse.draw2d.PolylineDecoration;
+import org.eclipse.draw2d.RotatableDecoration;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.policies.CreateObjectFlowBehaviorEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ObjectFlowItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.WrappedLabel;
+
+/**
+ * @generated
+ */
+public class ObjectFlowEditPart extends ConnectionNodeEditPart
+
+implements ITreeBranchEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 4003;
+
+ /**
+ * @generated
+ */
+ public ObjectFlowEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ObjectFlowItemSemanticEditPolicy());
+ installEditPolicy(RequestConstants.REQ_CREATE, new CreateObjectFlowBehaviorEditPolicy());
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if(addFixedChild(childEditPart)) {
+ return;
+ }
+ super.addChildVisual(childEditPart, -1);
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean removeFixedChild(EditPart childEditPart) {
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeChildVisual(EditPart childEditPart) {
+ if(removeFixedChild(childEditPart)) {
+ return;
+ }
+ super.removeChildVisual(childEditPart);
+ }
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+
+ protected Connection createConnectionFigure() {
+ return new ActivityEdgeDescriptor();
+ }
+
+ /**
+ * @generated
+ */
+ public ActivityEdgeDescriptor getPrimaryShape() {
+ return (ActivityEdgeDescriptor)getFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class ActivityEdgeDescriptor extends PolylineConnectionEx {
+
+
+
+
+ /**
+ * @generated
+ */
+ private WrappedLabel fEdgeName;
+
+ /**
+ * @generated
+ */
+ private WrappedLabel fEdgeWeight;
+
+ /**
+ * @generated
+ */
+ public ActivityEdgeDescriptor() {
+ this.setLineWidth(1);
+
+ setTargetDecoration(createTargetDecoration());
+ }
+
+ /**
+ * @generated NOT scale changed from default 7:3 to 5:2 to make a smaller arrow
+ */
+ private RotatableDecoration createTargetDecoration() {
+ PolylineDecoration df = new PolylineDecoration();
+ df.setLineWidth(1);
+ PointList pl = new PointList();
+ pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
+ pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
+ pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2));
+ df.setTemplate(pl);
+ df.setScale(getMapMode().DPtoLP(5), getMapMode().DPtoLP(2));
+ return df;
+ }
+
+ /**
+ * @generated
+ */
+ public WrappedLabel getEdgeName() {
+ return fEdgeName;
+ }
+
+ /**
+ * @generated
+ */
+ public WrappedLabel getEdgeWeight() {
+ return fEdgeWeight;
+ }
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowNameEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowNameEditPart.java
new file mode 100644
index 00000000000..30a12ac58bc
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowNameEditPart.java
@@ -0,0 +1,743 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.ConnectionLocator;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ObjectFlowNameEditPart extends LabelEditPart implements ITextAwareEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 6001;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowNameEditPart.VISUAL_ID), new Point(0, 40));
+ }
+
+ /**
+ * @generated
+ */
+ public ObjectFlowNameEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableLabelEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ public int getKeyPoint() {
+ return ConnectionLocator.MIDDLE;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ObjectFlow_4003, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowNameEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+
+
+
+
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowSelectionEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowSelectionEditPart.java
new file mode 100644
index 00000000000..f995aa98775
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowSelectionEditPart.java
@@ -0,0 +1,101 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import org.eclipse.draw2d.Connection;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ObjectFlowSelectionItemSemanticEditPolicy;
+
+/**
+ * @generated
+ */
+public class ObjectFlowSelectionEditPart extends ConnectionNodeEditPart
+
+implements ITreeBranchEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 4005;
+
+ /**
+ * @generated
+ */
+ public ObjectFlowSelectionEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ObjectFlowSelectionItemSemanticEditPolicy());
+ }
+
+
+
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+
+ protected Connection createConnectionFigure() {
+ return new DashedLinkDescriptor();
+ }
+
+ /**
+ * @generated
+ */
+ public DashedLinkDescriptor getPrimaryShape() {
+ return (DashedLinkDescriptor)getFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class DashedLinkDescriptor extends PolylineConnectionEx {
+
+
+
+
+ /**
+ * @generated
+ */
+ public DashedLinkDescriptor() {
+ this.setLineWidth(1);
+ this.setLineStyle(Graphics.LINE_DASH);
+
+ }
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowTransformationEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowTransformationEditPart.java
new file mode 100644
index 00000000000..2703b929fff
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowTransformationEditPart.java
@@ -0,0 +1,101 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import org.eclipse.draw2d.Connection;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ObjectFlowTransformationItemSemanticEditPolicy;
+
+/**
+ * @generated
+ */
+public class ObjectFlowTransformationEditPart extends ConnectionNodeEditPart
+
+implements ITreeBranchEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 4006;
+
+ /**
+ * @generated
+ */
+ public ObjectFlowTransformationEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ObjectFlowTransformationItemSemanticEditPolicy());
+ }
+
+
+
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+
+ protected Connection createConnectionFigure() {
+ return new DashedLinkDescriptor();
+ }
+
+ /**
+ * @generated
+ */
+ public DashedLinkDescriptor getPrimaryShape() {
+ return (DashedLinkDescriptor)getFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class DashedLinkDescriptor extends PolylineConnectionEx {
+
+
+
+
+ /**
+ * @generated
+ */
+ public DashedLinkDescriptor() {
+ this.setLineWidth(1);
+ this.setLineStyle(Graphics.LINE_DASH);
+
+ }
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowWeightEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowWeightEditPart.java
new file mode 100644
index 00000000000..c979b17f075
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ObjectFlowWeightEditPart.java
@@ -0,0 +1,746 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.ConnectionLocator;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ObjectFlowWeightEditPart extends LabelEditPart implements ITextAwareEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 6002;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowWeightEditPart.VISUAL_ID), new Point(0, 60));
+ }
+
+ /**
+ * @generated
+ */
+ public ObjectFlowWeightEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableLabelEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ public int getKeyPoint() {
+ return ConnectionLocator.MIDDLE;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ObjectFlow_4003, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowWeightEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+
+
+
+
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OpaqueActionEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OpaqueActionEditPart.java
new file mode 100644
index 00000000000..307086d6170
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OpaqueActionEditPart.java
@@ -0,0 +1,964 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RoundedRectangle;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpaqueActionItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel;
+import org.eclipse.papyrus.diagram.activity.locator.PinPositionLocator;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.common.draw2d.CenterLayout;
+import org.eclipse.papyrus.diagram.common.editpolicies.BorderItemResizableEditPolicy;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class OpaqueActionEditPart extends
+
+AbstractBorderedShapeEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3007;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public OpaqueActionEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new OpaqueActionItemSemanticEditPolicy());
+ installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
+
+
+ //in Papyrus diagrams are not strongly synchronised
+ //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.diagram.activity.edit.policies.OpaqueActionCanonicalEditPolicy());
+
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case ValuePinInOpaqueActEditPart.VISUAL_ID:
+ case ActionInputPinInOpaqueActEditPart.VISUAL_ID:
+ case InputPinInOpaqueActEditPart.VISUAL_ID:
+ case OutputPinInOpaqueActEditPart.VISUAL_ID:
+
+ return new BorderItemResizableEditPolicy();
+
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ ActionFigure figure = new ActionFigure();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public ActionFigure getPrimaryShape() {
+ return (ActionFigure)primaryShape;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof OpaqueActionNameEditPart) {
+ ((OpaqueActionNameEditPart)childEditPart).setLabel(getPrimaryShape().getActionLabel());
+ return true;
+ }
+
+
+
+
+
+ //Papyrus Gencode :Affixed Value Pin locator for OpaqueAction
+ if(childEditPart instanceof ValuePinInOpaqueActEditPart) {
+ BorderItemLocator locator = new PinPositionLocator(getMainFigure(), PositionConstants.WEST);
+ getBorderedFigure().getBorderItemContainer().add(((ValuePinInOpaqueActEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+
+
+
+
+ //Papyrus Gencode :Affixed Action Input Pin locator for OpaqueAction
+ if(childEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ BorderItemLocator locator = new PinPositionLocator(getMainFigure(), PositionConstants.WEST);
+ getBorderedFigure().getBorderItemContainer().add(((ActionInputPinInOpaqueActEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+
+
+
+
+ //Papyrus Gencode :Affixed Input Pin locator for OpaqueAction
+ if(childEditPart instanceof InputPinInOpaqueActEditPart) {
+ BorderItemLocator locator = new PinPositionLocator(getMainFigure(), PositionConstants.WEST);
+ getBorderedFigure().getBorderItemContainer().add(((InputPinInOpaqueActEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+
+
+
+
+ //Papyrus Gencode :Affixed Output Pin locator for OpaqueAction
+ if(childEditPart instanceof OutputPinInOpaqueActEditPart) {
+ BorderItemLocator locator = new PinPositionLocator(getMainFigure(), PositionConstants.EAST);
+ getBorderedFigure().getBorderItemContainer().add(((OutputPinInOpaqueActEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+
+
+
+ return false;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected boolean removeFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof OpaqueActionNameEditPart) {
+ return true;
+ }
+ if(childEditPart instanceof ValuePinInOpaqueActEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ValuePinInOpaqueActEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ActionInputPinInOpaqueActEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof InputPinInOpaqueActEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((InputPinInOpaqueActEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof OutputPinInOpaqueActEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((OutputPinInOpaqueActEditPart)childEditPart).getFigure());
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if(addFixedChild(childEditPart)) {
+ return;
+ }
+ super.addChildVisual(childEditPart, -1);
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeChildVisual(EditPart childEditPart) {
+ if(removeFixedChild(childEditPart)) {
+ return;
+ }
+ super.removeChildVisual(childEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
+ if(editPart instanceof IBorderItemEditPart) {
+ return getBorderedFigure().getBorderItemContainer();
+ }
+ return getContentPane();
+ }
+
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ if(nodeShape.getLayoutManager() == null) {
+ ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
+ layout.setSpacing(5);
+ nodeShape.setLayoutManager(layout);
+ }
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(OpaqueActionNameEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ActionLocalPrecondition_4001);
+ types.add(UMLElementTypes.ActionLocalPostcondition_4002);
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof ConstraintAsLocalPrecondEditPart) {
+ types.add(UMLElementTypes.ActionLocalPrecondition_4001);
+ }
+ if(targetEditPart instanceof ConstraintAsLocalPostcondEditPart) {
+ types.add(UMLElementTypes.ActionLocalPrecondition_4001);
+ }
+ if(targetEditPart instanceof ConstraintAsLocalPrecondEditPart) {
+ types.add(UMLElementTypes.ActionLocalPostcondition_4002);
+ }
+ if(targetEditPart instanceof ConstraintAsLocalPostcondEditPart) {
+ types.add(UMLElementTypes.ActionLocalPostcondition_4002);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ActionLocalPrecondition_4001) {
+ types.add(UMLElementTypes.Constraint_3011);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPrecondition_4001) {
+ types.add(UMLElementTypes.Constraint_3012);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPostcondition_4002) {
+ types.add(UMLElementTypes.Constraint_3011);
+ }
+ if(relationshipType == UMLElementTypes.ActionLocalPostcondition_4002) {
+ types.add(UMLElementTypes.Constraint_3012);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class ActionFigure extends RoundedRectangle {
+
+
+ /**
+ * @generated
+ */
+ private CenteredWrappedLabel fActionLabel;
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalRakeFigure;
+
+
+ /**
+ * @generated
+ */
+ public ActionFigure() {
+
+ CenterLayout layoutThis = new CenterLayout();
+
+
+ this.setLayoutManager(layoutThis);
+
+ this.setCornerDimensions(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ this.setLineWidth(1);
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fActionLabel = new CenteredWrappedLabel();
+
+
+
+ this.add(fActionLabel);
+
+
+
+ fOptionalRakeFigure = new Polyline();
+ fOptionalRakeFigure.setFill(false);
+ fOptionalRakeFigure.setLineWidth(2);
+
+ this.add(fOptionalRakeFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public CenteredWrappedLabel getActionLabel() {
+ return fActionLabel;
+ }
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalRakeFigure() {
+ return fOptionalRakeFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("OpaqueAction", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("OpaqueAction", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("OpaqueAction", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("OpaqueAction", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OpaqueActionNameEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OpaqueActionNameEditPart.java
new file mode 100644
index 00000000000..75d9e66a1bb
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OpaqueActionNameEditPart.java
@@ -0,0 +1,768 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.handles.NonResizableHandleKit;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.figures.CenteredWrappedLabel;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class OpaqueActionNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5003;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ public OpaqueActionNameEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy() {
+
+ protected List createSelectionHandles() {
+ List handles = new ArrayList();
+ NonResizableHandleKit.addMoveHandle((GraphicalEditPart)getHost(), handles);
+ ((MoveHandle)handles.get(0)).setBorder(null);
+ return handles;
+ }
+
+ public Command getCommand(Request request) {
+ return null;
+ }
+
+ public boolean understandsRequest(Request request) {
+ return false;
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(CenteredWrappedLabel figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.OpaqueAction_3007, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionNameEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void addNotationalListeners() {
+ super.addNotationalListeners();
+ addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeNotationalListeners() {
+ super.removeNotationalListeners();
+ removeListenerFilter("PrimaryView"); //$NON-NLS-1$
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ refreshLabel();
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+
+
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ // Parent should assign one using setLabel() method
+ return null;
+ }
+
+
+
+ private static final String ADD_PARENT_MODEL = "AddParentModel";
+
+
+ /**
+ * @generated
+ */
+ public void activate() {
+ super.activate();
+ addOwnerElementListeners();
+ }
+
+ /**
+ * @generated
+ */
+ protected void addOwnerElementListeners() {
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+
+ }
+
+ /**
+ * @generated
+ */
+ public void deactivate() {
+ removeOwnerElementListeners();
+ super.deactivate();
+
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void removeOwnerElementListeners() {
+ removeListenerFilter(ADD_PARENT_MODEL);
+
+ }
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCBActLabelEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCBActLabelEditPart.java
new file mode 100644
index 00000000000..47ea08cd907
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCBActLabelEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class OutputPinInCBActLabelEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5016;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCBActLabelEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public OutputPinInCBActLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.OutputPin_3020, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCBActLabelEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCOActLabelEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCOActLabelEditPart.java
new file mode 100644
index 00000000000..d2ccc750542
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCOActLabelEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class OutputPinInCOActLabelEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5020;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCOActLabelEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public OutputPinInCOActLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.OutputPin_3024, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCOActLabelEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCallBeActEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCallBeActEditPart.java
new file mode 100644
index 00000000000..9a0a9ee03f2
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCallBeActEditPart.java
@@ -0,0 +1,791 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OutputPinInCallBeActItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class OutputPinInCallBeActEditPart extends
+
+BorderedBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3020;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public OutputPinInCallBeActEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new OutputPinInCallBeActItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case OutputPinInCBActLabelEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ PinDescriptor figure = new PinDescriptor();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public PinDescriptor getPrimaryShape() {
+ return (PinDescriptor)primaryShape;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof OutputPinInCBActLabelEditPart) {
+ BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ locator.setBorderItemOffset(new Dimension(-20, -20));
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 16);
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(OutputPinInCBActLabelEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("OutputPin", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("OutputPin", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("OutputPin", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("OutputPin", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCallOpActEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCallOpActEditPart.java
new file mode 100644
index 00000000000..ae63590528f
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInCallOpActEditPart.java
@@ -0,0 +1,791 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OutputPinInCallOpActItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class OutputPinInCallOpActEditPart extends
+
+BorderedBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3024;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public OutputPinInCallOpActEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new OutputPinInCallOpActItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case OutputPinInCOActLabelEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ PinDescriptor figure = new PinDescriptor();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public PinDescriptor getPrimaryShape() {
+ return (PinDescriptor)primaryShape;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof OutputPinInCOActLabelEditPart) {
+ BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ locator.setBorderItemOffset(new Dimension(-20, -20));
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 16);
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(OutputPinInCOActLabelEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("OutputPin", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("OutputPin", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("OutputPin", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("OutputPin", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInOActLabelEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInOActLabelEditPart.java
new file mode 100644
index 00000000000..22222c34ac4
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInOActLabelEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class OutputPinInOActLabelEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5010;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOActLabelEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public OutputPinInOActLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.OutputPin_3014, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOActLabelEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInOpaqueActEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInOpaqueActEditPart.java
new file mode 100644
index 00000000000..fc8f154e176
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinInOpaqueActEditPart.java
@@ -0,0 +1,791 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OutputPinInOpaqueActItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class OutputPinInOpaqueActEditPart extends
+
+BorderedBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3014;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public OutputPinInOpaqueActEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new OutputPinInOpaqueActItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case OutputPinInOActLabelEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ PinDescriptor figure = new PinDescriptor();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public PinDescriptor getPrimaryShape() {
+ return (PinDescriptor)primaryShape;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof OutputPinInOActLabelEditPart) {
+ BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ locator.setBorderItemOffset(new Dimension(-20, -20));
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 16);
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(OutputPinInOActLabelEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("OutputPin", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("OutputPin", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("OutputPin", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("OutputPin", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinNameEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinNameEditPart.java
new file mode 100644
index 00000000000..39f3bfacf95
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/OutputPinNameEditPart.java
@@ -0,0 +1,806 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class OutputPinNameEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5010;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinNameEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public OutputPinNameEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.OutputPin_3014, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinNameEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new PinDescriptor();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ParameterEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ParameterEditPart.java
index ef804e3615a..65f4a19a0ae 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ParameterEditPart.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ParameterEditPart.java
@@ -715,20 +715,27 @@ CompartmentEditPart implements ITextAwareEditPart {
* @generated
*/
protected IFigure createFigurePrim() {
- return new ActivityParameterFigure();
+ return new CommonLabelFigure();
}
/**
* @generated
*/
- public class ActivityParameterFigure extends WrappingLabel {
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
/**
* @generated
*/
- public ActivityParameterFigure() {
+ public CommonLabelFigure() {
this.setText("");
}
+
+
+
+
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/UMLEditPartFactory.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/UMLEditPartFactory.java
index 041c467b2b3..dda11301689 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/UMLEditPartFactory.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/UMLEditPartFactory.java
@@ -56,11 +56,11 @@ public class UMLEditPartFactory implements EditPartFactory {
case ParameterEditPart.VISUAL_ID:
return new ParameterEditPart(view);
- case ConstraintEditPart.VISUAL_ID:
- return new ConstraintEditPart(view);
+ case ConstraintInActivityAsPrecondEditPart.VISUAL_ID:
+ return new ConstraintInActivityAsPrecondEditPart(view);
- case Constraint2EditPart.VISUAL_ID:
- return new Constraint2EditPart(view);
+ case ConstraintInActivityAsPostcondEditPart.VISUAL_ID:
+ return new ConstraintInActivityAsPostcondEditPart(view);
case InitialNodeEditPart.VISUAL_ID:
return new InitialNodeEditPart(view);
@@ -71,6 +71,162 @@ public class UMLEditPartFactory implements EditPartFactory {
case FlowFinalNodeEditPart.VISUAL_ID:
return new FlowFinalNodeEditPart(view);
+ case OpaqueActionEditPart.VISUAL_ID:
+ return new OpaqueActionEditPart(view);
+
+ case OpaqueActionNameEditPart.VISUAL_ID:
+ return new OpaqueActionNameEditPart(view);
+
+ case ValuePinInOpaqueActEditPart.VISUAL_ID:
+ return new ValuePinInOpaqueActEditPart(view);
+
+ case ValuePinInOActLabelEditPart.VISUAL_ID:
+ return new ValuePinInOActLabelEditPart(view);
+
+ case ValuePinInOActValueEditPart.VISUAL_ID:
+ return new ValuePinInOActValueEditPart(view);
+
+ case ActionInputPinInOpaqueActEditPart.VISUAL_ID:
+ return new ActionInputPinInOpaqueActEditPart(view);
+
+ case ActionInputPinInOActLabelEditPart.VISUAL_ID:
+ return new ActionInputPinInOActLabelEditPart(view);
+
+ case ActionInputPinInOActValueEditPart.VISUAL_ID:
+ return new ActionInputPinInOActValueEditPart(view);
+
+ case InputPinInOpaqueActEditPart.VISUAL_ID:
+ return new InputPinInOpaqueActEditPart(view);
+
+ case InputPinInOActLabelEditPart.VISUAL_ID:
+ return new InputPinInOActLabelEditPart(view);
+
+ case OutputPinInOpaqueActEditPart.VISUAL_ID:
+ return new OutputPinInOpaqueActEditPart(view);
+
+ case OutputPinInOActLabelEditPart.VISUAL_ID:
+ return new OutputPinInOActLabelEditPart(view);
+
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ return new CallBehaviorActionEditPart(view);
+
+ case CallBehaviorActionNameEditPart.VISUAL_ID:
+ return new CallBehaviorActionNameEditPart(view);
+
+ case ValuePinInCallBeActEditPart.VISUAL_ID:
+ return new ValuePinInCallBeActEditPart(view);
+
+ case ValuePinInCBActLabelEditPart.VISUAL_ID:
+ return new ValuePinInCBActLabelEditPart(view);
+
+ case ValuePinInCBActValueEditPart.VISUAL_ID:
+ return new ValuePinInCBActValueEditPart(view);
+
+ case ActionInputPinInCallBeActEditPart.VISUAL_ID:
+ return new ActionInputPinInCallBeActEditPart(view);
+
+ case ActionInputPinInCBActLabelEditPart.VISUAL_ID:
+ return new ActionInputPinInCBActLabelEditPart(view);
+
+ case ActionInputPinInCBActValueEditPart.VISUAL_ID:
+ return new ActionInputPinInCBActValueEditPart(view);
+
+ case InputPinInCallBeActEditPart.VISUAL_ID:
+ return new InputPinInCallBeActEditPart(view);
+
+ case InputPinInCBActLabelEditPart.VISUAL_ID:
+ return new InputPinInCBActLabelEditPart(view);
+
+ case OutputPinInCallBeActEditPart.VISUAL_ID:
+ return new OutputPinInCallBeActEditPart(view);
+
+ case OutputPinInCBActLabelEditPart.VISUAL_ID:
+ return new OutputPinInCBActLabelEditPart(view);
+
+ case CallOperationActionEditPart.VISUAL_ID:
+ return new CallOperationActionEditPart(view);
+
+ case CallOperationActionNameEditPart.VISUAL_ID:
+ return new CallOperationActionNameEditPart(view);
+
+ case ActionInputPinInCallOpActEditPart.VISUAL_ID:
+ return new ActionInputPinInCallOpActEditPart(view);
+
+ case ActionInputPinInCOActLabelEditPart.VISUAL_ID:
+ return new ActionInputPinInCOActLabelEditPart(view);
+
+ case ActionInputPinInCOActValueEditPart.VISUAL_ID:
+ return new ActionInputPinInCOActValueEditPart(view);
+
+ case ValuePinInCallOpActEditPart.VISUAL_ID:
+ return new ValuePinInCallOpActEditPart(view);
+
+ case ValuePinInCOActLabelEditPart.VISUAL_ID:
+ return new ValuePinInCOActLabelEditPart(view);
+
+ case ValuePinInCOActValueEditPart.VISUAL_ID:
+ return new ValuePinInCOActValueEditPart(view);
+
+ case InputPinInCallOpActEditPart.VISUAL_ID:
+ return new InputPinInCallOpActEditPart(view);
+
+ case InputPinInCOActLabelEditPart.VISUAL_ID:
+ return new InputPinInCOActLabelEditPart(view);
+
+ case OutputPinInCallOpActEditPart.VISUAL_ID:
+ return new OutputPinInCallOpActEditPart(view);
+
+ case OutputPinInCOActLabelEditPart.VISUAL_ID:
+ return new OutputPinInCOActLabelEditPart(view);
+
+ case ValuePinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return new ValuePinInCallOpActAsTargetEditPart(view);
+
+ case ValuePinInCOActAsTargetLabelEditPart.VISUAL_ID:
+ return new ValuePinInCOActAsTargetLabelEditPart(view);
+
+ case ValuePinInCOActAsTargetValueEditPart.VISUAL_ID:
+ return new ValuePinInCOActAsTargetValueEditPart(view);
+
+ case ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return new ActionInputPinInCallOpActAsTargetEditPart(view);
+
+ case ActionInputPinInCOActAsTargetLabelEditPart.VISUAL_ID:
+ return new ActionInputPinInCOActAsTargetLabelEditPart(view);
+
+ case ActionInputPinInCOActAsTargetValueEditPart.VISUAL_ID:
+ return new ActionInputPinInCOActAsTargetValueEditPart(view);
+
+ case InputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return new InputPinInCallOpActAsTargetEditPart(view);
+
+ case InputPinInCOActAsTargetLabelEditPart.VISUAL_ID:
+ return new InputPinInCOActAsTargetLabelEditPart(view);
+
+ case ConstraintAsLocalPrecondEditPart.VISUAL_ID:
+ return new ConstraintAsLocalPrecondEditPart(view);
+
+ case ConstraintAsLocalPrecondNameEditPart.VISUAL_ID:
+ return new ConstraintAsLocalPrecondNameEditPart(view);
+
+ case ConstraintAsLocalPostcondEditPart.VISUAL_ID:
+ return new ConstraintAsLocalPostcondEditPart(view);
+
+ case ConstraintAsLocalPostcondNameEditPart.VISUAL_ID:
+ return new ConstraintAsLocalPostcondNameEditPart(view);
+
+ case ActivityAsSelectionEditPart.VISUAL_ID:
+ return new ActivityAsSelectionEditPart(view);
+
+ case ActivityAsSelectionNameEditPart.VISUAL_ID:
+ return new ActivityAsSelectionNameEditPart(view);
+
+ case ActivityAsTransformationEditPart.VISUAL_ID:
+ return new ActivityAsTransformationEditPart(view);
+
+ case ActivityAsTransformationNameEditPart.VISUAL_ID:
+ return new ActivityAsTransformationNameEditPart(view);
+
case ActivityActivityParametersCompartmentEditPart.VISUAL_ID:
return new ActivityActivityParametersCompartmentEditPart(view);
@@ -82,6 +238,42 @@ public class UMLEditPartFactory implements EditPartFactory {
case ActivityActivityContentCompartmentEditPart.VISUAL_ID:
return new ActivityActivityContentCompartmentEditPart(view);
+
+ case ActionLocalPreconditionEditPart.VISUAL_ID:
+ return new ActionLocalPreconditionEditPart(view);
+
+
+ case ActionLocalPostconditionEditPart.VISUAL_ID:
+ return new ActionLocalPostconditionEditPart(view);
+
+
+ case ObjectFlowSelectionEditPart.VISUAL_ID:
+ return new ObjectFlowSelectionEditPart(view);
+
+
+ case ObjectFlowTransformationEditPart.VISUAL_ID:
+ return new ObjectFlowTransformationEditPart(view);
+
+
+ case ObjectFlowEditPart.VISUAL_ID:
+ return new ObjectFlowEditPart(view);
+
+ case ObjectFlowNameEditPart.VISUAL_ID:
+ return new ObjectFlowNameEditPart(view);
+
+ case ObjectFlowWeightEditPart.VISUAL_ID:
+ return new ObjectFlowWeightEditPart(view);
+
+
+ case ControlFlowEditPart.VISUAL_ID:
+ return new ControlFlowEditPart(view);
+
+ case ControlFlowNameEditPart.VISUAL_ID:
+ return new ControlFlowNameEditPart(view);
+
+ case ControlFlowWeightEditPart.VISUAL_ID:
+ return new ControlFlowWeightEditPart(view);
+
}
}
return createUnrecognizedEditPart(context, model);
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCBActLabelEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCBActLabelEditPart.java
new file mode 100644
index 00000000000..0e18e78aae3
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCBActLabelEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ValuePinInCBActLabelEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5013;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCBActLabelEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ValuePinInCBActLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ValuePin_3017, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCBActLabelEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCBActValueEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCBActValueEditPart.java
new file mode 100644
index 00000000000..b5452296658
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCBActValueEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ValuePinInCBActValueEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5026;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCBActValueEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ValuePinInCBActValueEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ValuePin_3017, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCBActValueEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActAsTargetLabelEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActAsTargetLabelEditPart.java
new file mode 100644
index 00000000000..e3826751668
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActAsTargetLabelEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ValuePinInCOActAsTargetLabelEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5021;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActAsTargetLabelEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ValuePinInCOActAsTargetLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ValuePin_3025, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActAsTargetLabelEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActAsTargetValueEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActAsTargetValueEditPart.java
new file mode 100644
index 00000000000..264bef8031a
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActAsTargetValueEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ValuePinInCOActAsTargetValueEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5030;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActAsTargetValueEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ValuePinInCOActAsTargetValueEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ValuePin_3025, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActAsTargetValueEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActLabelEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActLabelEditPart.java
new file mode 100644
index 00000000000..9e416fabe0f
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActLabelEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ValuePinInCOActLabelEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5018;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActLabelEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ValuePinInCOActLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ValuePin_3022, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActLabelEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActValueEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActValueEditPart.java
new file mode 100644
index 00000000000..4108d6895cb
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCOActValueEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ValuePinInCOActValueEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5029;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActValueEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ValuePinInCOActValueEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ValuePin_3022, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActValueEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCallBeActEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCallBeActEditPart.java
new file mode 100644
index 00000000000..f261b63a6d4
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCallBeActEditPart.java
@@ -0,0 +1,792 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ValuePinInCallBeActItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class ValuePinInCallBeActEditPart extends
+
+BorderedBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3017;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public ValuePinInCallBeActEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ValuePinInCallBeActItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case ValuePinInCBActLabelEditPart.VISUAL_ID:
+ case ValuePinInCBActValueEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ PinDescriptor figure = new PinDescriptor();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public PinDescriptor getPrimaryShape() {
+ return (PinDescriptor)primaryShape;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof ValuePinInCBActLabelEditPart || borderItemEditPart instanceof ValuePinInCBActValueEditPart) {
+ BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ locator.setBorderItemOffset(new Dimension(-20, -20));
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 16);
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(ValuePinInCBActLabelEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCallOpActAsTargetEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCallOpActAsTargetEditPart.java
new file mode 100644
index 00000000000..817e7bde683
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCallOpActAsTargetEditPart.java
@@ -0,0 +1,792 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ValuePinInCallOpActAsTargetItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class ValuePinInCallOpActAsTargetEditPart extends
+
+BorderedBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3025;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public ValuePinInCallOpActAsTargetEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ValuePinInCallOpActAsTargetItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case ValuePinInCOActAsTargetLabelEditPart.VISUAL_ID:
+ case ValuePinInCOActAsTargetValueEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ PinDescriptor figure = new PinDescriptor();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public PinDescriptor getPrimaryShape() {
+ return (PinDescriptor)primaryShape;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof ValuePinInCOActAsTargetLabelEditPart || borderItemEditPart instanceof ValuePinInCOActAsTargetValueEditPart) {
+ BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ locator.setBorderItemOffset(new Dimension(-20, -20));
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 16);
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(ValuePinInCOActAsTargetLabelEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCallOpActEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCallOpActEditPart.java
new file mode 100644
index 00000000000..e6503bd09e5
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInCallOpActEditPart.java
@@ -0,0 +1,792 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ValuePinInCallOpActItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class ValuePinInCallOpActEditPart extends
+
+BorderedBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3022;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public ValuePinInCallOpActEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ValuePinInCallOpActItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case ValuePinInCOActLabelEditPart.VISUAL_ID:
+ case ValuePinInCOActValueEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ PinDescriptor figure = new PinDescriptor();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public PinDescriptor getPrimaryShape() {
+ return (PinDescriptor)primaryShape;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof ValuePinInCOActLabelEditPart || borderItemEditPart instanceof ValuePinInCOActValueEditPart) {
+ BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ locator.setBorderItemOffset(new Dimension(-20, -20));
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 16);
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(ValuePinInCOActLabelEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInOActLabelEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInOActLabelEditPart.java
new file mode 100644
index 00000000000..0594430a800
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInOActLabelEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ValuePinInOActLabelEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5011;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOActLabelEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ValuePinInOActLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ValuePin_3015, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOActLabelEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInOActValueEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInOActValueEditPart.java
new file mode 100644
index 00000000000..b2d31ed1110
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInOActValueEditPart.java
@@ -0,0 +1,755 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.activity.providers.UMLParserProvider;
+import org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @generated
+ */
+public class ValuePinInOActValueEditPart
+
+
+extends LabelEditPart
+
+
+implements ITextAwareEditPart, IBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 5024;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ protected IDirectEditorConfiguration configuration;
+
+
+
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOActValueEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ValuePinInOActValueEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ValuePin_3015, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOActValueEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), dialog.getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if(checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if(checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (resolveSemanticElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CommonLabelFigure();
+ }
+
+
+ /**
+ * @generated
+ */
+ public class CommonLabelFigure extends WrappingLabel {
+
+
+
+
+ /**
+ * @generated
+ */
+ public CommonLabelFigure() {
+ this.setText("");
+ }
+
+
+
+
+
+ }
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInOpaqueActEditPart.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInOpaqueActEditPart.java
new file mode 100644
index 00000000000..2f7b6a0f5a5
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/parts/ValuePinInOpaqueActEditPart.java
@@ -0,0 +1,792 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.policies.OpenDiagramEditPolicy;
+import org.eclipse.papyrus.diagram.activity.edit.policies.ValuePinInOpaqueActItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class ValuePinInOpaqueActEditPart extends
+
+BorderedBorderItemEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3015;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public ValuePinInOpaqueActEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ValuePinInOpaqueActItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ case ValuePinInOActLabelEditPart.VISUAL_ID:
+ case ValuePinInOActValueEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape() {
+ PinDescriptor figure = new PinDescriptor();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public PinDescriptor getPrimaryShape() {
+ return (PinDescriptor)primaryShape;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof ValuePinInOActLabelEditPart || borderItemEditPart instanceof ValuePinInOActValueEditPart) {
+ BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ locator.setBorderItemOffset(new Dimension(-20, -20));
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 16);
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineWidth(width);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if(primaryShape instanceof Shape) {
+ ((Shape)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(ValuePinInOActLabelEditPart.VISUAL_ID));
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSource() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ }
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ types.add(UMLElementTypes.ControlFlow_4004);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForTarget(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMARelTypesOnTarget() {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ types.add(UMLElementTypes.ObjectFlow_4003);
+ types.add(UMLElementTypes.ControlFlow_4004);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */getMATypesForSource(IElementType relationshipType) {
+ List/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */types = new ArrayList/* <org.eclipse.gmf.runtime.emf.type.core.IElementType> */();
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ObjectFlow_4003) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InitialNode_3004);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActivityFinalNode_3005);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.FlowFinalNode_3006);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3015);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3013);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3014);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3017);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3019);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3020);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3022);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3023);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.OutputPin_3024);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ValuePin_3025);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ }
+ if(relationshipType == UMLElementTypes.ControlFlow_4004) {
+ types.add(UMLElementTypes.InputPin_3027);
+ }
+ return types;
+ }
+
+
+
+
+
+ /**
+ * @generated
+ */
+ public class PinDescriptor extends RectangleFigure {
+
+
+ /**
+ * @generated
+ */
+ private Polyline fOptionalArrowFigure;
+
+
+ /**
+ * @generated
+ */
+ public PinDescriptor() {
+ this.setLineWidth(1);
+ this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+
+ fOptionalArrowFigure = new Polyline();
+ fOptionalArrowFigure.setLineWidth(1);
+
+ this.add(fOptionalArrowFigure);
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = true;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+
+
+ /**
+ * @generated
+ */
+ public Polyline getOptionalArrowFigure() {
+ return fOptionalArrowFigure;
+ }
+
+
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("ValuePin", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInCallBeActItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInCallBeActItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..e8963be706c
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInCallBeActItemSemanticEditPolicy.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInCallBeActItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCallBeActItemSemanticEditPolicy() {
+ super(UMLElementTypes.ActionInputPin_3018);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInCallOpActAsTargetItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInCallOpActAsTargetItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..eb31d3e454e
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInCallOpActAsTargetItemSemanticEditPolicy.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInCallOpActAsTargetItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCallOpActAsTargetItemSemanticEditPolicy() {
+ super(UMLElementTypes.ActionInputPin_3026);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInCallOpActItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInCallOpActItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..2652084dee3
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInCallOpActItemSemanticEditPolicy.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInCallOpActItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInCallOpActItemSemanticEditPolicy() {
+ super(UMLElementTypes.ActionInputPin_3021);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInOpaqueActItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInOpaqueActItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..a0d00e6c198
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionInputPinInOpaqueActItemSemanticEditPolicy.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ActionInputPinInOpaqueActItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ActionInputPinInOpaqueActItemSemanticEditPolicy() {
+ super(UMLElementTypes.ActionInputPin_3016);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionLocalPostconditionItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionLocalPostconditionItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..bed0d901686
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionLocalPostconditionItemSemanticEditPolicy.java
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ActionLocalPostconditionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ActionLocalPostconditionItemSemanticEditPolicy() {
+ super(UMLElementTypes.ActionLocalPostcondition_4002);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
+ return getGEFWrapper(new DestroyReferenceCommand(req) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionLocalPreconditionItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionLocalPreconditionItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..7bd328f495d
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActionLocalPreconditionItemSemanticEditPolicy.java
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ActionLocalPreconditionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ActionLocalPreconditionItemSemanticEditPolicy() {
+ super(UMLElementTypes.ActionLocalPrecondition_4001);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
+ return getGEFWrapper(new DestroyReferenceCommand(req) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityContentCompartmentCanonicalEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityContentCompartmentCanonicalEditPolicy.java
index bd161871a3e..439a49ac4eb 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityContentCompartmentCanonicalEditPolicy.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityContentCompartmentCanonicalEditPolicy.java
@@ -14,17 +14,40 @@
package org.eclipse.papyrus.diagram.activity.edit.policies;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
+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.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.Transaction;
+import org.eclipse.emf.workspace.AbstractEMFOperation;
+import org.eclipse.gmf.runtime.common.core.util.StringStatics;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.Location;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.Ratio;
+import org.eclipse.gmf.runtime.notation.Size;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsTransformationEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityFinalNodeEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.FlowFinalNodeEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.InitialNodeEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
import org.eclipse.papyrus.diagram.activity.part.UMLDiagramUpdater;
import org.eclipse.papyrus.diagram.activity.part.UMLNodeDescriptor;
import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
@@ -61,9 +84,36 @@ public class ActivityActivityContentCompartmentCanonicalEditPolicy extends Canon
case InitialNodeEditPart.VISUAL_ID:
case ActivityFinalNodeEditPart.VISUAL_ID:
case FlowFinalNodeEditPart.VISUAL_ID:
+ case OpaqueActionEditPart.VISUAL_ID:
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ case CallOperationActionEditPart.VISUAL_ID:
+ case ConstraintAsLocalPrecondEditPart.VISUAL_ID:
+ case ConstraintAsLocalPostcondEditPart.VISUAL_ID:
+ case ActivityAsSelectionEditPart.VISUAL_ID:
+ case ActivityAsTransformationEditPart.VISUAL_ID:
if(!semanticChildren.contains(view.getElement())) {
return true;
}
+ EObject domainModelElement = view.getElement();
+ if(visualID != UMLVisualIDRegistry.getNodeVisualID((View)getHost().getModel(), domainModelElement)) {
+ List createdViews = createViews(Collections.singletonList(domainModelElement));
+ assert createdViews.size() == 1;
+ final View createdView = (View)((IAdaptable)createdViews.get(0)).getAdapter(View.class);
+ if(createdView != null) {
+ try {
+ new AbstractEMFOperation(host().getEditingDomain(), StringStatics.BLANK, Collections.singletonMap(Transaction.OPTION_UNPROTECTED, Boolean.TRUE)) {
+
+ protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ populateViewProperties(view, createdView);
+ return Status.OK_STATUS;
+ }
+ }.execute(new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Error while copyign view information to newly created view", e); //$NON-NLS-1$
+ }
+ }
+ deleteViews(Collections.singletonList(view).iterator());
+ }
}
return false;
}
@@ -71,6 +121,28 @@ public class ActivityActivityContentCompartmentCanonicalEditPolicy extends Canon
/**
* @generated
*/
+ private void populateViewProperties(View oldView, View newView) {
+ if(oldView instanceof Node && newView instanceof Node) {
+ Node oldNode = (Node)oldView;
+ Node newNode = (Node)newView;
+ if(oldNode.getLayoutConstraint() instanceof Location && newNode.getLayoutConstraint() instanceof Location) {
+ ((Location)newNode.getLayoutConstraint()).setX(((Location)oldNode.getLayoutConstraint()).getX());
+ ((Location)newNode.getLayoutConstraint()).setY(((Location)oldNode.getLayoutConstraint()).getY());
+ }
+ if(oldNode.getLayoutConstraint() instanceof Size && newNode.getLayoutConstraint() instanceof Size) {
+ ((Size)newNode.getLayoutConstraint()).setWidth(((Size)oldNode.getLayoutConstraint()).getWidth());
+ ((Size)newNode.getLayoutConstraint()).setHeight(((Size)oldNode.getLayoutConstraint()).getHeight());
+ }
+ if(oldNode.getLayoutConstraint() instanceof Ratio && newNode.getLayoutConstraint() instanceof Ratio) {
+ ((Ratio)newNode.getLayoutConstraint()).setValue(((Ratio)oldNode.getLayoutConstraint()).getValue());
+ }
+ newNode.persist();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected String getDefaultFactoryHint() {
return null;
}
@@ -82,6 +154,9 @@ public class ActivityActivityContentCompartmentCanonicalEditPolicy extends Canon
if(myFeaturesToSynchronize == null) {
myFeaturesToSynchronize = new HashSet();
myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getActivity_Node());
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getAction_LocalPrecondition());
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getAction_LocalPostcondition());
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getPackage_PackagedElement());
}
return myFeaturesToSynchronize;
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityContentCompartmentItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityContentCompartmentItemSemanticEditPolicy.java
index f202f3560d4..b75428effd8 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityContentCompartmentItemSemanticEditPolicy.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityContentCompartmentItemSemanticEditPolicy.java
@@ -16,8 +16,11 @@ package org.eclipse.papyrus.diagram.activity.edit.policies;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.papyrus.diagram.activity.edit.commands.ActivityFinalNodeCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.CallBehaviorActionCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.CallOperationActionCreateCommand;
import org.eclipse.papyrus.diagram.activity.edit.commands.FlowFinalNodeCreateCommand;
import org.eclipse.papyrus.diagram.activity.edit.commands.InitialNodeCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.OpaqueActionCreateCommand;
import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
/**
@@ -33,7 +36,8 @@ public class ActivityActivityContentCompartmentItemSemanticEditPolicy extends UM
}
/**
- * @generated
+ * @generated NOT moved local conditions creation commands to {@link CreateActionLocalConditionEditPolicy} moved transformation and selection
+ * creation commands to {@link CreateObjectFlowBehaviorEditPolicy}
*/
protected Command getCreateCommand(CreateElementRequest req) {
if(UMLElementTypes.InitialNode_3004 == req.getElementType()) {
@@ -45,6 +49,27 @@ public class ActivityActivityContentCompartmentItemSemanticEditPolicy extends UM
if(UMLElementTypes.FlowFinalNode_3006 == req.getElementType()) {
return getGEFWrapper(new FlowFinalNodeCreateCommand(req));
}
+ if(UMLElementTypes.OpaqueAction_3007 == req.getElementType()) {
+ return getGEFWrapper(new OpaqueActionCreateCommand(req));
+ }
+ if(UMLElementTypes.CallBehaviorAction_3008 == req.getElementType()) {
+ return getGEFWrapper(new CallBehaviorActionCreateCommand(req));
+ }
+ if(UMLElementTypes.CallOperationAction_3010 == req.getElementType()) {
+ return getGEFWrapper(new CallOperationActionCreateCommand(req));
+ }
+ // if(UMLElementTypes.Constraint_3011 == req.getElementType()) {
+ // return getGEFWrapper(new ConstraintAsLocalPrecondCreateCommand(req));
+ // }
+ // if(UMLElementTypes.Constraint_3012 == req.getElementType()) {
+ // return getGEFWrapper(new ConstraintAsLocalPostcondCreateCommand(req));
+ // }
+ // if(UMLElementTypes.Activity_3028 == req.getElementType()) {
+ // return getGEFWrapper(new ActivityAsSelectionCreateCommand(req));
+ // }
+ // if(UMLElementTypes.Activity_3029 == req.getElementType()) {
+ // return getGEFWrapper(new ActivityAsTransformationCreateCommand(req));
+ // }
return super.getCreateCommand(req);
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPostConditionsCompartmentCanonicalEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPostConditionsCompartmentCanonicalEditPolicy.java
index 2fe396d667b..d4e5f837f61 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPostConditionsCompartmentCanonicalEditPolicy.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPostConditionsCompartmentCanonicalEditPolicy.java
@@ -22,7 +22,7 @@ import java.util.Set;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.activity.edit.parts.Constraint2EditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPostcondEditPart;
import org.eclipse.papyrus.diagram.activity.part.UMLDiagramUpdater;
import org.eclipse.papyrus.diagram.activity.part.UMLNodeDescriptor;
import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
@@ -56,7 +56,7 @@ public class ActivityActivityPostConditionsCompartmentCanonicalEditPolicy extend
protected boolean isOrphaned(Collection semanticChildren, final View view) {
int visualID = UMLVisualIDRegistry.getVisualID(view);
switch(visualID) {
- case Constraint2EditPart.VISUAL_ID:
+ case ConstraintInActivityAsPostcondEditPart.VISUAL_ID:
if(!semanticChildren.contains(view.getElement())) {
return true;
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPostConditionsCompartmentItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPostConditionsCompartmentItemSemanticEditPolicy.java
index e70c2f8d17a..2afe9698ccc 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPostConditionsCompartmentItemSemanticEditPolicy.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPostConditionsCompartmentItemSemanticEditPolicy.java
@@ -15,7 +15,7 @@ package org.eclipse.papyrus.diagram.activity.edit.policies;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.diagram.activity.edit.commands.Constraint2CreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ConstraintInActivityAsPostcondCreateCommand;
import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
/**
@@ -35,7 +35,7 @@ public class ActivityActivityPostConditionsCompartmentItemSemanticEditPolicy ext
*/
protected Command getCreateCommand(CreateElementRequest req) {
if(UMLElementTypes.Constraint_3003 == req.getElementType()) {
- return getGEFWrapper(new Constraint2CreateCommand(req));
+ return getGEFWrapper(new ConstraintInActivityAsPostcondCreateCommand(req));
}
return super.getCreateCommand(req);
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPreConditionsCompartmentCanonicalEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPreConditionsCompartmentCanonicalEditPolicy.java
index 2a28818d212..53244d0de49 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPreConditionsCompartmentCanonicalEditPolicy.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPreConditionsCompartmentCanonicalEditPolicy.java
@@ -22,7 +22,7 @@ import java.util.Set;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPrecondEditPart;
import org.eclipse.papyrus.diagram.activity.part.UMLDiagramUpdater;
import org.eclipse.papyrus.diagram.activity.part.UMLNodeDescriptor;
import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
@@ -56,7 +56,7 @@ public class ActivityActivityPreConditionsCompartmentCanonicalEditPolicy extends
protected boolean isOrphaned(Collection semanticChildren, final View view) {
int visualID = UMLVisualIDRegistry.getVisualID(view);
switch(visualID) {
- case ConstraintEditPart.VISUAL_ID:
+ case ConstraintInActivityAsPrecondEditPart.VISUAL_ID:
if(!semanticChildren.contains(view.getElement())) {
return true;
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPreConditionsCompartmentItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPreConditionsCompartmentItemSemanticEditPolicy.java
index 837681818c5..3e0a7076dab 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPreConditionsCompartmentItemSemanticEditPolicy.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityActivityPreConditionsCompartmentItemSemanticEditPolicy.java
@@ -15,7 +15,7 @@ package org.eclipse.papyrus.diagram.activity.edit.policies;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.diagram.activity.edit.commands.ConstraintCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ConstraintInActivityAsPrecondCreateCommand;
import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
/**
@@ -35,7 +35,7 @@ public class ActivityActivityPreConditionsCompartmentItemSemanticEditPolicy exte
*/
protected Command getCreateCommand(CreateElementRequest req) {
if(UMLElementTypes.Constraint_3002 == req.getElementType()) {
- return getGEFWrapper(new ConstraintCreateCommand(req));
+ return getGEFWrapper(new ConstraintInActivityAsPrecondCreateCommand(req));
}
return super.getCreateCommand(req);
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityAsSelectionItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityAsSelectionItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..0598f847f0b
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityAsSelectionItemSemanticEditPolicy.java
@@ -0,0 +1,136 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowSelectionCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowSelectionReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowTransformationCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowTransformationReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowTransformationEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ActivityAsSelectionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ActivityAsSelectionItemSemanticEditPolicy() {
+ super(UMLElementTypes.Activity_3028);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowSelectionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowTransformationEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlowSelection_4005 == req.getElementType()) {
+ return null;
+ }
+ if(UMLElementTypes.ObjectFlowTransformation_4006 == req.getElementType()) {
+ return null;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlowSelection_4005 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowSelectionCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ObjectFlowTransformation_4006 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowTransformationCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * Returns command to reorient EReference based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowSelectionEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowSelectionReorientCommand(req));
+ case ObjectFlowTransformationEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowTransformationReorientCommand(req));
+ }
+ return super.getReorientReferenceRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityAsTransformationItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityAsTransformationItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..937335f9d64
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityAsTransformationItemSemanticEditPolicy.java
@@ -0,0 +1,136 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowSelectionCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowSelectionReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowTransformationCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowTransformationReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowTransformationEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ActivityAsTransformationItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ActivityAsTransformationItemSemanticEditPolicy() {
+ super(UMLElementTypes.Activity_3029);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowSelectionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowTransformationEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlowSelection_4005 == req.getElementType()) {
+ return null;
+ }
+ if(UMLElementTypes.ObjectFlowTransformation_4006 == req.getElementType()) {
+ return null;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlowSelection_4005 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowSelectionCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ObjectFlowTransformation_4006 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowTransformationCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * Returns command to reorient EReference based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowSelectionEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowSelectionReorientCommand(req));
+ case ObjectFlowTransformationEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowTransformationReorientCommand(req));
+ }
+ return super.getReorientReferenceRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityCanonicalEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityCanonicalEditPolicy.java
index 417b4e97a6b..7e123e52add 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityCanonicalEditPolicy.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityCanonicalEditPolicy.java
@@ -15,21 +15,59 @@ package org.eclipse.papyrus.diagram.activity.edit.policies;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import java.util.Set;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalConnectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsTransformationEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityDiagramEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityFinalNodeEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.FlowFinalNodeEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InitialNodeEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOpaqueActEditPart;
import org.eclipse.papyrus.diagram.activity.part.UMLDiagramUpdater;
+import org.eclipse.papyrus.diagram.activity.part.UMLLinkDescriptor;
import org.eclipse.papyrus.diagram.activity.part.UMLNodeDescriptor;
import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
import org.eclipse.uml2.uml.UMLPackage;
@@ -131,6 +169,7 @@ public class ActivityCanonicalEditPolicy extends CanonicalConnectionEditPolicy {
createdViews.addAll(refreshSemanticChildren());
List createdConnectionViews = new LinkedList();
createdConnectionViews.addAll(refreshSemanticConnections());
+ createdConnectionViews.addAll(refreshConnections());
if(createdViews.size() > 1) {
// perform a layout of the container
@@ -149,4 +188,387 @@ public class ActivityCanonicalEditPolicy extends CanonicalConnectionEditPolicy {
return ((View)getHost().getModel()).getDiagram();
}
+ /**
+ * @generated
+ */
+ private Collection refreshConnections() {
+ Map domain2NotationMap = new HashMap();
+ Collection linkDescriptors = collectAllLinks(getDiagram(), domain2NotationMap);
+ Collection existingLinks = new LinkedList(getDiagram().getEdges());
+ for(Iterator linksIterator = existingLinks.iterator(); linksIterator.hasNext();) {
+ Edge nextDiagramLink = (Edge)linksIterator.next();
+ int diagramLinkVisualID = UMLVisualIDRegistry.getVisualID(nextDiagramLink);
+ if(diagramLinkVisualID == -1) {
+ if(nextDiagramLink.getSource() != null && nextDiagramLink.getTarget() != null) {
+ linksIterator.remove();
+ }
+ continue;
+ }
+ EObject diagramLinkObject = nextDiagramLink.getElement();
+ EObject diagramLinkSrc = nextDiagramLink.getSource().getElement();
+ EObject diagramLinkDst = nextDiagramLink.getTarget().getElement();
+ for(Iterator linkDescriptorsIterator = linkDescriptors.iterator(); linkDescriptorsIterator.hasNext();) {
+ UMLLinkDescriptor nextLinkDescriptor = (UMLLinkDescriptor)linkDescriptorsIterator.next();
+ if(diagramLinkObject == nextLinkDescriptor.getModelElement() && diagramLinkSrc == nextLinkDescriptor.getSource() && diagramLinkDst == nextLinkDescriptor.getDestination() && diagramLinkVisualID == nextLinkDescriptor.getVisualID()) {
+ linksIterator.remove();
+ linkDescriptorsIterator.remove();
+ break;
+ }
+ }
+ }
+ deleteViews(existingLinks.iterator());
+ return createConnections(linkDescriptors, domain2NotationMap);
+ }
+
+ /**
+ * @generated
+ */
+ private Collection collectAllLinks(View view, Map domain2NotationMap) {
+ if(!ActivityDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view))) {
+ return Collections.EMPTY_LIST;
+ }
+ Collection result = new LinkedList();
+ switch(UMLVisualIDRegistry.getVisualID(view)) {
+ case ActivityDiagramEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getPackage_1000ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ActivityEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getActivity_2001ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case InitialNodeEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getInitialNode_3004ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ActivityFinalNodeEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getActivityFinalNode_3005ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case FlowFinalNodeEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getFlowFinalNode_3006ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case OpaqueActionEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getOpaqueAction_3007ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ValuePinInOpaqueActEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getValuePin_3015ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ActionInputPinInOpaqueActEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getActionInputPin_3016ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case InputPinInOpaqueActEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getInputPin_3013ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case OutputPinInOpaqueActEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getOutputPin_3014ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getCallBehaviorAction_3008ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ValuePinInCallBeActEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getValuePin_3017ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ActionInputPinInCallBeActEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getActionInputPin_3018ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case InputPinInCallBeActEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getInputPin_3019ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case OutputPinInCallBeActEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getOutputPin_3020ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case CallOperationActionEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getCallOperationAction_3010ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ActionInputPinInCallOpActEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getActionInputPin_3021ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ValuePinInCallOpActEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getValuePin_3022ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case InputPinInCallOpActEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getInputPin_3023ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case OutputPinInCallOpActEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getOutputPin_3024ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ValuePinInCallOpActAsTargetEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getValuePin_3025ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getActionInputPin_3026ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case InputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getInputPin_3027ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ConstraintAsLocalPrecondEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getConstraint_3011ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ConstraintAsLocalPostcondEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getConstraint_3012ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ActivityAsSelectionEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getActivity_3028ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ActivityAsTransformationEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getActivity_3029ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ObjectFlowEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getObjectFlow_4003ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ case ControlFlowEditPart.VISUAL_ID:
+ {
+ if(!domain2NotationMap.containsKey(view.getElement())) {
+ result.addAll(UMLDiagramUpdater.getControlFlow_4004ContainedLinks(view));
+ }
+ if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
+ domain2NotationMap.put(view.getElement(), view);
+ }
+ break;
+ }
+ }
+ for(Iterator children = view.getChildren().iterator(); children.hasNext();) {
+ result.addAll(collectAllLinks((View)children.next(), domain2NotationMap));
+ }
+ for(Iterator edges = view.getSourceEdges().iterator(); edges.hasNext();) {
+ result.addAll(collectAllLinks((View)edges.next(), domain2NotationMap));
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private Collection createConnections(Collection linkDescriptors, Map domain2NotationMap) {
+ List adapters = new LinkedList();
+ for(Iterator linkDescriptorsIterator = linkDescriptors.iterator(); linkDescriptorsIterator.hasNext();) {
+ final UMLLinkDescriptor nextLinkDescriptor = (UMLLinkDescriptor)linkDescriptorsIterator.next();
+ EditPart sourceEditPart = getEditPart(nextLinkDescriptor.getSource(), domain2NotationMap);
+ EditPart targetEditPart = getEditPart(nextLinkDescriptor.getDestination(), domain2NotationMap);
+ if(sourceEditPart == null || targetEditPart == null) {
+ continue;
+ }
+ CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(nextLinkDescriptor.getSemanticAdapter(), String.valueOf(nextLinkDescriptor.getVisualID()), ViewUtil.APPEND, false, ((IGraphicalEditPart)getHost()).getDiagramPreferencesHint());
+ CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(descriptor);
+ ccr.setType(RequestConstants.REQ_CONNECTION_START);
+ ccr.setSourceEditPart(sourceEditPart);
+ sourceEditPart.getCommand(ccr);
+ ccr.setTargetEditPart(targetEditPart);
+ ccr.setType(RequestConstants.REQ_CONNECTION_END);
+ Command cmd = targetEditPart.getCommand(ccr);
+ if(cmd != null && cmd.canExecute()) {
+ executeCommand(cmd);
+ IAdaptable viewAdapter = (IAdaptable)ccr.getNewObject();
+ if(viewAdapter != null) {
+ adapters.add(viewAdapter);
+ }
+ }
+ }
+ return adapters;
+ }
+
+ /**
+ * @generated
+ */
+ private EditPart getEditPart(EObject domainModelElement, Map domain2NotationMap) {
+ View view = (View)domain2NotationMap.get(domainModelElement);
+ if(view != null) {
+ return (EditPart)getHost().getViewer().getEditPartRegistry().get(view);
+ }
+ return null;
+ }
+
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityFinalNodeItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityFinalNodeItemSemanticEditPolicy.java
index 944f4c61eee..e8a7e6aff32 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityFinalNodeItemSemanticEditPolicy.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityFinalNodeItemSemanticEditPolicy.java
@@ -13,13 +13,25 @@
*****************************************************************************/
package org.eclipse.papyrus.diagram.activity.edit.policies;
+import java.util.Iterator;
+
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
/**
@@ -41,6 +53,36 @@ public class ActivityFinalNodeItemSemanticEditPolicy extends UMLBaseItemSemantic
View view = (View)getHost().getModel();
CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
if(annotation == null) {
// there are indirectly referenced children, need extra commands: false
@@ -53,4 +95,54 @@ public class ActivityFinalNodeItemSemanticEditPolicy extends UMLBaseItemSemantic
return getGEFWrapper(cmd.reduce());
}
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityItemSemanticEditPolicy.java
index 905d8c48906..ad84d507b2d 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityItemSemanticEditPolicy.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ActivityItemSemanticEditPolicy.java
@@ -15,24 +15,52 @@ package org.eclipse.papyrus.diagram.activity.edit.policies;
import java.util.Iterator;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowSelectionCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowSelectionReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowTransformationCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowTransformationReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPostconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPreconditionEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityContentCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityParametersCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityPostConditionsCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityPreConditionsCompartmentEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsTransformationEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityFinalNodeEditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.Constraint2EditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.FlowFinalNodeEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.InitialNodeEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowTransformationEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ParameterEditPart;
import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
@@ -56,9 +84,24 @@ public class ActivityItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
View view = (View)getHost().getModel();
CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowSelectionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowTransformationEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
if(annotation == null) {
- // there are indirectly referenced children, need extra commands: false
+ // there are indirectly referenced children, need extra commands: true
addDestroyChildNodesCommand(cmd);
addDestroyShortcutsCommand(cmd, view);
// delete host element
@@ -93,7 +136,7 @@ public class ActivityItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
for(Iterator cit = node.getChildren().iterator(); cit.hasNext();) {
Node cnode = (Node)cit.next();
switch(UMLVisualIDRegistry.getVisualID(cnode)) {
- case ConstraintEditPart.VISUAL_ID:
+ case ConstraintInActivityAsPrecondEditPart.VISUAL_ID:
cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
// don't need explicit deletion of cnode as parent's view deletion would clean child views as well
// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
@@ -105,7 +148,7 @@ public class ActivityItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
for(Iterator cit = node.getChildren().iterator(); cit.hasNext();) {
Node cnode = (Node)cit.next();
switch(UMLVisualIDRegistry.getVisualID(cnode)) {
- case Constraint2EditPart.VISUAL_ID:
+ case ConstraintInActivityAsPostcondEditPart.VISUAL_ID:
cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
// don't need explicit deletion of cnode as parent's view deletion would clean child views as well
// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
@@ -118,20 +161,441 @@ public class ActivityItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
Node cnode = (Node)cit.next();
switch(UMLVisualIDRegistry.getVisualID(cnode)) {
case InitialNodeEditPart.VISUAL_ID:
+ for(Iterator it = cnode.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = cnode.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
// don't need explicit deletion of cnode as parent's view deletion would clean child views as well
// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
break;
case ActivityFinalNodeEditPart.VISUAL_ID:
+ for(Iterator it = cnode.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = cnode.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
// don't need explicit deletion of cnode as parent's view deletion would clean child views as well
// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
break;
case FlowFinalNodeEditPart.VISUAL_ID:
+ for(Iterator it = cnode.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = cnode.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
+ break;
+ case OpaqueActionEditPart.VISUAL_ID:
+ for(Iterator it = cnode.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = cnode.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ActionLocalPreconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ActionLocalPostconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
+ break;
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ for(Iterator it = cnode.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = cnode.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ActionLocalPreconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ActionLocalPostconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
// don't need explicit deletion of cnode as parent's view deletion would clean child views as well
// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
break;
+ case CallOperationActionEditPart.VISUAL_ID:
+ for(Iterator it = cnode.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = cnode.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ActionLocalPreconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ActionLocalPostconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
+ break;
+ case ConstraintAsLocalPrecondEditPart.VISUAL_ID:
+ for(Iterator it = cnode.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ActionLocalPreconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ActionLocalPostconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: false
+ // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
+ break;
+ case ConstraintAsLocalPostcondEditPart.VISUAL_ID:
+ for(Iterator it = cnode.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ActionLocalPreconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ActionLocalPostconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: false
+ // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
+ break;
+ case ActivityAsSelectionEditPart.VISUAL_ID:
+ for(Iterator it = cnode.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowSelectionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowTransformationEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: false
+ // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
+ break;
+ case ActivityAsTransformationEditPart.VISUAL_ID:
+ for(Iterator it = cnode.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowSelectionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowTransformationEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: false
+ // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
+ break;
}
}
break;
@@ -139,4 +603,54 @@ public class ActivityItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
}
}
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlowSelection_4005 == req.getElementType()) {
+ return null;
+ }
+ if(UMLElementTypes.ObjectFlowTransformation_4006 == req.getElementType()) {
+ return null;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlowSelection_4005 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowSelectionCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ObjectFlowTransformation_4006 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowTransformationCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * Returns command to reorient EReference based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowSelectionEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowSelectionReorientCommand(req));
+ case ObjectFlowTransformationEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowTransformationReorientCommand(req));
+ }
+ return super.getReorientReferenceRelationshipCommand(req);
+ }
+
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallBehaviorActionCanonicalEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallBehaviorActionCanonicalEditPolicy.java
new file mode 100644
index 00000000000..53a8fca8435
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallBehaviorActionCanonicalEditPolicy.java
@@ -0,0 +1,93 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramUpdater;
+import org.eclipse.papyrus.diagram.activity.part.UMLNodeDescriptor;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * @generated
+ */
+public class CallBehaviorActionCanonicalEditPolicy extends CanonicalEditPolicy {
+
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View)getHost().getModel();
+ List result = new LinkedList();
+ for(Iterator it = UMLDiagramUpdater.getCallBehaviorAction_3008SemanticChildren(viewObject).iterator(); it.hasNext();) {
+ result.add(((UMLNodeDescriptor)it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = UMLVisualIDRegistry.getVisualID(view);
+ switch(visualID) {
+ case ValuePinInCallBeActEditPart.VISUAL_ID:
+ case ActionInputPinInCallBeActEditPart.VISUAL_ID:
+ case InputPinInCallBeActEditPart.VISUAL_ID:
+ case OutputPinInCallBeActEditPart.VISUAL_ID:
+ if(!semanticChildren.contains(view.getElement())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultFactoryHint() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Set getFeaturesToSynchronize() {
+ if(myFeaturesToSynchronize == null) {
+ myFeaturesToSynchronize = new HashSet();
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getInvocationAction_Argument());
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getCallAction_Result());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallBehaviorActionItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallBehaviorActionItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..d2cf8702597
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallBehaviorActionItemSemanticEditPolicy.java
@@ -0,0 +1,416 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionInputPinInCallBeActCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPostconditionCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPostconditionReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPreconditionCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPreconditionReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.InputPinInCallBeActCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.OutputPinInCallBeActCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ValuePinInCallBeActCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPostconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPreconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class CallBehaviorActionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public CallBehaviorActionItemSemanticEditPolicy() {
+ super(UMLElementTypes.CallBehaviorAction_3008);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateCommand(CreateElementRequest req) {
+ if(UMLElementTypes.ValuePin_3017 == req.getElementType()) {
+ return getGEFWrapper(new ValuePinInCallBeActCreateCommand(req));
+ }
+ if(UMLElementTypes.ActionInputPin_3018 == req.getElementType()) {
+ return getGEFWrapper(new ActionInputPinInCallBeActCreateCommand(req));
+ }
+ if(UMLElementTypes.InputPin_3019 == req.getElementType()) {
+ return getGEFWrapper(new InputPinInCallBeActCreateCommand(req));
+ }
+ if(UMLElementTypes.OutputPin_3020 == req.getElementType()) {
+ return getGEFWrapper(new OutputPinInCallBeActCreateCommand(req));
+ }
+ return super.getCreateCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ActionLocalPreconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ActionLocalPostconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyChildNodesCommand(cmd);
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ private void addDestroyChildNodesCommand(ICompositeCommand cmd) {
+ View view = (View)getHost().getModel();
+ for(Iterator nit = view.getChildren().iterator(); nit.hasNext();) {
+ Node node = (Node)nit.next();
+ switch(UMLVisualIDRegistry.getVisualID(node)) {
+ case ValuePinInCallBeActEditPart.VISUAL_ID:
+ for(Iterator it = node.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = node.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of node as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
+ break;
+ case ActionInputPinInCallBeActEditPart.VISUAL_ID:
+ for(Iterator it = node.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = node.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of node as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
+ break;
+ case InputPinInCallBeActEditPart.VISUAL_ID:
+ for(Iterator it = node.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = node.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of node as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
+ break;
+ case OutputPinInCallBeActEditPart.VISUAL_ID:
+ for(Iterator it = node.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = node.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of node as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
+ break;
+ }
+ }
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ActionLocalPrecondition_4001 == req.getElementType()) {
+ return getGEFWrapper(new ActionLocalPreconditionCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ActionLocalPostcondition_4002 == req.getElementType()) {
+ return getGEFWrapper(new ActionLocalPostconditionCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ActionLocalPrecondition_4001 == req.getElementType()) {
+ return null;
+ }
+ if(UMLElementTypes.ActionLocalPostcondition_4002 == req.getElementType()) {
+ return null;
+ }
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+
+ /**
+ * Returns command to reorient EReference based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ActionLocalPreconditionEditPart.VISUAL_ID:
+ return getGEFWrapper(new ActionLocalPreconditionReorientCommand(req));
+ case ActionLocalPostconditionEditPart.VISUAL_ID:
+ return getGEFWrapper(new ActionLocalPostconditionReorientCommand(req));
+ }
+ return super.getReorientReferenceRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallOperationActionCanonicalEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallOperationActionCanonicalEditPolicy.java
new file mode 100644
index 00000000000..1dca7f80ada
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallOperationActionCanonicalEditPolicy.java
@@ -0,0 +1,158 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+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.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.Transaction;
+import org.eclipse.emf.workspace.AbstractEMFOperation;
+import org.eclipse.gmf.runtime.common.core.util.StringStatics;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.Location;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.Ratio;
+import org.eclipse.gmf.runtime.notation.Size;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramUpdater;
+import org.eclipse.papyrus.diagram.activity.part.UMLNodeDescriptor;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * @generated
+ */
+public class CallOperationActionCanonicalEditPolicy extends CanonicalEditPolicy {
+
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View)getHost().getModel();
+ List result = new LinkedList();
+ for(Iterator it = UMLDiagramUpdater.getCallOperationAction_3010SemanticChildren(viewObject).iterator(); it.hasNext();) {
+ result.add(((UMLNodeDescriptor)it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = UMLVisualIDRegistry.getVisualID(view);
+ switch(visualID) {
+ case ActionInputPinInCallOpActEditPart.VISUAL_ID:
+ case ValuePinInCallOpActEditPart.VISUAL_ID:
+ case InputPinInCallOpActEditPart.VISUAL_ID:
+ case OutputPinInCallOpActEditPart.VISUAL_ID:
+ case ValuePinInCallOpActAsTargetEditPart.VISUAL_ID:
+ case ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ case InputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ if(!semanticChildren.contains(view.getElement())) {
+ return true;
+ }
+ EObject domainModelElement = view.getElement();
+ if(visualID != UMLVisualIDRegistry.getNodeVisualID((View)getHost().getModel(), domainModelElement)) {
+ List createdViews = createViews(Collections.singletonList(domainModelElement));
+ assert createdViews.size() == 1;
+ final View createdView = (View)((IAdaptable)createdViews.get(0)).getAdapter(View.class);
+ if(createdView != null) {
+ try {
+ new AbstractEMFOperation(host().getEditingDomain(), StringStatics.BLANK, Collections.singletonMap(Transaction.OPTION_UNPROTECTED, Boolean.TRUE)) {
+
+ protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ populateViewProperties(view, createdView);
+ return Status.OK_STATUS;
+ }
+ }.execute(new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Error while copyign view information to newly created view", e); //$NON-NLS-1$
+ }
+ }
+ deleteViews(Collections.singletonList(view).iterator());
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ private void populateViewProperties(View oldView, View newView) {
+ if(oldView instanceof Node && newView instanceof Node) {
+ Node oldNode = (Node)oldView;
+ Node newNode = (Node)newView;
+ if(oldNode.getLayoutConstraint() instanceof Location && newNode.getLayoutConstraint() instanceof Location) {
+ ((Location)newNode.getLayoutConstraint()).setX(((Location)oldNode.getLayoutConstraint()).getX());
+ ((Location)newNode.getLayoutConstraint()).setY(((Location)oldNode.getLayoutConstraint()).getY());
+ }
+ if(oldNode.getLayoutConstraint() instanceof Size && newNode.getLayoutConstraint() instanceof Size) {
+ ((Size)newNode.getLayoutConstraint()).setWidth(((Size)oldNode.getLayoutConstraint()).getWidth());
+ ((Size)newNode.getLayoutConstraint()).setHeight(((Size)oldNode.getLayoutConstraint()).getHeight());
+ }
+ if(oldNode.getLayoutConstraint() instanceof Ratio && newNode.getLayoutConstraint() instanceof Ratio) {
+ ((Ratio)newNode.getLayoutConstraint()).setValue(((Ratio)oldNode.getLayoutConstraint()).getValue());
+ }
+ newNode.persist();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultFactoryHint() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Set getFeaturesToSynchronize() {
+ if(myFeaturesToSynchronize == null) {
+ myFeaturesToSynchronize = new HashSet();
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getInvocationAction_Argument());
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getCallAction_Result());
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getCallOperationAction_Target());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallOperationActionItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallOperationActionItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..430df159a08
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/CallOperationActionItemSemanticEditPolicy.java
@@ -0,0 +1,536 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionInputPinInCallOpActAsTargetCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionInputPinInCallOpActCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPostconditionCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPostconditionReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPreconditionCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPreconditionReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.InputPinInCallOpActAsTargetCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.InputPinInCallOpActCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.OutputPinInCallOpActCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ValuePinInCallOpActAsTargetCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ValuePinInCallOpActCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPostconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPreconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class CallOperationActionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public CallOperationActionItemSemanticEditPolicy() {
+ super(UMLElementTypes.CallOperationAction_3010);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateCommand(CreateElementRequest req) {
+ if(UMLElementTypes.ActionInputPin_3021 == req.getElementType()) {
+ return getGEFWrapper(new ActionInputPinInCallOpActCreateCommand(req));
+ }
+ if(UMLElementTypes.ValuePin_3022 == req.getElementType()) {
+ return getGEFWrapper(new ValuePinInCallOpActCreateCommand(req));
+ }
+ if(UMLElementTypes.InputPin_3023 == req.getElementType()) {
+ return getGEFWrapper(new InputPinInCallOpActCreateCommand(req));
+ }
+ if(UMLElementTypes.OutputPin_3024 == req.getElementType()) {
+ return getGEFWrapper(new OutputPinInCallOpActCreateCommand(req));
+ }
+ if(UMLElementTypes.ValuePin_3025 == req.getElementType()) {
+ return getGEFWrapper(new ValuePinInCallOpActAsTargetCreateCommand(req));
+ }
+ if(UMLElementTypes.ActionInputPin_3026 == req.getElementType()) {
+ return getGEFWrapper(new ActionInputPinInCallOpActAsTargetCreateCommand(req));
+ }
+ if(UMLElementTypes.InputPin_3027 == req.getElementType()) {
+ return getGEFWrapper(new InputPinInCallOpActAsTargetCreateCommand(req));
+ }
+ return super.getCreateCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ActionLocalPreconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ActionLocalPostconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyChildNodesCommand(cmd);
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ private void addDestroyChildNodesCommand(ICompositeCommand cmd) {
+ View view = (View)getHost().getModel();
+ for(Iterator nit = view.getChildren().iterator(); nit.hasNext();) {
+ Node node = (Node)nit.next();
+ switch(UMLVisualIDRegistry.getVisualID(node)) {
+ case ActionInputPinInCallOpActEditPart.VISUAL_ID:
+ for(Iterator it = node.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = node.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of node as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
+ break;
+ case ValuePinInCallOpActEditPart.VISUAL_ID:
+ for(Iterator it = node.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = node.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of node as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
+ break;
+ case InputPinInCallOpActEditPart.VISUAL_ID:
+ for(Iterator it = node.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = node.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of node as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
+ break;
+ case OutputPinInCallOpActEditPart.VISUAL_ID:
+ for(Iterator it = node.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = node.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of node as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
+ break;
+ case ValuePinInCallOpActAsTargetEditPart.VISUAL_ID:
+ for(Iterator it = node.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = node.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of node as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
+ break;
+ case ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ for(Iterator it = node.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = node.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of node as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
+ break;
+ case InputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ for(Iterator it = node.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = node.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of node as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
+ break;
+ }
+ }
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ActionLocalPrecondition_4001 == req.getElementType()) {
+ return getGEFWrapper(new ActionLocalPreconditionCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ActionLocalPostcondition_4002 == req.getElementType()) {
+ return getGEFWrapper(new ActionLocalPostconditionCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ActionLocalPrecondition_4001 == req.getElementType()) {
+ return null;
+ }
+ if(UMLElementTypes.ActionLocalPostcondition_4002 == req.getElementType()) {
+ return null;
+ }
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+
+ /**
+ * Returns command to reorient EReference based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ActionLocalPreconditionEditPart.VISUAL_ID:
+ return getGEFWrapper(new ActionLocalPreconditionReorientCommand(req));
+ case ActionLocalPostconditionEditPart.VISUAL_ID:
+ return getGEFWrapper(new ActionLocalPostconditionReorientCommand(req));
+ }
+ return super.getReorientReferenceRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintAsLocalPostcondItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintAsLocalPostcondItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..baa836120bb
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintAsLocalPostcondItemSemanticEditPolicy.java
@@ -0,0 +1,164 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPostconditionCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPostconditionReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPreconditionCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPreconditionReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPostconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPreconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ConstraintAsLocalPostcondItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ConstraintAsLocalPostcondItemSemanticEditPolicy() {
+ super(UMLElementTypes.Constraint_3012);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ActionLocalPreconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ActionLocalPostconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ActionLocalPrecondition_4001 == req.getElementType()) {
+ return null;
+ }
+ if(UMLElementTypes.ActionLocalPostcondition_4002 == req.getElementType()) {
+ return null;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ActionLocalPrecondition_4001 == req.getElementType()) {
+ return getGEFWrapper(new ActionLocalPreconditionCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ActionLocalPostcondition_4002 == req.getElementType()) {
+ return getGEFWrapper(new ActionLocalPostconditionCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * Returns command to reorient EReference based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ActionLocalPreconditionEditPart.VISUAL_ID:
+ return getGEFWrapper(new ActionLocalPreconditionReorientCommand(req));
+ case ActionLocalPostconditionEditPart.VISUAL_ID:
+ return getGEFWrapper(new ActionLocalPostconditionReorientCommand(req));
+ }
+ return super.getReorientReferenceRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintAsLocalPrecondItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintAsLocalPrecondItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..fc191fbc630
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintAsLocalPrecondItemSemanticEditPolicy.java
@@ -0,0 +1,164 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPostconditionCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPostconditionReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPreconditionCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPreconditionReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPostconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPreconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ConstraintAsLocalPrecondItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ConstraintAsLocalPrecondItemSemanticEditPolicy() {
+ super(UMLElementTypes.Constraint_3011);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ActionLocalPreconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ActionLocalPostconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ActionLocalPrecondition_4001 == req.getElementType()) {
+ return null;
+ }
+ if(UMLElementTypes.ActionLocalPostcondition_4002 == req.getElementType()) {
+ return null;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ActionLocalPrecondition_4001 == req.getElementType()) {
+ return getGEFWrapper(new ActionLocalPreconditionCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ActionLocalPostcondition_4002 == req.getElementType()) {
+ return getGEFWrapper(new ActionLocalPostconditionCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * Returns command to reorient EReference based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ActionLocalPreconditionEditPart.VISUAL_ID:
+ return getGEFWrapper(new ActionLocalPreconditionReorientCommand(req));
+ case ActionLocalPostconditionEditPart.VISUAL_ID:
+ return getGEFWrapper(new ActionLocalPostconditionReorientCommand(req));
+ }
+ return super.getReorientReferenceRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintInActivityAsPostcondItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintInActivityAsPostcondItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..71372648a12
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintInActivityAsPostcondItemSemanticEditPolicy.java
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ConstraintInActivityAsPostcondItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ConstraintInActivityAsPostcondItemSemanticEditPolicy() {
+ super(UMLElementTypes.Constraint_3003);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintInActivityAsPrecondItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintInActivityAsPrecondItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..b721254eae1
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ConstraintInActivityAsPrecondItemSemanticEditPolicy.java
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ConstraintInActivityAsPrecondItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ConstraintInActivityAsPrecondItemSemanticEditPolicy() {
+ super(UMLElementTypes.Constraint_3002);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ControlFlowItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ControlFlowItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..aa813bc6221
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ControlFlowItemSemanticEditPolicy.java
@@ -0,0 +1,40 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ControlFlowItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ControlFlowItemSemanticEditPolicy() {
+ super(UMLElementTypes.ControlFlow_4004);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ return getGEFWrapper(new DestroyElementCommand(req));
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/FlowFinalNodeItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/FlowFinalNodeItemSemanticEditPolicy.java
index 7d85e21c36c..8e6f58c76cd 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/FlowFinalNodeItemSemanticEditPolicy.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/FlowFinalNodeItemSemanticEditPolicy.java
@@ -13,13 +13,25 @@
*****************************************************************************/
package org.eclipse.papyrus.diagram.activity.edit.policies;
+import java.util.Iterator;
+
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
/**
@@ -41,6 +53,36 @@ public class FlowFinalNodeItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
View view = (View)getHost().getModel();
CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
if(annotation == null) {
// there are indirectly referenced children, need extra commands: false
@@ -53,4 +95,54 @@ public class FlowFinalNodeItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
return getGEFWrapper(cmd.reduce());
}
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InitialNodeItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InitialNodeItemSemanticEditPolicy.java
index 7ddb4d96cf1..ad47446567c 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InitialNodeItemSemanticEditPolicy.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InitialNodeItemSemanticEditPolicy.java
@@ -13,13 +13,25 @@
*****************************************************************************/
package org.eclipse.papyrus.diagram.activity.edit.policies;
+import java.util.Iterator;
+
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
/**
@@ -41,6 +53,36 @@ public class InitialNodeItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
View view = (View)getHost().getModel();
CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
if(annotation == null) {
// there are indirectly referenced children, need extra commands: false
@@ -53,4 +95,54 @@ public class InitialNodeItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
return getGEFWrapper(cmd.reduce());
}
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInCallBeActItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInCallBeActItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..b65a9c62d99
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInCallBeActItemSemanticEditPolicy.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class InputPinInCallBeActItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public InputPinInCallBeActItemSemanticEditPolicy() {
+ super(UMLElementTypes.InputPin_3019);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInCallOpActAsTargetItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInCallOpActAsTargetItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..2f8eecc723c
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInCallOpActAsTargetItemSemanticEditPolicy.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class InputPinInCallOpActAsTargetItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public InputPinInCallOpActAsTargetItemSemanticEditPolicy() {
+ super(UMLElementTypes.InputPin_3027);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInCallOpActItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInCallOpActItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..8e0b62f68c1
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInCallOpActItemSemanticEditPolicy.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class InputPinInCallOpActItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public InputPinInCallOpActItemSemanticEditPolicy() {
+ super(UMLElementTypes.InputPin_3023);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInOpaqueActItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInOpaqueActItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..3cd4ce7136d
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/InputPinInOpaqueActItemSemanticEditPolicy.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class InputPinInOpaqueActItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public InputPinInOpaqueActItemSemanticEditPolicy() {
+ super(UMLElementTypes.InputPin_3013);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ObjectFlowItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ObjectFlowItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..c566bd32138
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ObjectFlowItemSemanticEditPolicy.java
@@ -0,0 +1,98 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowSelectionCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowSelectionReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowTransformationCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowTransformationReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowTransformationEditPart;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ObjectFlowItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ObjectFlowItemSemanticEditPolicy() {
+ super(UMLElementTypes.ObjectFlow_4003);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ return getGEFWrapper(new DestroyElementCommand(req));
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlowSelection_4005 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowSelectionCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ObjectFlowTransformation_4006 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowTransformationCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlowSelection_4005 == req.getElementType()) {
+ return null;
+ }
+ if(UMLElementTypes.ObjectFlowTransformation_4006 == req.getElementType()) {
+ return null;
+ }
+ return null;
+ }
+
+ /**
+ * Returns command to reorient EReference based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowSelectionEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowSelectionReorientCommand(req));
+ case ObjectFlowTransformationEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowTransformationReorientCommand(req));
+ }
+ return super.getReorientReferenceRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ObjectFlowSelectionItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ObjectFlowSelectionItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..e092abac83c
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ObjectFlowSelectionItemSemanticEditPolicy.java
@@ -0,0 +1,40 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ObjectFlowSelectionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ObjectFlowSelectionItemSemanticEditPolicy() {
+ super(UMLElementTypes.ObjectFlowSelection_4005);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
+ return getGEFWrapper(new DestroyReferenceCommand(req));
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ObjectFlowTransformationItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ObjectFlowTransformationItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..78794200f81
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ObjectFlowTransformationItemSemanticEditPolicy.java
@@ -0,0 +1,40 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ObjectFlowTransformationItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ObjectFlowTransformationItemSemanticEditPolicy() {
+ super(UMLElementTypes.ObjectFlowTransformation_4006);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
+ return getGEFWrapper(new DestroyReferenceCommand(req));
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OpaqueActionCanonicalEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OpaqueActionCanonicalEditPolicy.java
new file mode 100644
index 00000000000..00927cffc0a
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OpaqueActionCanonicalEditPolicy.java
@@ -0,0 +1,93 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramUpdater;
+import org.eclipse.papyrus.diagram.activity.part.UMLNodeDescriptor;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * @generated
+ */
+public class OpaqueActionCanonicalEditPolicy extends CanonicalEditPolicy {
+
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View)getHost().getModel();
+ List result = new LinkedList();
+ for(Iterator it = UMLDiagramUpdater.getOpaqueAction_3007SemanticChildren(viewObject).iterator(); it.hasNext();) {
+ result.add(((UMLNodeDescriptor)it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = UMLVisualIDRegistry.getVisualID(view);
+ switch(visualID) {
+ case ValuePinInOpaqueActEditPart.VISUAL_ID:
+ case ActionInputPinInOpaqueActEditPart.VISUAL_ID:
+ case InputPinInOpaqueActEditPart.VISUAL_ID:
+ case OutputPinInOpaqueActEditPart.VISUAL_ID:
+ if(!semanticChildren.contains(view.getElement())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultFactoryHint() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Set getFeaturesToSynchronize() {
+ if(myFeaturesToSynchronize == null) {
+ myFeaturesToSynchronize = new HashSet();
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getOpaqueAction_InputValue());
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getOpaqueAction_OutputValue());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OpaqueActionItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OpaqueActionItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..5f5f003ef62
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OpaqueActionItemSemanticEditPolicy.java
@@ -0,0 +1,416 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionInputPinInOpaqueActCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPostconditionCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPostconditionReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPreconditionCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ActionLocalPreconditionReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.InputPinInOpaqueActCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.OutputPinInOpaqueActCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ValuePinInOpaqueActCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPostconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPreconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class OpaqueActionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public OpaqueActionItemSemanticEditPolicy() {
+ super(UMLElementTypes.OpaqueAction_3007);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateCommand(CreateElementRequest req) {
+ if(UMLElementTypes.ValuePin_3015 == req.getElementType()) {
+ return getGEFWrapper(new ValuePinInOpaqueActCreateCommand(req));
+ }
+ if(UMLElementTypes.ActionInputPin_3016 == req.getElementType()) {
+ return getGEFWrapper(new ActionInputPinInOpaqueActCreateCommand(req));
+ }
+ if(UMLElementTypes.InputPin_3013 == req.getElementType()) {
+ return getGEFWrapper(new InputPinInOpaqueActCreateCommand(req));
+ }
+ if(UMLElementTypes.OutputPin_3014 == req.getElementType()) {
+ return getGEFWrapper(new OutputPinInOpaqueActCreateCommand(req));
+ }
+ return super.getCreateCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ActionLocalPreconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ActionLocalPostconditionEditPart.VISUAL_ID) {
+ DestroyReferenceRequest r = new DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);
+ cmd.add(new DestroyReferenceCommand(r) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ EObject referencedObject = getReferencedObject();
+ Resource resource = referencedObject.eResource();
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ if(resource != null) {
+ resource.getContents().add(referencedObject);
+ }
+ return result;
+ }
+ });
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyChildNodesCommand(cmd);
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ private void addDestroyChildNodesCommand(ICompositeCommand cmd) {
+ View view = (View)getHost().getModel();
+ for(Iterator nit = view.getChildren().iterator(); nit.hasNext();) {
+ Node node = (Node)nit.next();
+ switch(UMLVisualIDRegistry.getVisualID(node)) {
+ case ValuePinInOpaqueActEditPart.VISUAL_ID:
+ for(Iterator it = node.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = node.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of node as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
+ break;
+ case ActionInputPinInOpaqueActEditPart.VISUAL_ID:
+ for(Iterator it = node.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = node.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of node as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
+ break;
+ case InputPinInOpaqueActEditPart.VISUAL_ID:
+ for(Iterator it = node.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = node.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of node as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
+ break;
+ case OutputPinInOpaqueActEditPart.VISUAL_ID:
+ for(Iterator it = node.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = node.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
+ // don't need explicit deletion of node as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
+ break;
+ }
+ }
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ActionLocalPrecondition_4001 == req.getElementType()) {
+ return getGEFWrapper(new ActionLocalPreconditionCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ActionLocalPostcondition_4002 == req.getElementType()) {
+ return getGEFWrapper(new ActionLocalPostconditionCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ActionLocalPrecondition_4001 == req.getElementType()) {
+ return null;
+ }
+ if(UMLElementTypes.ActionLocalPostcondition_4002 == req.getElementType()) {
+ return null;
+ }
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+
+ /**
+ * Returns command to reorient EReference based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ActionLocalPreconditionEditPart.VISUAL_ID:
+ return getGEFWrapper(new ActionLocalPreconditionReorientCommand(req));
+ case ActionLocalPostconditionEditPart.VISUAL_ID:
+ return getGEFWrapper(new ActionLocalPostconditionReorientCommand(req));
+ }
+ return super.getReorientReferenceRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OutputPinInCallBeActItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OutputPinInCallBeActItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..59b00eb45a7
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OutputPinInCallBeActItemSemanticEditPolicy.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class OutputPinInCallBeActItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public OutputPinInCallBeActItemSemanticEditPolicy() {
+ super(UMLElementTypes.OutputPin_3020);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OutputPinInCallOpActItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OutputPinInCallOpActItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..bb5b72fb674
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OutputPinInCallOpActItemSemanticEditPolicy.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class OutputPinInCallOpActItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public OutputPinInCallOpActItemSemanticEditPolicy() {
+ super(UMLElementTypes.OutputPin_3024);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OutputPinInOpaqueActItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OutputPinInOpaqueActItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..b92e7651ac8
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/OutputPinInOpaqueActItemSemanticEditPolicy.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class OutputPinInOpaqueActItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public OutputPinInOpaqueActItemSemanticEditPolicy() {
+ super(UMLElementTypes.OutputPin_3014);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/UMLBaseItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/UMLBaseItemSemanticEditPolicy.java
index 1f0c4a45510..6dbf2856511 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/UMLBaseItemSemanticEditPolicy.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/UMLBaseItemSemanticEditPolicy.java
@@ -47,6 +47,12 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.diagram.activity.edit.helpers.UMLBaseEditHelper;
import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.Action;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.ActivityNode;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.ObjectFlow;
/**
* @generated
@@ -307,5 +313,119 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
private static final String OPPOSITE_END_VAR = "oppositeEnd"; //$NON-NLS-1$
+ /**
+ * @generated
+ */
+ public static boolean canCreateActionLocalPrecondition_4001(Action source, Constraint target) {
+ if(source != null) {
+ if(source.getLocalPreconditions().contains(target)) {
+ return false;
+ }
+ if(source == target) {
+ return false;
+ }
+ }
+
+ return canExistActionLocalPrecondition_4001(source, target);
+ }
+
+ /**
+ * @generated
+ */
+ public static boolean canCreateActionLocalPostcondition_4002(Action source, Constraint target) {
+ if(source != null) {
+ if(source.getLocalPostconditions().contains(target)) {
+ return false;
+ }
+ if(source == target) {
+ return false;
+ }
+ }
+
+ return canExistActionLocalPostcondition_4002(source, target);
+ }
+
+ /**
+ * @generated
+ */
+ public static boolean canCreateObjectFlowSelection_4005(ObjectFlow source, Behavior target) {
+ if(source != null) {
+ if(source.getSelection() != null) {
+ return false;
+ }
+ }
+
+ return canExistObjectFlowSelection_4005(source, target);
+ }
+
+ /**
+ * @generated
+ */
+ public static boolean canCreateObjectFlowTransformation_4006(ObjectFlow source, Behavior target) {
+ if(source != null) {
+ if(source.getTransformation() != null) {
+ return false;
+ }
+ }
+
+ return canExistObjectFlowTransformation_4006(source, target);
+ }
+
+ /**
+ * @generated
+ */
+ public static boolean canCreateObjectFlow_4003(Activity container, ActivityNode source, ActivityNode target) {
+ return canExistObjectFlow_4003(container, source, target);
+ }
+
+ /**
+ * @generated
+ */
+ public static boolean canCreateControlFlow_4004(Activity container, ActivityNode source, ActivityNode target) {
+ return canExistControlFlow_4004(container, source, target);
+ }
+
+ /**
+ * @generated
+ */
+ public static boolean canExistActionLocalPrecondition_4001(Action source, Constraint target) {
+ return true;
+ }
+
+ /**
+ * @generated
+ */
+ public static boolean canExistActionLocalPostcondition_4002(Action source, Constraint target) {
+ return true;
+ }
+
+ /**
+ * @generated
+ */
+ public static boolean canExistObjectFlowSelection_4005(ObjectFlow source, Behavior target) {
+ return true;
+ }
+
+ /**
+ * @generated
+ */
+ public static boolean canExistObjectFlowTransformation_4006(ObjectFlow source, Behavior target) {
+ return true;
+ }
+
+ /**
+ * @generated
+ */
+ public static boolean canExistObjectFlow_4003(Activity container, ActivityNode source, ActivityNode target) {
+ return true;
+ }
+
+ /**
+ * @generated
+ */
+ public static boolean canExistControlFlow_4004(Activity container, ActivityNode source, ActivityNode target) {
+ return true;
+ }
+
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInCallBeActItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInCallBeActItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..42e99764e8a
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInCallBeActItemSemanticEditPolicy.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ValuePinInCallBeActItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ValuePinInCallBeActItemSemanticEditPolicy() {
+ super(UMLElementTypes.ValuePin_3017);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInCallOpActAsTargetItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInCallOpActAsTargetItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..d3ba27e3f61
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInCallOpActAsTargetItemSemanticEditPolicy.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ValuePinInCallOpActAsTargetItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ValuePinInCallOpActAsTargetItemSemanticEditPolicy() {
+ super(UMLElementTypes.ValuePin_3025);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInCallOpActItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInCallOpActItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..99150a4cbb5
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInCallOpActItemSemanticEditPolicy.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ValuePinInCallOpActItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ValuePinInCallOpActItemSemanticEditPolicy() {
+ super(UMLElementTypes.ValuePin_3022);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInOpaqueActItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInOpaqueActItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..e07505d43c9
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/policies/ValuePinInOpaqueActItemSemanticEditPolicy.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * 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.diagram.activity.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ControlFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowCreateCommand;
+import org.eclipse.papyrus.diagram.activity.edit.commands.ObjectFlowReorientCommand;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ValuePinInOpaqueActItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ValuePinInOpaqueActItemSemanticEditPolicy() {
+ super(UMLElementTypes.ValuePin_3015);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ for(Iterator it = view.getTargetEdges().iterator(); it.hasNext();) {
+ Edge incomingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
+ continue;
+ }
+ }
+ for(Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
+ Edge outgoingLink = (Edge)it.next();
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ if(UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.VISUAL_ID) {
+ DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
+ cmd.add(new DestroyElementCommand(r));
+ cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
+ continue;
+ }
+ }
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super.getCreateRelationshipCommand(req);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ObjectFlow_4003 == req.getElementType()) {
+ return getGEFWrapper(new ObjectFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ if(UMLElementTypes.ControlFlow_4004 == req.getElementType()) {
+ return getGEFWrapper(new ControlFlowCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ switch(getVisualID(req)) {
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ObjectFlowReorientCommand(req));
+ case ControlFlowEditPart.VISUAL_ID:
+ return getGEFWrapper(new ControlFlowReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/navigator/UMLNavigatorContentProvider.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/navigator/UMLNavigatorContentProvider.java
index 317533f7bdc..2ef00abc7b9 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/navigator/UMLNavigatorContentProvider.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/navigator/UMLNavigatorContentProvider.java
@@ -30,18 +30,47 @@ import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPostconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPreconditionEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityContentCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityParametersCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityPostConditionsCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityPreConditionsCompartmentEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsTransformationEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityDiagramEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityFinalNodeEditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.Constraint2EditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.FlowFinalNodeEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.InitialNodeEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowTransformationEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOpaqueActEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ParameterEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.part.Messages;
import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.navigator.ICommonContentExtensionSite;
@@ -149,8 +178,24 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
**/
private Object[] getViewChildrenForActivityDiagramEditPart(View view, Object parentElement) {
Collection result = new ArrayList();
+ UMLNavigatorGroup links = new UMLNavigatorGroup(Messages.NavigatorGroupName_Package_1000_links, "icons/linksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
Collection connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityEditPart.VISUAL_ID));
result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getDiagramLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPreconditionEditPart.VISUAL_ID));
+ links.addChildren(createNavigatorItems(connectedViews, links, false));
+ connectedViews = getDiagramLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPostconditionEditPart.VISUAL_ID));
+ links.addChildren(createNavigatorItems(connectedViews, links, false));
+ connectedViews = getDiagramLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowSelectionEditPart.VISUAL_ID));
+ links.addChildren(createNavigatorItems(connectedViews, links, false));
+ connectedViews = getDiagramLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowTransformationEditPart.VISUAL_ID));
+ links.addChildren(createNavigatorItems(connectedViews, links, false));
+ connectedViews = getDiagramLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ links.addChildren(createNavigatorItems(connectedViews, links, false));
+ connectedViews = getDiagramLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ links.addChildren(createNavigatorItems(connectedViews, links, false));
+ if(!links.isEmpty()) {
+ result.add(links);
+ }
return result.toArray();
}
@@ -163,14 +208,15 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
**/
private Object[] getViewChildrenForActivityEditPart(View view, Object parentElement) {
Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Activity_2001_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
Collection connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityActivityParametersCompartmentEditPart.VISUAL_ID));
connectedViews = getChildrenByType(connectedViews, UMLVisualIDRegistry.getType(ParameterEditPart.VISUAL_ID));
result.addAll(createNavigatorItems(connectedViews, parentElement, false));
connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityActivityPreConditionsCompartmentEditPart.VISUAL_ID));
- connectedViews = getChildrenByType(connectedViews, UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(connectedViews, UMLVisualIDRegistry.getType(ConstraintInActivityAsPrecondEditPart.VISUAL_ID));
result.addAll(createNavigatorItems(connectedViews, parentElement, false));
connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityActivityPostConditionsCompartmentEditPart.VISUAL_ID));
- connectedViews = getChildrenByType(connectedViews, UMLVisualIDRegistry.getType(Constraint2EditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(connectedViews, UMLVisualIDRegistry.getType(ConstraintInActivityAsPostcondEditPart.VISUAL_ID));
result.addAll(createNavigatorItems(connectedViews, parentElement, false));
connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityActivityContentCompartmentEditPart.VISUAL_ID));
connectedViews = getChildrenByType(connectedViews, UMLVisualIDRegistry.getType(InitialNodeEditPart.VISUAL_ID));
@@ -181,6 +227,1104 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityActivityContentCompartmentEditPart.VISUAL_ID));
connectedViews = getChildrenByType(connectedViews, UMLVisualIDRegistry.getType(FlowFinalNodeEditPart.VISUAL_ID));
result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityActivityContentCompartmentEditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(connectedViews, UMLVisualIDRegistry.getType(OpaqueActionEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityActivityContentCompartmentEditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(connectedViews, UMLVisualIDRegistry.getType(CallBehaviorActionEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityActivityContentCompartmentEditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(connectedViews, UMLVisualIDRegistry.getType(CallOperationActionEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityActivityContentCompartmentEditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(connectedViews, UMLVisualIDRegistry.getType(ConstraintAsLocalPrecondEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityActivityContentCompartmentEditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(connectedViews, UMLVisualIDRegistry.getType(ConstraintAsLocalPostcondEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityActivityContentCompartmentEditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(connectedViews, UMLVisualIDRegistry.getType(ActivityAsSelectionEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityActivityContentCompartmentEditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(connectedViews, UMLVisualIDRegistry.getType(ActivityAsTransformationEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowSelectionEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowTransformationEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForConstraintInActivityAsPrecondEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Constraint_3002_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPreconditionEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPostconditionEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForConstraintInActivityAsPostcondEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Constraint_3003_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPreconditionEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPostconditionEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForInitialNodeEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_InitialNode_3004_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_InitialNode_3004_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForActivityFinalNodeEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ActivityFinalNode_3005_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ActivityFinalNode_3005_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForFlowFinalNodeEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_FlowFinalNode_3006_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_FlowFinalNode_3006_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForOpaqueActionEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_OpaqueAction_3007_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_OpaqueAction_3007_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInOpaqueActEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInOpaqueActEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInOpaqueActEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OutputPinInOpaqueActEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPreconditionEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPostconditionEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForValuePinInOpaqueActEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ValuePin_3015_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ValuePin_3015_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForActionInputPinInOpaqueActEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ActionInputPin_3016_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ActionInputPin_3016_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForInputPinInOpaqueActEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_InputPin_3013_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_InputPin_3013_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForOutputPinInOpaqueActEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_OutputPin_3014_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_OutputPin_3014_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForCallBehaviorActionEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_CallBehaviorAction_3008_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_CallBehaviorAction_3008_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInCallBeActEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInCallBeActEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInCallBeActEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OutputPinInCallBeActEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPreconditionEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPostconditionEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForValuePinInCallBeActEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ValuePin_3017_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ValuePin_3017_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForActionInputPinInCallBeActEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ActionInputPin_3018_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ActionInputPin_3018_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForInputPinInCallBeActEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_InputPin_3019_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_InputPin_3019_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForOutputPinInCallBeActEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_OutputPin_3020_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_OutputPin_3020_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForCallOperationActionEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_CallOperationAction_3010_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_CallOperationAction_3010_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInCallOpActEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInCallOpActEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInCallOpActEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OutputPinInCallOpActEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInCallOpActAsTargetEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInCallOpActAsTargetEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPreconditionEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPostconditionEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForActionInputPinInCallOpActEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ActionInputPin_3021_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ActionInputPin_3021_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForValuePinInCallOpActEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ValuePin_3022_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ValuePin_3022_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForInputPinInCallOpActEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_InputPin_3023_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_InputPin_3023_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForOutputPinInCallOpActEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_OutputPin_3024_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_OutputPin_3024_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForValuePinInCallOpActAsTargetEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ValuePin_3025_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ValuePin_3025_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForActionInputPinInCallOpActAsTargetEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ActionInputPin_3026_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ActionInputPin_3026_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForInputPinInCallOpActAsTargetEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_InputPin_3027_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_InputPin_3027_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ if(!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForConstraintAsLocalPrecondEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Constraint_3011_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPreconditionEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPostconditionEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForConstraintAsLocalPostcondEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Constraint_3012_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPreconditionEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionLocalPostconditionEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForActivityAsSelectionEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Activity_3028_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowSelectionEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowTransformationEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForActivityAsTransformationEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Activity_3029_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowSelectionEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ObjectFlowTransformationEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ if(!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForActionLocalPreconditionEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup target = new UMLNavigatorGroup(Messages.NavigatorGroupName_ActionLocalPrecondition_4001_target, "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup source = new UMLNavigatorGroup(Messages.NavigatorGroupName_ActionLocalPrecondition_4001_source, "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintInActivityAsPrecondEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintInActivityAsPostcondEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintAsLocalPrecondEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintAsLocalPostcondEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OpaqueActionEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(CallBehaviorActionEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(CallOperationActionEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ if(!target.isEmpty()) {
+ result.add(target);
+ }
+ if(!source.isEmpty()) {
+ result.add(source);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForActionLocalPostconditionEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup target = new UMLNavigatorGroup(Messages.NavigatorGroupName_ActionLocalPostcondition_4002_target, "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup source = new UMLNavigatorGroup(Messages.NavigatorGroupName_ActionLocalPostcondition_4002_source, "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintInActivityAsPrecondEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintInActivityAsPostcondEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintAsLocalPrecondEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintAsLocalPostcondEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OpaqueActionEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(CallBehaviorActionEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(CallOperationActionEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ if(!target.isEmpty()) {
+ result.add(target);
+ }
+ if(!source.isEmpty()) {
+ result.add(source);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForObjectFlowSelectionEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup target = new UMLNavigatorGroup(Messages.NavigatorGroupName_ObjectFlowSelection_4005_target, "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityAsSelectionEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityAsTransformationEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ if(!target.isEmpty()) {
+ result.add(target);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForObjectFlowTransformationEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup target = new UMLNavigatorGroup(Messages.NavigatorGroupName_ObjectFlowTransformation_4006_target, "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityAsSelectionEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityAsTransformationEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ if(!target.isEmpty()) {
+ result.add(target);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForObjectFlowEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup target = new UMLNavigatorGroup(Messages.NavigatorGroupName_ObjectFlow_4003_target, "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup source = new UMLNavigatorGroup(Messages.NavigatorGroupName_ObjectFlow_4003_source, "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InitialNodeEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityFinalNodeEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(FlowFinalNodeEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OpaqueActionEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInOpaqueActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInOpaqueActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInOpaqueActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OutputPinInOpaqueActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(CallBehaviorActionEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInCallBeActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInCallBeActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInCallBeActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OutputPinInCallBeActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(CallOperationActionEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInCallOpActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInCallOpActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInCallOpActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OutputPinInCallOpActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInCallOpActAsTargetEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInCallOpActAsTargetEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InitialNodeEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityFinalNodeEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(FlowFinalNodeEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OpaqueActionEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInOpaqueActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInOpaqueActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInOpaqueActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OutputPinInOpaqueActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(CallBehaviorActionEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInCallBeActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInCallBeActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInCallBeActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OutputPinInCallBeActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(CallOperationActionEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInCallOpActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInCallOpActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInCallOpActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OutputPinInCallOpActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInCallOpActAsTargetEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInCallOpActAsTargetEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ if(!target.isEmpty()) {
+ result.add(target);
+ }
+ if(!source.isEmpty()) {
+ result.add(source);
+ }
+ return result.toArray();
+ }
+
+ /**
+ *
+ *Papyrus Template
+ *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForControlFlowEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ UMLNavigatorGroup target = new UMLNavigatorGroup(Messages.NavigatorGroupName_ControlFlow_4004_target, "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ UMLNavigatorGroup source = new UMLNavigatorGroup(Messages.NavigatorGroupName_ControlFlow_4004_source, "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InitialNodeEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityFinalNodeEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(FlowFinalNodeEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OpaqueActionEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInOpaqueActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInOpaqueActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInOpaqueActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OutputPinInOpaqueActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(CallBehaviorActionEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInCallBeActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInCallBeActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInCallBeActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OutputPinInCallBeActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(CallOperationActionEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInCallOpActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInCallOpActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInCallOpActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OutputPinInCallOpActEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInCallOpActAsTargetEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInCallOpActAsTargetEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InitialNodeEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActivityFinalNodeEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(FlowFinalNodeEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OpaqueActionEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInOpaqueActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInOpaqueActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInOpaqueActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OutputPinInOpaqueActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(CallBehaviorActionEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInCallBeActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInCallBeActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInCallBeActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OutputPinInCallBeActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(CallOperationActionEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInCallOpActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInCallOpActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInCallOpActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(OutputPinInCallOpActEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ValuePinInCallOpActAsTargetEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(InputPinInCallOpActAsTargetEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ if(!target.isEmpty()) {
+ result.add(target);
+ }
+ if(!source.isEmpty()) {
+ result.add(source);
+ }
return result.toArray();
}
@@ -286,6 +1430,303 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
}
+ case ConstraintInActivityAsPrecondEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForConstraintInActivityAsPrecondEditPart(view, parentElement);
+
+ }
+
+ case ConstraintInActivityAsPostcondEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForConstraintInActivityAsPostcondEditPart(view, parentElement);
+
+ }
+
+ case InitialNodeEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForInitialNodeEditPart(view, parentElement);
+
+ }
+
+ case ActivityFinalNodeEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForActivityFinalNodeEditPart(view, parentElement);
+
+ }
+
+ case FlowFinalNodeEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForFlowFinalNodeEditPart(view, parentElement);
+
+ }
+
+ case OpaqueActionEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForOpaqueActionEditPart(view, parentElement);
+
+ }
+
+ case ValuePinInOpaqueActEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForValuePinInOpaqueActEditPart(view, parentElement);
+
+ }
+
+ case ActionInputPinInOpaqueActEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForActionInputPinInOpaqueActEditPart(view, parentElement);
+
+ }
+
+ case InputPinInOpaqueActEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForInputPinInOpaqueActEditPart(view, parentElement);
+
+ }
+
+ case OutputPinInOpaqueActEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForOutputPinInOpaqueActEditPart(view, parentElement);
+
+ }
+
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForCallBehaviorActionEditPart(view, parentElement);
+
+ }
+
+ case ValuePinInCallBeActEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForValuePinInCallBeActEditPart(view, parentElement);
+
+ }
+
+ case ActionInputPinInCallBeActEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForActionInputPinInCallBeActEditPart(view, parentElement);
+
+ }
+
+ case InputPinInCallBeActEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForInputPinInCallBeActEditPart(view, parentElement);
+
+ }
+
+ case OutputPinInCallBeActEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForOutputPinInCallBeActEditPart(view, parentElement);
+
+ }
+
+ case CallOperationActionEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForCallOperationActionEditPart(view, parentElement);
+
+ }
+
+ case ActionInputPinInCallOpActEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForActionInputPinInCallOpActEditPart(view, parentElement);
+
+ }
+
+ case ValuePinInCallOpActEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForValuePinInCallOpActEditPart(view, parentElement);
+
+ }
+
+ case InputPinInCallOpActEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForInputPinInCallOpActEditPart(view, parentElement);
+
+ }
+
+ case OutputPinInCallOpActEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForOutputPinInCallOpActEditPart(view, parentElement);
+
+ }
+
+ case ValuePinInCallOpActAsTargetEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForValuePinInCallOpActAsTargetEditPart(view, parentElement);
+
+ }
+
+ case ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForActionInputPinInCallOpActAsTargetEditPart(view, parentElement);
+
+ }
+
+ case InputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForInputPinInCallOpActAsTargetEditPart(view, parentElement);
+
+ }
+
+ case ConstraintAsLocalPrecondEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForConstraintAsLocalPrecondEditPart(view, parentElement);
+
+ }
+
+ case ConstraintAsLocalPostcondEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForConstraintAsLocalPostcondEditPart(view, parentElement);
+
+ }
+
+ case ActivityAsSelectionEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForActivityAsSelectionEditPart(view, parentElement);
+
+ }
+
+ case ActivityAsTransformationEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForActivityAsTransformationEditPart(view, parentElement);
+
+ }
+
+ case ActionLocalPreconditionEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForActionLocalPreconditionEditPart(view, parentElement);
+
+ }
+
+ case ActionLocalPostconditionEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForActionLocalPostconditionEditPart(view, parentElement);
+
+ }
+
+ case ObjectFlowSelectionEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForObjectFlowSelectionEditPart(view, parentElement);
+
+ }
+
+ case ObjectFlowTransformationEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForObjectFlowTransformationEditPart(view, parentElement);
+
+ }
+
+ case ObjectFlowEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForObjectFlowEditPart(view, parentElement);
+
+ }
+
+ case ControlFlowEditPart.VISUAL_ID:
+ {
+
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForControlFlowEditPart(view, parentElement);
+
+ }
+
}
return EMPTY_ARRAY;
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/navigator/UMLNavigatorLabelProvider.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/navigator/UMLNavigatorLabelProvider.java
index 3b27c99fc8d..a6a08ebb7dc 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/navigator/UMLNavigatorLabelProvider.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/navigator/UMLNavigatorLabelProvider.java
@@ -24,15 +24,67 @@ import org.eclipse.jface.viewers.ITreePathLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.ViewerLabel;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActAsTargetLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPostconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPreconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsSelectionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsTransformationEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsTransformationNameEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityDiagramEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityFinalNodeEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityNameEditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.Constraint2EditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowNameEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.FlowFinalNodeEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.InitialNodeEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCOActAsTargetLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowTransformationEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOpaqueActEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ParameterEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActAsTargetLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOpaqueActEditPart;
import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
@@ -103,9 +155,9 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
return getImage("Navigator?TopLevelNode?http://www.eclipse.org/uml2/3.0.0/UML?Activity", UMLElementTypes.Activity_2001); //$NON-NLS-1$
case ParameterEditPart.VISUAL_ID:
return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?Parameter", UMLElementTypes.Parameter_3001); //$NON-NLS-1$
- case ConstraintEditPart.VISUAL_ID:
+ case ConstraintInActivityAsPrecondEditPart.VISUAL_ID:
return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?Constraint", UMLElementTypes.Constraint_3002); //$NON-NLS-1$
- case Constraint2EditPart.VISUAL_ID:
+ case ConstraintInActivityAsPostcondEditPart.VISUAL_ID:
return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?Constraint", UMLElementTypes.Constraint_3003); //$NON-NLS-1$
case InitialNodeEditPart.VISUAL_ID:
return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?InitialNode", UMLElementTypes.InitialNode_3004); //$NON-NLS-1$
@@ -113,6 +165,62 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?ActivityFinalNode", UMLElementTypes.ActivityFinalNode_3005); //$NON-NLS-1$
case FlowFinalNodeEditPart.VISUAL_ID:
return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?FlowFinalNode", UMLElementTypes.FlowFinalNode_3006); //$NON-NLS-1$
+ case OpaqueActionEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?OpaqueAction", UMLElementTypes.OpaqueAction_3007); //$NON-NLS-1$
+ case ValuePinInOpaqueActEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?ValuePin", UMLElementTypes.ValuePin_3015); //$NON-NLS-1$
+ case ActionInputPinInOpaqueActEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?ActionInputPin", UMLElementTypes.ActionInputPin_3016); //$NON-NLS-1$
+ case InputPinInOpaqueActEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?InputPin", UMLElementTypes.InputPin_3013); //$NON-NLS-1$
+ case OutputPinInOpaqueActEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?OutputPin", UMLElementTypes.OutputPin_3014); //$NON-NLS-1$
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?CallBehaviorAction", UMLElementTypes.CallBehaviorAction_3008); //$NON-NLS-1$
+ case ValuePinInCallBeActEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?ValuePin", UMLElementTypes.ValuePin_3017); //$NON-NLS-1$
+ case ActionInputPinInCallBeActEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?ActionInputPin", UMLElementTypes.ActionInputPin_3018); //$NON-NLS-1$
+ case InputPinInCallBeActEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?InputPin", UMLElementTypes.InputPin_3019); //$NON-NLS-1$
+ case OutputPinInCallBeActEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?OutputPin", UMLElementTypes.OutputPin_3020); //$NON-NLS-1$
+ case CallOperationActionEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?CallOperationAction", UMLElementTypes.CallOperationAction_3010); //$NON-NLS-1$
+ case ActionInputPinInCallOpActEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?ActionInputPin", UMLElementTypes.ActionInputPin_3021); //$NON-NLS-1$
+ case ValuePinInCallOpActEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?ValuePin", UMLElementTypes.ValuePin_3022); //$NON-NLS-1$
+ case InputPinInCallOpActEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?InputPin", UMLElementTypes.InputPin_3023); //$NON-NLS-1$
+ case OutputPinInCallOpActEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?OutputPin", UMLElementTypes.OutputPin_3024); //$NON-NLS-1$
+ case ValuePinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?ValuePin", UMLElementTypes.ValuePin_3025); //$NON-NLS-1$
+ case ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?ActionInputPin", UMLElementTypes.ActionInputPin_3026); //$NON-NLS-1$
+ case InputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?InputPin", UMLElementTypes.InputPin_3027); //$NON-NLS-1$
+ case ConstraintAsLocalPrecondEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?Constraint", UMLElementTypes.Constraint_3011); //$NON-NLS-1$
+ case ConstraintAsLocalPostcondEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?Constraint", UMLElementTypes.Constraint_3012); //$NON-NLS-1$
+ case ActivityAsSelectionEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?Activity", UMLElementTypes.Activity_3028); //$NON-NLS-1$
+ case ActivityAsTransformationEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?Activity", UMLElementTypes.Activity_3029); //$NON-NLS-1$
+ case ActionLocalPreconditionEditPart.VISUAL_ID:
+ return getImage("Navigator?Link?http://www.eclipse.org/uml2/3.0.0/UML?Action?localPrecondition", UMLElementTypes.ActionLocalPrecondition_4001); //$NON-NLS-1$
+ case ActionLocalPostconditionEditPart.VISUAL_ID:
+ return getImage("Navigator?Link?http://www.eclipse.org/uml2/3.0.0/UML?Action?localPostcondition", UMLElementTypes.ActionLocalPostcondition_4002); //$NON-NLS-1$
+ case ObjectFlowSelectionEditPart.VISUAL_ID:
+ return getImage("Navigator?Link?http://www.eclipse.org/uml2/3.0.0/UML?ObjectFlow?selection", UMLElementTypes.ObjectFlowSelection_4005); //$NON-NLS-1$
+ case ObjectFlowTransformationEditPart.VISUAL_ID:
+ return getImage("Navigator?Link?http://www.eclipse.org/uml2/3.0.0/UML?ObjectFlow?transformation", UMLElementTypes.ObjectFlowTransformation_4006); //$NON-NLS-1$
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getImage("Navigator?Link?http://www.eclipse.org/uml2/3.0.0/UML?ObjectFlow", UMLElementTypes.ObjectFlow_4003); //$NON-NLS-1$
+ case ControlFlowEditPart.VISUAL_ID:
+ return getImage("Navigator?Link?http://www.eclipse.org/uml2/3.0.0/UML?ControlFlow", UMLElementTypes.ControlFlow_4004); //$NON-NLS-1$
}
return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$
}
@@ -170,9 +278,9 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
return getActivity_2001Text(view);
case ParameterEditPart.VISUAL_ID:
return getParameter_3001Text(view);
- case ConstraintEditPart.VISUAL_ID:
+ case ConstraintInActivityAsPrecondEditPart.VISUAL_ID:
return getConstraint_3002Text(view);
- case Constraint2EditPart.VISUAL_ID:
+ case ConstraintInActivityAsPostcondEditPart.VISUAL_ID:
return getConstraint_3003Text(view);
case InitialNodeEditPart.VISUAL_ID:
return getInitialNode_3004Text(view);
@@ -180,6 +288,62 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
return getActivityFinalNode_3005Text(view);
case FlowFinalNodeEditPart.VISUAL_ID:
return getFlowFinalNode_3006Text(view);
+ case OpaqueActionEditPart.VISUAL_ID:
+ return getOpaqueAction_3007Text(view);
+ case ValuePinInOpaqueActEditPart.VISUAL_ID:
+ return getValuePin_3015Text(view);
+ case ActionInputPinInOpaqueActEditPart.VISUAL_ID:
+ return getActionInputPin_3016Text(view);
+ case InputPinInOpaqueActEditPart.VISUAL_ID:
+ return getInputPin_3013Text(view);
+ case OutputPinInOpaqueActEditPart.VISUAL_ID:
+ return getOutputPin_3014Text(view);
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ return getCallBehaviorAction_3008Text(view);
+ case ValuePinInCallBeActEditPart.VISUAL_ID:
+ return getValuePin_3017Text(view);
+ case ActionInputPinInCallBeActEditPart.VISUAL_ID:
+ return getActionInputPin_3018Text(view);
+ case InputPinInCallBeActEditPart.VISUAL_ID:
+ return getInputPin_3019Text(view);
+ case OutputPinInCallBeActEditPart.VISUAL_ID:
+ return getOutputPin_3020Text(view);
+ case CallOperationActionEditPart.VISUAL_ID:
+ return getCallOperationAction_3010Text(view);
+ case ActionInputPinInCallOpActEditPart.VISUAL_ID:
+ return getActionInputPin_3021Text(view);
+ case ValuePinInCallOpActEditPart.VISUAL_ID:
+ return getValuePin_3022Text(view);
+ case InputPinInCallOpActEditPart.VISUAL_ID:
+ return getInputPin_3023Text(view);
+ case OutputPinInCallOpActEditPart.VISUAL_ID:
+ return getOutputPin_3024Text(view);
+ case ValuePinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return getValuePin_3025Text(view);
+ case ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return getActionInputPin_3026Text(view);
+ case InputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return getInputPin_3027Text(view);
+ case ConstraintAsLocalPrecondEditPart.VISUAL_ID:
+ return getConstraint_3011Text(view);
+ case ConstraintAsLocalPostcondEditPart.VISUAL_ID:
+ return getConstraint_3012Text(view);
+ case ActivityAsSelectionEditPart.VISUAL_ID:
+ return getActivity_3028Text(view);
+ case ActivityAsTransformationEditPart.VISUAL_ID:
+ return getActivity_3029Text(view);
+ case ActionLocalPreconditionEditPart.VISUAL_ID:
+ return getActionLocalPrecondition_4001Text(view);
+ case ActionLocalPostconditionEditPart.VISUAL_ID:
+ return getActionLocalPostcondition_4002Text(view);
+ case ObjectFlowSelectionEditPart.VISUAL_ID:
+ return getObjectFlowSelection_4005Text(view);
+ case ObjectFlowTransformationEditPart.VISUAL_ID:
+ return getObjectFlowTransformation_4006Text(view);
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getObjectFlow_4003Text(view);
+ case ControlFlowEditPart.VISUAL_ID:
+ return getControlFlow_4004Text(view);
}
return getUnknownElementText(view);
}
@@ -227,7 +391,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
* @generated
*/
private String getConstraint_3002Text(View view) {
- IParser parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3002, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID));
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3002, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ConstraintInActivityAsPrecondEditPart.VISUAL_ID));
if(parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
@@ -240,7 +404,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
* @generated
*/
private String getConstraint_3003Text(View view) {
- IParser parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3003, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(Constraint2EditPart.VISUAL_ID));
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3003, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ConstraintInActivityAsPostcondEditPart.VISUAL_ID));
if(parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
@@ -291,6 +455,346 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
/**
* @generated
*/
+ private String getOpaqueAction_3007Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.OpaqueAction_3007, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(OpaqueActionNameEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5003); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getValuePin_3015Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.ValuePin_3015, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ValuePinInOActLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5011); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getActionInputPin_3016Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.ActionInputPin_3016, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ActionInputPinInOActLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5012); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getInputPin_3013Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.InputPin_3013, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(InputPinInOActLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5009); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getOutputPin_3014Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.OutputPin_3014, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(OutputPinInOActLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5010); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getCallBehaviorAction_3008Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.CallBehaviorAction_3008, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(CallBehaviorActionNameEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5004); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getValuePin_3017Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.ValuePin_3017, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ValuePinInCBActLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5013); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getActionInputPin_3018Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.ActionInputPin_3018, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ActionInputPinInCBActLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5014); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getInputPin_3019Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.InputPin_3019, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(InputPinInCBActLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5015); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getOutputPin_3020Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.OutputPin_3020, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(OutputPinInCBActLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5016); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getCallOperationAction_3010Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.CallOperationAction_3010, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(CallOperationActionNameEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5006); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getActionInputPin_3021Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.ActionInputPin_3021, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ActionInputPinInCOActLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5017); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getValuePin_3022Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.ValuePin_3022, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ValuePinInCOActLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5018); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getInputPin_3023Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.InputPin_3023, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(InputPinInCOActLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5019); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getOutputPin_3024Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.OutputPin_3024, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(OutputPinInCOActLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5020); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getValuePin_3025Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.ValuePin_3025, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ValuePinInCOActAsTargetLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5021); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getActionInputPin_3026Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.ActionInputPin_3026, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ActionInputPinInCOActAsTargetLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5022); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getInputPin_3027Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.InputPin_3027, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(InputPinInCOActAsTargetLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5023); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getConstraint_3011Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3011, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ConstraintAsLocalPrecondNameEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5007); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getConstraint_3012Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3012, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ConstraintAsLocalPostcondNameEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5008); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getActivity_3028Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.Activity_3028, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ActivityAsSelectionNameEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5032); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getActivity_3029Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.Activity_3029, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ActivityAsTransformationNameEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5033); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getActionLocalPrecondition_4001Text(View view) {
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ private String getActionLocalPostcondition_4002Text(View view) {
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ private String getObjectFlowSelection_4005Text(View view) {
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ private String getObjectFlowTransformation_4006Text(View view) {
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ private String getObjectFlow_4003Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.ObjectFlow_4003, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ObjectFlowNameEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 6001); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getControlFlow_4004Text(View view) {
+ IParser parser = UMLParserProvider.getParser(UMLElementTypes.ControlFlow_4004, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ControlFlowNameEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 6003); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
private String getUnknownElementText(View view) {
return "<UnknownElement Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/Messages.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/Messages.java
index f527c6195e6..a4daa1286c6 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/Messages.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/Messages.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2009 Atos Origin.
+ * Copyright (c) 2010 Atos Origin.
*
*
* All rights reserved. This program and the accompanying materials
@@ -13,6 +13,7 @@
*****************************************************************************/
package org.eclipse.papyrus.diagram.activity.part;
+
import org.eclipse.osgi.util.NLS;
/**
@@ -33,6 +34,93 @@ public class Messages extends NLS {
private Messages() {
}
+
+
+ /**
+ * @generated NOT
+ */
+ public static String PinAndParameterSynchronizer_UnauthorizedModificationTitle;
+
+ /**
+ * @generated NOT
+ */
+ public static String PinAndParameterSynchronizer_UnauthorizedModificationRedirection;
+
+ /**
+ * @generated NOT
+ */
+ public static String ConfirmPinAndParameterSync_Title;
+
+ /**
+ * @generated NOT
+ */
+ public static String ConfirmPinAndParameterSync_FromParameterMsg;
+
+ /**
+ * @generated NOT
+ */
+ public static String CreateCallActionDialog_OperationTitle;
+
+ /**
+ * @generated NOT
+ */
+ public static String CreateCallActionDialog_SelectOperation;
+
+ /**
+ * @generated NOT
+ */
+ public static String CreateCallActionDialog_CreateOperation;
+
+ /**
+ * @generated NOT
+ */
+ public static String CreateCallActionDialog_BehaviorTitle;
+
+ /**
+ * @generated NOT
+ */
+ public static String CreateCallActionDialog_SelectBehavior;
+
+ /**
+ * @generated NOT
+ */
+ public static String CreateCallActionDialog_CreateBehavior;
+
+ /**
+ * @generated NOT
+ */
+ public static String CreateCallActionDialog_ParentLabel;
+
+ /**
+ * @generated NOT
+ */
+ public static String CreateCallActionDialog_NameLabel;
+
+ /**
+ * @generated NOT
+ */
+ public static String CreateCallActionDialog_TypeLabel;
+
+ /**
+ * @generated NOT
+ */
+ public static String CreateCallActionDialog_IsSynchronousTitle;
+
+ /**
+ * @generated NOT
+ */
+ public static String CreateCallActionDialog_IsSynchronous;
+
+ /**
+ * @generated NOT
+ */
+ public static String CreateCallActionDialog_OperationInvocationTitle;
+
+ /**
+ * @generated NOT
+ */
+ public static String CreateCallActionDialog_BehaviorInvocationTitle;
+
/**
* @generated
*/
@@ -261,6 +349,31 @@ public class Messages extends NLS {
/**
* @generated
*/
+ public static String Actions2Group_title;
+
+ /**
+ * @generated
+ */
+ public static String Pins3Group_title;
+
+ /**
+ * @generated
+ */
+ public static String Edges4Group_title;
+
+ /**
+ * @generated
+ */
+ public static String ActionsLocalConditions5Group_title;
+
+ /**
+ * @generated
+ */
+ public static String ObjectFlowsSpecifications6Group_title;
+
+ /**
+ * @generated
+ */
public static String Initialnode1CreationTool_title;
/**
@@ -291,6 +404,136 @@ public class Messages extends NLS {
/**
* @generated
*/
+ public static String OpaqueAction1CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String OpaqueAction1CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String CallBehaviorAction2CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String CallBehaviorAction2CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String CallOperationAction3CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String CallOperationAction3CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String OutputPin1CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String OutputPin1CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String InputPin2CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String InputPin2CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String ActionInputPin3CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String ActionInputPin3CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String ValuePin4CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String ValuePin4CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String ControlFlow1CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String ControlFlow1CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String ObjectFlow2CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String ObjectFlow2CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String LocalPreconditionConstraint1CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String LocalPreconditionConstraint1CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String LocalPostconditionConstraint6CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String LocalPostconditionConstraint6CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String SelectionBehavior1CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String SelectionBehavior1CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String TransformationBehavior2CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String TransformationBehavior2CreationTool_desc;
+
+ /**
+ * @generated
+ */
public static String ActivityActivityParametersCompartmentEditPart_title;
/**
@@ -308,6 +551,7 @@ public class Messages extends NLS {
*/
public static String ActivityActivityContentCompartmentEditPart_title;
+
/**
* @generated
*/
@@ -316,6 +560,306 @@ public class Messages extends NLS {
/**
* @generated
*/
+ public static String NavigatorGroupName_Package_1000_links;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Activity_2001_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Constraint_3002_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Constraint_3003_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InitialNode_3004_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InitialNode_3004_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ActivityFinalNode_3005_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ActivityFinalNode_3005_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_FlowFinalNode_3006_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_FlowFinalNode_3006_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_OpaqueAction_3007_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_OpaqueAction_3007_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ValuePin_3015_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ValuePin_3015_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ActionInputPin_3016_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ActionInputPin_3016_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InputPin_3013_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InputPin_3013_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_OutputPin_3014_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_OutputPin_3014_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_CallBehaviorAction_3008_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_CallBehaviorAction_3008_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ValuePin_3017_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ValuePin_3017_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ActionInputPin_3018_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ActionInputPin_3018_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InputPin_3019_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InputPin_3019_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_OutputPin_3020_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_OutputPin_3020_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_CallOperationAction_3010_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_CallOperationAction_3010_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ActionInputPin_3021_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ActionInputPin_3021_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ValuePin_3022_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ValuePin_3022_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InputPin_3023_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InputPin_3023_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_OutputPin_3024_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_OutputPin_3024_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ValuePin_3025_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ValuePin_3025_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ActionInputPin_3026_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ActionInputPin_3026_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InputPin_3027_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InputPin_3027_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Constraint_3011_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Constraint_3012_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Activity_3028_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Activity_3029_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ActionLocalPrecondition_4001_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ActionLocalPrecondition_4001_source;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ActionLocalPostcondition_4002_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ActionLocalPostcondition_4002_source;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ObjectFlowSelection_4005_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ObjectFlowTransformation_4006_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ObjectFlow_4003_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ObjectFlow_4003_source;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ControlFlow_4004_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ControlFlow_4004_source;
+
+ /**
+ * @generated
+ */
public static String NavigatorActionProvider_OpenDiagramActionName;
/**
@@ -333,6 +877,7 @@ public class Messages extends NLS {
*/
public static String AbstractParser_UnknownLiteral;
+
/**
* @generated
*/
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/UMLDiagramUpdater.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/UMLDiagramUpdater.java
index 49e5824e981..a2a5f21d917 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/UMLDiagramUpdater.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/UMLDiagramUpdater.java
@@ -13,30 +13,79 @@
*****************************************************************************/
package org.eclipse.papyrus.diagram.activity.part;
+import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPostconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPreconditionEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityContentCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityParametersCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityPostConditionsCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityPreConditionsCompartmentEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsTransformationEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityDiagramEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityFinalNodeEditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.Constraint2EditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.FlowFinalNodeEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.InitialNodeEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowTransformationEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOpaqueActEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ParameterEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.Action;
+import org.eclipse.uml2.uml.ActionInputPin;
import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.ActivityFinalNode;
import org.eclipse.uml2.uml.ActivityNode;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.CallBehaviorAction;
+import org.eclipse.uml2.uml.CallOperationAction;
import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.ControlFlow;
+import org.eclipse.uml2.uml.FlowFinalNode;
+import org.eclipse.uml2.uml.InitialNode;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.ObjectFlow;
+import org.eclipse.uml2.uml.OpaqueAction;
+import org.eclipse.uml2.uml.OutputPin;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.PackageableElement;
import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.ValuePin;
/**
* @generated
@@ -48,6 +97,12 @@ public class UMLDiagramUpdater {
*/
public static List getSemanticChildren(View view) {
switch(UMLVisualIDRegistry.getVisualID(view)) {
+ case OpaqueActionEditPart.VISUAL_ID:
+ return getOpaqueAction_3007SemanticChildren(view);
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ return getCallBehaviorAction_3008SemanticChildren(view);
+ case CallOperationActionEditPart.VISUAL_ID:
+ return getCallOperationAction_3010SemanticChildren(view);
case ActivityActivityParametersCompartmentEditPart.VISUAL_ID:
return getActivityActivityParametersCompartment_7001SemanticChildren(view);
case ActivityActivityPreConditionsCompartmentEditPart.VISUAL_ID:
@@ -65,6 +120,127 @@ public class UMLDiagramUpdater {
/**
* @generated
*/
+ public static List getOpaqueAction_3007SemanticChildren(View view) {
+ if(!view.isSetElement()) {
+ return Collections.EMPTY_LIST;
+ }
+ OpaqueAction modelElement = (OpaqueAction)view.getElement();
+ List result = new LinkedList();
+ for(Iterator it = modelElement.getInputValues().iterator(); it.hasNext();) {
+ InputPin childElement = (InputPin)it.next();
+ int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
+ if(visualID == ValuePinInOpaqueActEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ if(visualID == ActionInputPinInOpaqueActEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ if(visualID == InputPinInOpaqueActEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
+ for(Iterator it = modelElement.getOutputValues().iterator(); it.hasNext();) {
+ OutputPin childElement = (OutputPin)it.next();
+ int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
+ if(visualID == OutputPinInOpaqueActEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getCallBehaviorAction_3008SemanticChildren(View view) {
+ if(!view.isSetElement()) {
+ return Collections.EMPTY_LIST;
+ }
+ CallBehaviorAction modelElement = (CallBehaviorAction)view.getElement();
+ List result = new LinkedList();
+ for(Iterator it = modelElement.getArguments().iterator(); it.hasNext();) {
+ InputPin childElement = (InputPin)it.next();
+ int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
+ if(visualID == ValuePinInCallBeActEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ if(visualID == ActionInputPinInCallBeActEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ if(visualID == InputPinInCallBeActEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
+ for(Iterator it = modelElement.getResults().iterator(); it.hasNext();) {
+ OutputPin childElement = (OutputPin)it.next();
+ int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
+ if(visualID == OutputPinInCallBeActEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getCallOperationAction_3010SemanticChildren(View view) {
+ if(!view.isSetElement()) {
+ return Collections.EMPTY_LIST;
+ }
+ CallOperationAction modelElement = (CallOperationAction)view.getElement();
+ List result = new LinkedList();
+ for(Iterator it = modelElement.getArguments().iterator(); it.hasNext();) {
+ InputPin childElement = (InputPin)it.next();
+ int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
+ if(visualID == ActionInputPinInCallOpActEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ if(visualID == ValuePinInCallOpActEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ if(visualID == InputPinInCallOpActEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
+ for(Iterator it = modelElement.getResults().iterator(); it.hasNext();) {
+ OutputPin childElement = (OutputPin)it.next();
+ int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
+ if(visualID == OutputPinInCallOpActEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
+ {
+ InputPin childElement = modelElement.getTarget();
+ int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
+ if(visualID == ValuePinInCallOpActAsTargetEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ }
+ if(visualID == ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ }
+ if(visualID == InputPinInCallOpActAsTargetEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
public static List getActivityActivityParametersCompartment_7001SemanticChildren(View view) {
if(false == view.eContainer() instanceof View) {
return Collections.EMPTY_LIST;
@@ -102,7 +278,7 @@ public class UMLDiagramUpdater {
for(Iterator it = modelElement.getPreconditions().iterator(); it.hasNext();) {
Constraint childElement = (Constraint)it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ConstraintEditPart.VISUAL_ID) {
+ if(visualID == ConstraintInActivityAsPrecondEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -126,7 +302,7 @@ public class UMLDiagramUpdater {
for(Iterator it = modelElement.getPostconditions().iterator(); it.hasNext();) {
Constraint childElement = (Constraint)it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == Constraint2EditPart.VISUAL_ID) {
+ if(visualID == ConstraintInActivityAsPostcondEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -135,7 +311,7 @@ public class UMLDiagramUpdater {
}
/**
- * @generated
+ * @generated NOT (add children actions' local conditions and object flows' specification)
*/
public static List getActivityActivityContentCompartment_7004SemanticChildren(View view) {
if(false == view.eContainer() instanceof View) {
@@ -149,6 +325,14 @@ public class UMLDiagramUpdater {
List result = new LinkedList();
for(Iterator it = modelElement.getNodes().iterator(); it.hasNext();) {
ActivityNode childElement = (ActivityNode)it.next();
+ //add children actions' local conditions
+ if(childElement instanceof Action) {
+ result.addAll(getActionLocalConditionsDescriptors((Action)childElement, view));
+ }
+ //add children objectflows' specification
+ if(childElement instanceof ObjectFlow) {
+ result.addAll(getObjectFlowSpecificationDescriptors((ObjectFlow)childElement, view));
+ }
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
if(visualID == InitialNodeEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
@@ -162,6 +346,94 @@ public class UMLDiagramUpdater {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
+ if(visualID == OpaqueActionEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ if(visualID == CallBehaviorActionEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ if(visualID == CallOperationActionEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Get the node descriptors corresponding to transformation and selection of an Object Flow.
+ * These nodes are children of ActivityContentCompartment_7004.
+ *
+ * @param objectFlowElement
+ * the object flow being specified
+ * @param parentView
+ * the parent activity content compartment view
+ * @return the list of semantic children (node descriptors)
+ * @generated NOT
+ */
+ private static List<UMLNodeDescriptor> getObjectFlowSpecificationDescriptors(ObjectFlow objectFlowElement, View parentView) {
+ /*
+ * Called above by customized code (instead of generated code with errors) :
+ * //add children actions' local conditions
+ * if(childElement instanceof Action) {
+ * result.addAll(getActionLocalConditionsDescriptors((Action)childElement, view));
+ * }
+ */
+ List<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
+ Behavior childElement = objectFlowElement.getSelection();
+ if(childElement != null) {
+ int visualID = UMLVisualIDRegistry.getNodeVisualID(parentView, childElement);
+ // there is no way to distinguish VISUAL_ID of a selection from a transformation, since the element can be both at the same time
+ if(ActivityAsSelectionEditPart.VISUAL_ID == visualID || ActivityAsTransformationEditPart.VISUAL_ID == visualID) {
+ result.add(new UMLNodeDescriptor(childElement, ActivityAsSelectionEditPart.VISUAL_ID));
+ }
+ }
+ childElement = objectFlowElement.getTransformation();
+ if(childElement != null) {
+ int visualID = UMLVisualIDRegistry.getNodeVisualID(parentView, childElement);
+ // there is no way to distinguish VISUAL_ID of a selection from a transformation, since the element can be both at the same time
+ if(ActivityAsSelectionEditPart.VISUAL_ID == visualID || ActivityAsTransformationEditPart.VISUAL_ID == visualID) {
+ result.add(new UMLNodeDescriptor(childElement, ActivityAsTransformationEditPart.VISUAL_ID));
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Get the node descriptors corresponding to local pre and post conditions of an action.
+ * These nodes are children of ActivityContentCompartment_7004.
+ *
+ * @param actionElement
+ * the action containing conditions
+ * @param parentView
+ * the parent activity content compartment view
+ * @return the list of semantic children (node descriptors)
+ * @generated NOT
+ */
+ private static List<UMLNodeDescriptor> getActionLocalConditionsDescriptors(Action actionElement, View parentView) {
+ /*
+ * Called above by customized code (instead of generated code with errors) :
+ * //add children actions' local conditions
+ * if(childElement instanceof Action) {
+ * result.addAll(getActionLocalConditionsDescriptors((Action)childElement, view));
+ * }
+ */
+ List<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
+ for(Constraint childElement : actionElement.getLocalPreconditions()) {
+ int visualID = UMLVisualIDRegistry.getNodeVisualID(parentView, childElement);
+ if(visualID == ConstraintAsLocalPrecondEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
+ for(Constraint childElement : actionElement.getLocalPostconditions()) {
+ int visualID = UMLVisualIDRegistry.getNodeVisualID(parentView, childElement);
+ if(visualID == ConstraintAsLocalPostcondEditPart.VISUAL_ID) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
}
return result;
}
@@ -197,9 +469,9 @@ public class UMLDiagramUpdater {
return getActivity_2001ContainedLinks(view);
case ParameterEditPart.VISUAL_ID:
return getParameter_3001ContainedLinks(view);
- case ConstraintEditPart.VISUAL_ID:
+ case ConstraintInActivityAsPrecondEditPart.VISUAL_ID:
return getConstraint_3002ContainedLinks(view);
- case Constraint2EditPart.VISUAL_ID:
+ case ConstraintInActivityAsPostcondEditPart.VISUAL_ID:
return getConstraint_3003ContainedLinks(view);
case InitialNodeEditPart.VISUAL_ID:
return getInitialNode_3004ContainedLinks(view);
@@ -207,6 +479,54 @@ public class UMLDiagramUpdater {
return getActivityFinalNode_3005ContainedLinks(view);
case FlowFinalNodeEditPart.VISUAL_ID:
return getFlowFinalNode_3006ContainedLinks(view);
+ case OpaqueActionEditPart.VISUAL_ID:
+ return getOpaqueAction_3007ContainedLinks(view);
+ case ValuePinInOpaqueActEditPart.VISUAL_ID:
+ return getValuePin_3015ContainedLinks(view);
+ case ActionInputPinInOpaqueActEditPart.VISUAL_ID:
+ return getActionInputPin_3016ContainedLinks(view);
+ case InputPinInOpaqueActEditPart.VISUAL_ID:
+ return getInputPin_3013ContainedLinks(view);
+ case OutputPinInOpaqueActEditPart.VISUAL_ID:
+ return getOutputPin_3014ContainedLinks(view);
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ return getCallBehaviorAction_3008ContainedLinks(view);
+ case ValuePinInCallBeActEditPart.VISUAL_ID:
+ return getValuePin_3017ContainedLinks(view);
+ case ActionInputPinInCallBeActEditPart.VISUAL_ID:
+ return getActionInputPin_3018ContainedLinks(view);
+ case InputPinInCallBeActEditPart.VISUAL_ID:
+ return getInputPin_3019ContainedLinks(view);
+ case OutputPinInCallBeActEditPart.VISUAL_ID:
+ return getOutputPin_3020ContainedLinks(view);
+ case CallOperationActionEditPart.VISUAL_ID:
+ return getCallOperationAction_3010ContainedLinks(view);
+ case ActionInputPinInCallOpActEditPart.VISUAL_ID:
+ return getActionInputPin_3021ContainedLinks(view);
+ case ValuePinInCallOpActEditPart.VISUAL_ID:
+ return getValuePin_3022ContainedLinks(view);
+ case InputPinInCallOpActEditPart.VISUAL_ID:
+ return getInputPin_3023ContainedLinks(view);
+ case OutputPinInCallOpActEditPart.VISUAL_ID:
+ return getOutputPin_3024ContainedLinks(view);
+ case ValuePinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return getValuePin_3025ContainedLinks(view);
+ case ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return getActionInputPin_3026ContainedLinks(view);
+ case InputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return getInputPin_3027ContainedLinks(view);
+ case ConstraintAsLocalPrecondEditPart.VISUAL_ID:
+ return getConstraint_3011ContainedLinks(view);
+ case ConstraintAsLocalPostcondEditPart.VISUAL_ID:
+ return getConstraint_3012ContainedLinks(view);
+ case ActivityAsSelectionEditPart.VISUAL_ID:
+ return getActivity_3028ContainedLinks(view);
+ case ActivityAsTransformationEditPart.VISUAL_ID:
+ return getActivity_3029ContainedLinks(view);
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getObjectFlow_4003ContainedLinks(view);
+ case ControlFlowEditPart.VISUAL_ID:
+ return getControlFlow_4004ContainedLinks(view);
}
return Collections.EMPTY_LIST;
}
@@ -220,9 +540,9 @@ public class UMLDiagramUpdater {
return getActivity_2001IncomingLinks(view);
case ParameterEditPart.VISUAL_ID:
return getParameter_3001IncomingLinks(view);
- case ConstraintEditPart.VISUAL_ID:
+ case ConstraintInActivityAsPrecondEditPart.VISUAL_ID:
return getConstraint_3002IncomingLinks(view);
- case Constraint2EditPart.VISUAL_ID:
+ case ConstraintInActivityAsPostcondEditPart.VISUAL_ID:
return getConstraint_3003IncomingLinks(view);
case InitialNodeEditPart.VISUAL_ID:
return getInitialNode_3004IncomingLinks(view);
@@ -230,6 +550,54 @@ public class UMLDiagramUpdater {
return getActivityFinalNode_3005IncomingLinks(view);
case FlowFinalNodeEditPart.VISUAL_ID:
return getFlowFinalNode_3006IncomingLinks(view);
+ case OpaqueActionEditPart.VISUAL_ID:
+ return getOpaqueAction_3007IncomingLinks(view);
+ case ValuePinInOpaqueActEditPart.VISUAL_ID:
+ return getValuePin_3015IncomingLinks(view);
+ case ActionInputPinInOpaqueActEditPart.VISUAL_ID:
+ return getActionInputPin_3016IncomingLinks(view);
+ case InputPinInOpaqueActEditPart.VISUAL_ID:
+ return getInputPin_3013IncomingLinks(view);
+ case OutputPinInOpaqueActEditPart.VISUAL_ID:
+ return getOutputPin_3014IncomingLinks(view);
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ return getCallBehaviorAction_3008IncomingLinks(view);
+ case ValuePinInCallBeActEditPart.VISUAL_ID:
+ return getValuePin_3017IncomingLinks(view);
+ case ActionInputPinInCallBeActEditPart.VISUAL_ID:
+ return getActionInputPin_3018IncomingLinks(view);
+ case InputPinInCallBeActEditPart.VISUAL_ID:
+ return getInputPin_3019IncomingLinks(view);
+ case OutputPinInCallBeActEditPart.VISUAL_ID:
+ return getOutputPin_3020IncomingLinks(view);
+ case CallOperationActionEditPart.VISUAL_ID:
+ return getCallOperationAction_3010IncomingLinks(view);
+ case ActionInputPinInCallOpActEditPart.VISUAL_ID:
+ return getActionInputPin_3021IncomingLinks(view);
+ case ValuePinInCallOpActEditPart.VISUAL_ID:
+ return getValuePin_3022IncomingLinks(view);
+ case InputPinInCallOpActEditPart.VISUAL_ID:
+ return getInputPin_3023IncomingLinks(view);
+ case OutputPinInCallOpActEditPart.VISUAL_ID:
+ return getOutputPin_3024IncomingLinks(view);
+ case ValuePinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return getValuePin_3025IncomingLinks(view);
+ case ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return getActionInputPin_3026IncomingLinks(view);
+ case InputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return getInputPin_3027IncomingLinks(view);
+ case ConstraintAsLocalPrecondEditPart.VISUAL_ID:
+ return getConstraint_3011IncomingLinks(view);
+ case ConstraintAsLocalPostcondEditPart.VISUAL_ID:
+ return getConstraint_3012IncomingLinks(view);
+ case ActivityAsSelectionEditPart.VISUAL_ID:
+ return getActivity_3028IncomingLinks(view);
+ case ActivityAsTransformationEditPart.VISUAL_ID:
+ return getActivity_3029IncomingLinks(view);
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getObjectFlow_4003IncomingLinks(view);
+ case ControlFlowEditPart.VISUAL_ID:
+ return getControlFlow_4004IncomingLinks(view);
}
return Collections.EMPTY_LIST;
}
@@ -243,9 +611,9 @@ public class UMLDiagramUpdater {
return getActivity_2001OutgoingLinks(view);
case ParameterEditPart.VISUAL_ID:
return getParameter_3001OutgoingLinks(view);
- case ConstraintEditPart.VISUAL_ID:
+ case ConstraintInActivityAsPrecondEditPart.VISUAL_ID:
return getConstraint_3002OutgoingLinks(view);
- case Constraint2EditPart.VISUAL_ID:
+ case ConstraintInActivityAsPostcondEditPart.VISUAL_ID:
return getConstraint_3003OutgoingLinks(view);
case InitialNodeEditPart.VISUAL_ID:
return getInitialNode_3004OutgoingLinks(view);
@@ -253,6 +621,54 @@ public class UMLDiagramUpdater {
return getActivityFinalNode_3005OutgoingLinks(view);
case FlowFinalNodeEditPart.VISUAL_ID:
return getFlowFinalNode_3006OutgoingLinks(view);
+ case OpaqueActionEditPart.VISUAL_ID:
+ return getOpaqueAction_3007OutgoingLinks(view);
+ case ValuePinInOpaqueActEditPart.VISUAL_ID:
+ return getValuePin_3015OutgoingLinks(view);
+ case ActionInputPinInOpaqueActEditPart.VISUAL_ID:
+ return getActionInputPin_3016OutgoingLinks(view);
+ case InputPinInOpaqueActEditPart.VISUAL_ID:
+ return getInputPin_3013OutgoingLinks(view);
+ case OutputPinInOpaqueActEditPart.VISUAL_ID:
+ return getOutputPin_3014OutgoingLinks(view);
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ return getCallBehaviorAction_3008OutgoingLinks(view);
+ case ValuePinInCallBeActEditPart.VISUAL_ID:
+ return getValuePin_3017OutgoingLinks(view);
+ case ActionInputPinInCallBeActEditPart.VISUAL_ID:
+ return getActionInputPin_3018OutgoingLinks(view);
+ case InputPinInCallBeActEditPart.VISUAL_ID:
+ return getInputPin_3019OutgoingLinks(view);
+ case OutputPinInCallBeActEditPart.VISUAL_ID:
+ return getOutputPin_3020OutgoingLinks(view);
+ case CallOperationActionEditPart.VISUAL_ID:
+ return getCallOperationAction_3010OutgoingLinks(view);
+ case ActionInputPinInCallOpActEditPart.VISUAL_ID:
+ return getActionInputPin_3021OutgoingLinks(view);
+ case ValuePinInCallOpActEditPart.VISUAL_ID:
+ return getValuePin_3022OutgoingLinks(view);
+ case InputPinInCallOpActEditPart.VISUAL_ID:
+ return getInputPin_3023OutgoingLinks(view);
+ case OutputPinInCallOpActEditPart.VISUAL_ID:
+ return getOutputPin_3024OutgoingLinks(view);
+ case ValuePinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return getValuePin_3025OutgoingLinks(view);
+ case ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return getActionInputPin_3026OutgoingLinks(view);
+ case InputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return getInputPin_3027OutgoingLinks(view);
+ case ConstraintAsLocalPrecondEditPart.VISUAL_ID:
+ return getConstraint_3011OutgoingLinks(view);
+ case ConstraintAsLocalPostcondEditPart.VISUAL_ID:
+ return getConstraint_3012OutgoingLinks(view);
+ case ActivityAsSelectionEditPart.VISUAL_ID:
+ return getActivity_3028OutgoingLinks(view);
+ case ActivityAsTransformationEditPart.VISUAL_ID:
+ return getActivity_3029OutgoingLinks(view);
+ case ObjectFlowEditPart.VISUAL_ID:
+ return getObjectFlow_4003OutgoingLinks(view);
+ case ControlFlowEditPart.VISUAL_ID:
+ return getControlFlow_4004OutgoingLinks(view);
}
return Collections.EMPTY_LIST;
}
@@ -268,7 +684,11 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List getActivity_2001ContainedLinks(View view) {
- return Collections.EMPTY_LIST;
+ Activity modelElement = (Activity)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getContainedTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getContainedTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
}
/**
@@ -316,13 +736,210 @@ public class UMLDiagramUpdater {
/**
* @generated
*/
- public static List getActivity_2001IncomingLinks(View view) {
+ public static List getOpaqueAction_3007ContainedLinks(View view) {
+ OpaqueAction modelElement = (OpaqueAction)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingFeatureModelFacetLinks_Action_LocalPrecondition_4001(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Action_LocalPostcondition_4002(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getValuePin_3015ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActionInputPin_3016ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getInputPin_3013ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getOutputPin_3014ContainedLinks(View view) {
return Collections.EMPTY_LIST;
}
/**
* @generated
*/
+ public static List getCallBehaviorAction_3008ContainedLinks(View view) {
+ CallBehaviorAction modelElement = (CallBehaviorAction)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingFeatureModelFacetLinks_Action_LocalPrecondition_4001(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Action_LocalPostcondition_4002(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getValuePin_3017ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActionInputPin_3018ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getInputPin_3019ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getOutputPin_3020ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getCallOperationAction_3010ContainedLinks(View view) {
+ CallOperationAction modelElement = (CallOperationAction)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingFeatureModelFacetLinks_Action_LocalPrecondition_4001(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Action_LocalPostcondition_4002(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActionInputPin_3021ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getValuePin_3022ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getInputPin_3023ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getOutputPin_3024ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getValuePin_3025ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActionInputPin_3026ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getInputPin_3027ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getConstraint_3011ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getConstraint_3012ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActivity_3028ContainedLinks(View view) {
+ Activity modelElement = (Activity)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getContainedTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getContainedTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActivity_3029ContainedLinks(View view) {
+ Activity modelElement = (Activity)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getContainedTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getContainedTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getObjectFlow_4003ContainedLinks(View view) {
+ ObjectFlow modelElement = (ObjectFlow)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingFeatureModelFacetLinks_ObjectFlow_Selection_4005(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_ObjectFlow_Transformation_4006(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getControlFlow_4004ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActivity_2001IncomingLinks(View view) {
+ Activity modelElement = (Activity)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingFeatureModelFacetLinks_ObjectFlow_Selection_4005(modelElement, crossReferences));
+ result.addAll(getIncomingFeatureModelFacetLinks_ObjectFlow_Transformation_4006(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
public static List getParameter_3001IncomingLinks(View view) {
return Collections.EMPTY_LIST;
}
@@ -345,20 +962,313 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List getInitialNode_3004IncomingLinks(View view) {
- return Collections.EMPTY_LIST;
+ InitialNode modelElement = (InitialNode)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
}
/**
* @generated
*/
public static List getActivityFinalNode_3005IncomingLinks(View view) {
- return Collections.EMPTY_LIST;
+ ActivityFinalNode modelElement = (ActivityFinalNode)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
}
/**
* @generated
*/
public static List getFlowFinalNode_3006IncomingLinks(View view) {
+ FlowFinalNode modelElement = (FlowFinalNode)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getOpaqueAction_3007IncomingLinks(View view) {
+ OpaqueAction modelElement = (OpaqueAction)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getValuePin_3015IncomingLinks(View view) {
+ ValuePin modelElement = (ValuePin)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActionInputPin_3016IncomingLinks(View view) {
+ ActionInputPin modelElement = (ActionInputPin)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getInputPin_3013IncomingLinks(View view) {
+ InputPin modelElement = (InputPin)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getOutputPin_3014IncomingLinks(View view) {
+ OutputPin modelElement = (OutputPin)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getCallBehaviorAction_3008IncomingLinks(View view) {
+ CallBehaviorAction modelElement = (CallBehaviorAction)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getValuePin_3017IncomingLinks(View view) {
+ ValuePin modelElement = (ValuePin)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActionInputPin_3018IncomingLinks(View view) {
+ ActionInputPin modelElement = (ActionInputPin)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getInputPin_3019IncomingLinks(View view) {
+ InputPin modelElement = (InputPin)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getOutputPin_3020IncomingLinks(View view) {
+ OutputPin modelElement = (OutputPin)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getCallOperationAction_3010IncomingLinks(View view) {
+ CallOperationAction modelElement = (CallOperationAction)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActionInputPin_3021IncomingLinks(View view) {
+ ActionInputPin modelElement = (ActionInputPin)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getValuePin_3022IncomingLinks(View view) {
+ ValuePin modelElement = (ValuePin)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getInputPin_3023IncomingLinks(View view) {
+ InputPin modelElement = (InputPin)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getOutputPin_3024IncomingLinks(View view) {
+ OutputPin modelElement = (OutputPin)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getValuePin_3025IncomingLinks(View view) {
+ ValuePin modelElement = (ValuePin)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActionInputPin_3026IncomingLinks(View view) {
+ ActionInputPin modelElement = (ActionInputPin)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getInputPin_3027IncomingLinks(View view) {
+ InputPin modelElement = (InputPin)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingTypeModelFacetLinks_ObjectFlow_4003(modelElement, crossReferences));
+ result.addAll(getIncomingTypeModelFacetLinks_ControlFlow_4004(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getConstraint_3011IncomingLinks(View view) {
+ Constraint modelElement = (Constraint)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingFeatureModelFacetLinks_Action_LocalPrecondition_4001(modelElement, crossReferences));
+ result.addAll(getIncomingFeatureModelFacetLinks_Action_LocalPostcondition_4002(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getConstraint_3012IncomingLinks(View view) {
+ Constraint modelElement = (Constraint)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingFeatureModelFacetLinks_Action_LocalPrecondition_4001(modelElement, crossReferences));
+ result.addAll(getIncomingFeatureModelFacetLinks_Action_LocalPostcondition_4002(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActivity_3028IncomingLinks(View view) {
+ Activity modelElement = (Activity)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingFeatureModelFacetLinks_ObjectFlow_Selection_4005(modelElement, crossReferences));
+ result.addAll(getIncomingFeatureModelFacetLinks_ObjectFlow_Transformation_4006(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActivity_3029IncomingLinks(View view) {
+ Activity modelElement = (Activity)view.getElement();
+ Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
+ List result = new LinkedList();
+ result.addAll(getIncomingFeatureModelFacetLinks_ObjectFlow_Selection_4005(modelElement, crossReferences));
+ result.addAll(getIncomingFeatureModelFacetLinks_ObjectFlow_Transformation_4006(modelElement, crossReferences));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getObjectFlow_4003IncomingLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getControlFlow_4004IncomingLinks(View view) {
return Collections.EMPTY_LIST;
}
@@ -394,21 +1304,577 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List getInitialNode_3004OutgoingLinks(View view) {
- return Collections.EMPTY_LIST;
+ InitialNode modelElement = (InitialNode)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
}
/**
* @generated
*/
public static List getActivityFinalNode_3005OutgoingLinks(View view) {
- return Collections.EMPTY_LIST;
+ ActivityFinalNode modelElement = (ActivityFinalNode)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
}
/**
* @generated
*/
public static List getFlowFinalNode_3006OutgoingLinks(View view) {
+ FlowFinalNode modelElement = (FlowFinalNode)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getOpaqueAction_3007OutgoingLinks(View view) {
+ OpaqueAction modelElement = (OpaqueAction)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingFeatureModelFacetLinks_Action_LocalPrecondition_4001(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Action_LocalPostcondition_4002(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getValuePin_3015OutgoingLinks(View view) {
+ ValuePin modelElement = (ValuePin)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActionInputPin_3016OutgoingLinks(View view) {
+ ActionInputPin modelElement = (ActionInputPin)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getInputPin_3013OutgoingLinks(View view) {
+ InputPin modelElement = (InputPin)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getOutputPin_3014OutgoingLinks(View view) {
+ OutputPin modelElement = (OutputPin)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getCallBehaviorAction_3008OutgoingLinks(View view) {
+ CallBehaviorAction modelElement = (CallBehaviorAction)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingFeatureModelFacetLinks_Action_LocalPrecondition_4001(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Action_LocalPostcondition_4002(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getValuePin_3017OutgoingLinks(View view) {
+ ValuePin modelElement = (ValuePin)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActionInputPin_3018OutgoingLinks(View view) {
+ ActionInputPin modelElement = (ActionInputPin)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getInputPin_3019OutgoingLinks(View view) {
+ InputPin modelElement = (InputPin)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getOutputPin_3020OutgoingLinks(View view) {
+ OutputPin modelElement = (OutputPin)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getCallOperationAction_3010OutgoingLinks(View view) {
+ CallOperationAction modelElement = (CallOperationAction)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingFeatureModelFacetLinks_Action_LocalPrecondition_4001(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Action_LocalPostcondition_4002(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActionInputPin_3021OutgoingLinks(View view) {
+ ActionInputPin modelElement = (ActionInputPin)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getValuePin_3022OutgoingLinks(View view) {
+ ValuePin modelElement = (ValuePin)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getInputPin_3023OutgoingLinks(View view) {
+ InputPin modelElement = (InputPin)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getOutputPin_3024OutgoingLinks(View view) {
+ OutputPin modelElement = (OutputPin)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getValuePin_3025OutgoingLinks(View view) {
+ ValuePin modelElement = (ValuePin)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActionInputPin_3026OutgoingLinks(View view) {
+ ActionInputPin modelElement = (ActionInputPin)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getInputPin_3027OutgoingLinks(View view) {
+ InputPin modelElement = (InputPin)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingTypeModelFacetLinks_ObjectFlow_4003(modelElement));
+ result.addAll(getOutgoingTypeModelFacetLinks_ControlFlow_4004(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getConstraint_3011OutgoingLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getConstraint_3012OutgoingLinks(View view) {
return Collections.EMPTY_LIST;
}
+ /**
+ * @generated
+ */
+ public static List getActivity_3028OutgoingLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getActivity_3029OutgoingLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getObjectFlow_4003OutgoingLinks(View view) {
+ ObjectFlow modelElement = (ObjectFlow)view.getElement();
+ List result = new LinkedList();
+ result.addAll(getOutgoingFeatureModelFacetLinks_ObjectFlow_Selection_4005(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_ObjectFlow_Transformation_4006(modelElement));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getControlFlow_4004OutgoingLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ private static Collection getContainedTypeModelFacetLinks_ObjectFlow_4003(Activity container) {
+ Collection result = new LinkedList();
+ for(Iterator links = container.getEdges().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject)links.next();
+ if(false == linkObject instanceof ObjectFlow) {
+ continue;
+ }
+ ObjectFlow link = (ObjectFlow)linkObject;
+ if(ObjectFlowEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ continue;
+ }
+
+
+
+
+
+ ActivityNode dst = link.getTarget();
+ ActivityNode src = link.getSource();
+ result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.ObjectFlow_4003, ObjectFlowEditPart.VISUAL_ID));
+
+
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private static Collection getContainedTypeModelFacetLinks_ControlFlow_4004(Activity container) {
+ Collection result = new LinkedList();
+ for(Iterator links = container.getEdges().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject)links.next();
+ if(false == linkObject instanceof ControlFlow) {
+ continue;
+ }
+ ControlFlow link = (ControlFlow)linkObject;
+ if(ControlFlowEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ continue;
+ }
+
+
+
+
+
+ ActivityNode dst = link.getTarget();
+ ActivityNode src = link.getSource();
+ result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.ControlFlow_4004, ControlFlowEditPart.VISUAL_ID));
+
+
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private static Collection getIncomingFeatureModelFacetLinks_Action_LocalPrecondition_4001(Constraint target, Map crossReferences) {
+ Collection result = new LinkedList();
+ Collection settings = (Collection)crossReferences.get(target);
+ for(Iterator it = settings.iterator(); it.hasNext();) {
+ EStructuralFeature.Setting setting = (EStructuralFeature.Setting)it.next();
+ if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getAction_LocalPrecondition()) {
+ result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.ActionLocalPrecondition_4001, ActionLocalPreconditionEditPart.VISUAL_ID));
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private static Collection getIncomingFeatureModelFacetLinks_Action_LocalPostcondition_4002(Constraint target, Map crossReferences) {
+ Collection result = new LinkedList();
+ Collection settings = (Collection)crossReferences.get(target);
+ for(Iterator it = settings.iterator(); it.hasNext();) {
+ EStructuralFeature.Setting setting = (EStructuralFeature.Setting)it.next();
+ if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getAction_LocalPostcondition()) {
+ result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.ActionLocalPostcondition_4002, ActionLocalPostconditionEditPart.VISUAL_ID));
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private static Collection getIncomingFeatureModelFacetLinks_ObjectFlow_Selection_4005(Behavior target, Map crossReferences) {
+ Collection result = new LinkedList();
+ Collection settings = (Collection)crossReferences.get(target);
+ for(Iterator it = settings.iterator(); it.hasNext();) {
+ EStructuralFeature.Setting setting = (EStructuralFeature.Setting)it.next();
+ if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getObjectFlow_Selection()) {
+ result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.ObjectFlowSelection_4005, ObjectFlowSelectionEditPart.VISUAL_ID));
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private static Collection getIncomingFeatureModelFacetLinks_ObjectFlow_Transformation_4006(Behavior target, Map crossReferences) {
+ Collection result = new LinkedList();
+ Collection settings = (Collection)crossReferences.get(target);
+ for(Iterator it = settings.iterator(); it.hasNext();) {
+ EStructuralFeature.Setting setting = (EStructuralFeature.Setting)it.next();
+ if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getObjectFlow_Transformation()) {
+ result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.ObjectFlowTransformation_4006, ObjectFlowTransformationEditPart.VISUAL_ID));
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private static Collection getIncomingTypeModelFacetLinks_ObjectFlow_4003(ActivityNode target, Map crossReferences) {
+ Collection result = new LinkedList();
+ Collection settings = (Collection)crossReferences.get(target);
+ for(Iterator it = settings.iterator(); it.hasNext();) {
+ EStructuralFeature.Setting setting = (EStructuralFeature.Setting)it.next();
+ if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getActivityEdge_Target() || false == setting.getEObject() instanceof ObjectFlow) {
+ continue;
+ }
+ ObjectFlow link = (ObjectFlow)setting.getEObject();
+ if(ObjectFlowEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ continue;
+ }
+ ActivityNode src = link.getSource();
+ result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.ObjectFlow_4003, ObjectFlowEditPart.VISUAL_ID));
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private static Collection getIncomingTypeModelFacetLinks_ControlFlow_4004(ActivityNode target, Map crossReferences) {
+ Collection result = new LinkedList();
+ Collection settings = (Collection)crossReferences.get(target);
+ for(Iterator it = settings.iterator(); it.hasNext();) {
+ EStructuralFeature.Setting setting = (EStructuralFeature.Setting)it.next();
+ if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getActivityEdge_Target() || false == setting.getEObject() instanceof ControlFlow) {
+ continue;
+ }
+ ControlFlow link = (ControlFlow)setting.getEObject();
+ if(ControlFlowEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ continue;
+ }
+ ActivityNode src = link.getSource();
+ result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.ControlFlow_4004, ControlFlowEditPart.VISUAL_ID));
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private static Collection getOutgoingFeatureModelFacetLinks_Action_LocalPrecondition_4001(Action source) {
+ Collection result = new LinkedList();
+ for(Iterator destinations = source.getLocalPreconditions().iterator(); destinations.hasNext();) {
+ Constraint destination = (Constraint)destinations.next();
+ result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.ActionLocalPrecondition_4001, ActionLocalPreconditionEditPart.VISUAL_ID));
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private static Collection getOutgoingFeatureModelFacetLinks_Action_LocalPostcondition_4002(Action source) {
+ Collection result = new LinkedList();
+ for(Iterator destinations = source.getLocalPostconditions().iterator(); destinations.hasNext();) {
+ Constraint destination = (Constraint)destinations.next();
+ result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.ActionLocalPostcondition_4002, ActionLocalPostconditionEditPart.VISUAL_ID));
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private static Collection getOutgoingFeatureModelFacetLinks_ObjectFlow_Selection_4005(ObjectFlow source) {
+ Collection result = new LinkedList();
+ Behavior destination = source.getSelection();
+ if(destination == null) {
+ return result;
+ }
+ result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.ObjectFlowSelection_4005, ObjectFlowSelectionEditPart.VISUAL_ID));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private static Collection getOutgoingFeatureModelFacetLinks_ObjectFlow_Transformation_4006(ObjectFlow source) {
+ Collection result = new LinkedList();
+ Behavior destination = source.getTransformation();
+ if(destination == null) {
+ return result;
+ }
+ result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.ObjectFlowTransformation_4006, ObjectFlowTransformationEditPart.VISUAL_ID));
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private static Collection getOutgoingTypeModelFacetLinks_ObjectFlow_4003(ActivityNode source) {
+ Activity container = null;
+ // Find container element for the link.
+ // Climb up by containment hierarchy starting from the source
+ // and return the first element that is instance of the container class.
+ for(EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if(element instanceof Activity) {
+ container = (Activity)element;
+ }
+ }
+ if(container == null) {
+ return Collections.EMPTY_LIST;
+ }
+ Collection result = new LinkedList();
+ for(Iterator links = container.getEdges().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject)links.next();
+ if(false == linkObject instanceof ObjectFlow) {
+ continue;
+ }
+ ObjectFlow link = (ObjectFlow)linkObject;
+ if(ObjectFlowEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ continue;
+ }
+
+
+
+
+
+ ActivityNode dst = link.getTarget();
+ ActivityNode src = link.getSource();
+ if(src != source) {
+ continue;
+ }
+ result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.ObjectFlow_4003, ObjectFlowEditPart.VISUAL_ID));
+
+
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private static Collection getOutgoingTypeModelFacetLinks_ControlFlow_4004(ActivityNode source) {
+ Activity container = null;
+ // Find container element for the link.
+ // Climb up by containment hierarchy starting from the source
+ // and return the first element that is instance of the container class.
+ for(EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if(element instanceof Activity) {
+ container = (Activity)element;
+ }
+ }
+ if(container == null) {
+ return Collections.EMPTY_LIST;
+ }
+ Collection result = new LinkedList();
+ for(Iterator links = container.getEdges().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject)links.next();
+ if(false == linkObject instanceof ControlFlow) {
+ continue;
+ }
+ ControlFlow link = (ControlFlow)linkObject;
+ if(ControlFlowEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ continue;
+ }
+
+
+
+
+
+ ActivityNode dst = link.getTarget();
+ ActivityNode src = link.getSource();
+ if(src != source) {
+ continue;
+ }
+ result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.ControlFlow_4004, ControlFlowEditPart.VISUAL_ID));
+
+
+ }
+ return result;
+ }
+
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/UMLPaletteFactory.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/UMLPaletteFactory.java
index 6663e784eb4..33ba62497fb 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/UMLPaletteFactory.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/UMLPaletteFactory.java
@@ -20,6 +20,7 @@ import org.eclipse.gef.Tool;
import org.eclipse.gmf.runtime.diagram.ui.services.palette.PaletteFactory;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.papyrus.diagram.activity.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.common.service.AspectUnspecifiedTypeConnectionTool;
import org.eclipse.papyrus.diagram.common.service.AspectUnspecifiedTypeCreationTool;
/**
@@ -45,6 +46,71 @@ public class UMLPaletteFactory extends PaletteFactory.Adapter {
/**
* @generated
*/
+ private final static String CREATEOPAQUEACTION1CREATIONTOOL = "createOpaqueAction1CreationTool"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ private final static String CREATECALLBEHAVIORACTION2CREATIONTOOL = "createCallBehaviorAction2CreationTool"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ private final static String CREATECALLOPERATIONACTION3CREATIONTOOL = "createCallOperationAction3CreationTool"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ private final static String CREATEOUTPUTPIN1CREATIONTOOL = "createOutputPin1CreationTool"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ private final static String CREATEINPUTPIN2CREATIONTOOL = "createInputPin2CreationTool"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ private final static String CREATEACTIONINPUTPIN3CREATIONTOOL = "createActionInputPin3CreationTool"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ private final static String CREATEVALUEPIN4CREATIONTOOL = "createValuePin4CreationTool"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ private final static String CREATECONTROLFLOW1CREATIONTOOL = "createControlFlow1CreationTool"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ private final static String CREATEOBJECTFLOW2CREATIONTOOL = "createObjectFlow2CreationTool"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ private final static String CREATELOCALPRECONDITIONCONSTRAINT1CREATIONTOOL = "createLocalPreconditionConstraint1CreationTool"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ private final static String CREATELOCALPOSTCONDITIONCONSTRAINT6CREATIONTOOL = "createLocalPostconditionConstraint6CreationTool"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ private final static String CREATESELECTIONBEHAVIOR1CREATIONTOOL = "createSelectionBehavior1CreationTool"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ private final static String CREATETRANSFORMATIONBEHAVIOR2CREATIONTOOL = "createTransformationBehavior2CreationTool"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
public UMLPaletteFactory() {
}
@@ -62,6 +128,45 @@ public class UMLPaletteFactory extends PaletteFactory.Adapter {
if(toolId.equals(CREATEFLOWFINAL3CREATIONTOOL)) {
return createFlowfinal3CreationTool();
}
+ if(toolId.equals(CREATEOPAQUEACTION1CREATIONTOOL)) {
+ return createOpaqueAction1CreationTool();
+ }
+ if(toolId.equals(CREATECALLBEHAVIORACTION2CREATIONTOOL)) {
+ return createCallBehaviorAction2CreationTool();
+ }
+ if(toolId.equals(CREATECALLOPERATIONACTION3CREATIONTOOL)) {
+ return createCallOperationAction3CreationTool();
+ }
+ if(toolId.equals(CREATEOUTPUTPIN1CREATIONTOOL)) {
+ return createOutputPin1CreationTool();
+ }
+ if(toolId.equals(CREATEINPUTPIN2CREATIONTOOL)) {
+ return createInputPin2CreationTool();
+ }
+ if(toolId.equals(CREATEACTIONINPUTPIN3CREATIONTOOL)) {
+ return createActionInputPin3CreationTool();
+ }
+ if(toolId.equals(CREATEVALUEPIN4CREATIONTOOL)) {
+ return createValuePin4CreationTool();
+ }
+ if(toolId.equals(CREATECONTROLFLOW1CREATIONTOOL)) {
+ return createControlFlow1CreationTool();
+ }
+ if(toolId.equals(CREATEOBJECTFLOW2CREATIONTOOL)) {
+ return createObjectFlow2CreationTool();
+ }
+ if(toolId.equals(CREATELOCALPRECONDITIONCONSTRAINT1CREATIONTOOL)) {
+ return createLocalPreconditionConstraint1CreationTool();
+ }
+ if(toolId.equals(CREATELOCALPOSTCONDITIONCONSTRAINT6CREATIONTOOL)) {
+ return createLocalPostconditionConstraint6CreationTool();
+ }
+ if(toolId.equals(CREATESELECTIONBEHAVIOR1CREATIONTOOL)) {
+ return createSelectionBehavior1CreationTool();
+ }
+ if(toolId.equals(CREATETRANSFORMATIONBEHAVIOR2CREATIONTOOL)) {
+ return createTransformationBehavior2CreationTool();
+ }
// default return: null
return null;
@@ -106,4 +211,155 @@ public class UMLPaletteFactory extends PaletteFactory.Adapter {
return tool;
}
+ /**
+ * @generated
+ */
+ private Tool createOpaqueAction1CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(1);
+ types.add(UMLElementTypes.OpaqueAction_3007);
+
+ Tool tool = new AspectUnspecifiedTypeCreationTool(types);
+ return tool;
+ }
+
+ /**
+ * @generated
+ */
+ private Tool createCallBehaviorAction2CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(1);
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+
+ Tool tool = new AspectUnspecifiedTypeCreationTool(types);
+ return tool;
+ }
+
+ /**
+ * @generated
+ */
+ private Tool createCallOperationAction3CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(1);
+ types.add(UMLElementTypes.CallOperationAction_3010);
+
+ Tool tool = new AspectUnspecifiedTypeCreationTool(types);
+ return tool;
+ }
+
+ /**
+ * @generated
+ */
+ private Tool createOutputPin1CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(3);
+ types.add(UMLElementTypes.OutputPin_3014);
+ types.add(UMLElementTypes.OutputPin_3020);
+ types.add(UMLElementTypes.OutputPin_3024);
+
+ Tool tool = new AspectUnspecifiedTypeCreationTool(types);
+ return tool;
+ }
+
+ /**
+ * @generated
+ */
+ private Tool createInputPin2CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(3);
+ types.add(UMLElementTypes.InputPin_3013);
+ types.add(UMLElementTypes.InputPin_3019);
+ types.add(UMLElementTypes.InputPin_3023);
+
+ Tool tool = new AspectUnspecifiedTypeCreationTool(types);
+ return tool;
+ }
+
+ /**
+ * @generated
+ */
+ private Tool createActionInputPin3CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(3);
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ types.add(UMLElementTypes.ActionInputPin_3021);
+
+ Tool tool = new AspectUnspecifiedTypeCreationTool(types);
+ return tool;
+ }
+
+ /**
+ * @generated
+ */
+ private Tool createValuePin4CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(3);
+ types.add(UMLElementTypes.ValuePin_3015);
+ types.add(UMLElementTypes.ValuePin_3017);
+ types.add(UMLElementTypes.ValuePin_3022);
+
+ Tool tool = new AspectUnspecifiedTypeCreationTool(types);
+ return tool;
+ }
+
+ /**
+ * @generated
+ */
+ private Tool createControlFlow1CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(1);
+ types.add(UMLElementTypes.ControlFlow_4004);
+
+ Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
+ return tool;
+ }
+
+ /**
+ * @generated
+ */
+ private Tool createObjectFlow2CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(1);
+ types.add(UMLElementTypes.ObjectFlow_4003);
+
+ Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
+ return tool;
+ }
+
+ /**
+ * @generated
+ */
+ private Tool createLocalPreconditionConstraint1CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(1);
+ types.add(UMLElementTypes.Constraint_3011);
+
+ Tool tool = new AspectUnspecifiedTypeCreationTool(types);
+ return tool;
+ }
+
+ /**
+ * @generated
+ */
+ private Tool createLocalPostconditionConstraint6CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(1);
+ types.add(UMLElementTypes.Constraint_3012);
+
+ Tool tool = new AspectUnspecifiedTypeCreationTool(types);
+ return tool;
+ }
+
+ /**
+ * @generated
+ */
+ private Tool createSelectionBehavior1CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(1);
+ types.add(UMLElementTypes.Activity_3028);
+
+ Tool tool = new AspectUnspecifiedTypeCreationTool(types);
+ return tool;
+ }
+
+ /**
+ * @generated
+ */
+ private Tool createTransformationBehavior2CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(1);
+ types.add(UMLElementTypes.Activity_3029);
+
+ Tool tool = new AspectUnspecifiedTypeCreationTool(types);
+ return tool;
+ }
+
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/UMLVisualIDRegistry.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/UMLVisualIDRegistry.java
index 20b598b1a00..4473f3aed66 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/UMLVisualIDRegistry.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/part/UMLVisualIDRegistry.java
@@ -18,22 +18,83 @@ import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCBActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActAsTargetLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActAsTargetValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOpaqueActEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityContentCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityParametersCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityPostConditionsCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityPreConditionsCompartmentEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsSelectionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsTransformationEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsTransformationNameEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityDiagramEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityFinalNodeEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityIsSingleExecutionEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityNameEditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.Constraint2EditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowWeightEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.FlowFinalNodeEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.InitialNodeEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCOActAsTargetLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowWeightEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOpaqueActEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ParameterEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCBActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActAsTargetLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActAsTargetValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.expressions.UMLAbstractExpression;
+import org.eclipse.papyrus.diagram.activity.expressions.UMLOCLFactory;
import org.eclipse.papyrus.diagram.common.providers.BaseViewInfo;
import org.eclipse.papyrus.diagram.common.providers.ViewInfo;
+import org.eclipse.uml2.uml.Constraint;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.UMLPackage;
@@ -54,6 +115,16 @@ public class UMLVisualIDRegistry {
/**
* @generated
*/
+ private static UMLAbstractExpression Constraint_3011_Constraint;
+
+ /**
+ * @generated
+ */
+ private static UMLAbstractExpression Constraint_3012_Constraint;
+
+ /**
+ * @generated
+ */
public static int getVisualID(View view) {
if(view instanceof Diagram) {
if(ActivityDiagramEditPart.MODEL_ID.equals(view.getType())) {
@@ -137,6 +208,87 @@ public class UMLVisualIDRegistry {
}
}
switch(containerVisualID) {
+ case OpaqueActionEditPart.VISUAL_ID:
+ if(UMLPackage.eINSTANCE.getValuePin().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return ValuePinInOpaqueActEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getActionInputPin().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return ActionInputPinInOpaqueActEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getInputPin().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return InputPinInOpaqueActEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getOutputPin().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return OutputPinInOpaqueActEditPart.VISUAL_ID;
+ }
+ break;
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ if(UMLPackage.eINSTANCE.getValuePin().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return ValuePinInCallBeActEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getActionInputPin().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return ActionInputPinInCallBeActEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getInputPin().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return InputPinInCallBeActEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getOutputPin().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return OutputPinInCallBeActEditPart.VISUAL_ID;
+ }
+ break;
+ case CallOperationActionEditPart.VISUAL_ID:
+ if(UMLPackage.eINSTANCE.getActionInputPin().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return ActionInputPinInCallOpActEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getValuePin().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return ValuePinInCallOpActEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getInputPin().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return InputPinInCallOpActEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getOutputPin().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return OutputPinInCallOpActEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getValuePin().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return ValuePinInCallOpActAsTargetEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getActionInputPin().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getInputPin().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return InputPinInCallOpActAsTargetEditPart.VISUAL_ID;
+ }
+ break;
case ActivityActivityParametersCompartmentEditPart.VISUAL_ID:
if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())
@@ -148,14 +300,14 @@ public class UMLVisualIDRegistry {
if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())
) {
- return ConstraintEditPart.VISUAL_ID;
+ return ConstraintInActivityAsPrecondEditPart.VISUAL_ID;
}
break;
case ActivityActivityPostConditionsCompartmentEditPart.VISUAL_ID:
if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())
) {
- return Constraint2EditPart.VISUAL_ID;
+ return ConstraintInActivityAsPostcondEditPart.VISUAL_ID;
}
break;
case ActivityActivityContentCompartmentEditPart.VISUAL_ID:
@@ -174,6 +326,37 @@ public class UMLVisualIDRegistry {
) {
return FlowFinalNodeEditPart.VISUAL_ID;
}
+ if(UMLPackage.eINSTANCE.getOpaqueAction().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return OpaqueActionEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getCallBehaviorAction().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return CallBehaviorActionEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getCallOperationAction().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return CallOperationActionEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass()) && isConstraint_3011(containerView, (Constraint)domainElement)) {
+ return ConstraintAsLocalPrecondEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass()) && isConstraint_3012(containerView, (Constraint)domainElement)) {
+ return ConstraintAsLocalPostcondEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return ActivityAsSelectionEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return ActivityAsTransformationEditPart.VISUAL_ID;
+ }
break;
case ActivityDiagramEditPart.VISUAL_ID:
if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())
@@ -187,6 +370,24 @@ public class UMLVisualIDRegistry {
}
/**
+ * Redirect call to defined method
+ *
+ * @generated NOT (method generation is missing or generated calls are incorrect)
+ */
+ private static boolean isConstraint_3011(View containerView, Constraint domainElement) {
+ return isConstraint_3011(domainElement);
+ }
+
+ /**
+ * Redirect call to defined method
+ *
+ * @generated NOT (method generation is missing or generated calls are incorrect)
+ */
+ private static boolean isConstraint_3012(View containerView, Constraint domainElement) {
+ return isConstraint_3012(domainElement);
+ }
+
+ /**
* @generated
*/
public static boolean canCreateNode(View containerView, int nodeVisualID) {
@@ -225,18 +426,197 @@ public class UMLVisualIDRegistry {
return true;
}
break;
+ case OpaqueActionEditPart.VISUAL_ID:
+ if(OpaqueActionNameEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ValuePinInOpaqueActEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ActionInputPinInOpaqueActEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(InputPinInOpaqueActEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(OutputPinInOpaqueActEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case ValuePinInOpaqueActEditPart.VISUAL_ID:
+ if(ValuePinInOActLabelEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ValuePinInOActValueEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case ActionInputPinInOpaqueActEditPart.VISUAL_ID:
+ if(ActionInputPinInOActLabelEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ActionInputPinInOActValueEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case InputPinInOpaqueActEditPart.VISUAL_ID:
+ if(InputPinInOActLabelEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case OutputPinInOpaqueActEditPart.VISUAL_ID:
+ if(OutputPinInOActLabelEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ if(CallBehaviorActionNameEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ValuePinInCallBeActEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ActionInputPinInCallBeActEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(InputPinInCallBeActEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(OutputPinInCallBeActEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case ValuePinInCallBeActEditPart.VISUAL_ID:
+ if(ValuePinInCBActLabelEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ValuePinInCBActValueEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case ActionInputPinInCallBeActEditPart.VISUAL_ID:
+ if(ActionInputPinInCBActLabelEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ActionInputPinInCBActValueEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case InputPinInCallBeActEditPart.VISUAL_ID:
+ if(InputPinInCBActLabelEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case OutputPinInCallBeActEditPart.VISUAL_ID:
+ if(OutputPinInCBActLabelEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case CallOperationActionEditPart.VISUAL_ID:
+ if(CallOperationActionNameEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ActionInputPinInCallOpActEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ValuePinInCallOpActEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(InputPinInCallOpActEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(OutputPinInCallOpActEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ValuePinInCallOpActAsTargetEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(InputPinInCallOpActAsTargetEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case ActionInputPinInCallOpActEditPart.VISUAL_ID:
+ if(ActionInputPinInCOActLabelEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ActionInputPinInCOActValueEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case ValuePinInCallOpActEditPart.VISUAL_ID:
+ if(ValuePinInCOActLabelEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ValuePinInCOActValueEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case InputPinInCallOpActEditPart.VISUAL_ID:
+ if(InputPinInCOActLabelEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case OutputPinInCallOpActEditPart.VISUAL_ID:
+ if(OutputPinInCOActLabelEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case ValuePinInCallOpActAsTargetEditPart.VISUAL_ID:
+ if(ValuePinInCOActAsTargetLabelEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ValuePinInCOActAsTargetValueEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ if(ActionInputPinInCOActAsTargetLabelEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ActionInputPinInCOActAsTargetValueEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case InputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ if(InputPinInCOActAsTargetLabelEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case ConstraintAsLocalPrecondEditPart.VISUAL_ID:
+ if(ConstraintAsLocalPrecondNameEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case ConstraintAsLocalPostcondEditPart.VISUAL_ID:
+ if(ConstraintAsLocalPostcondNameEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case ActivityAsSelectionEditPart.VISUAL_ID:
+ if(ActivityAsSelectionNameEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case ActivityAsTransformationEditPart.VISUAL_ID:
+ if(ActivityAsTransformationNameEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
case ActivityActivityParametersCompartmentEditPart.VISUAL_ID:
if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ActivityActivityPreConditionsCompartmentEditPart.VISUAL_ID:
- if(ConstraintEditPart.VISUAL_ID == nodeVisualID) {
+ if(ConstraintInActivityAsPrecondEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ActivityActivityPostConditionsCompartmentEditPart.VISUAL_ID:
- if(Constraint2EditPart.VISUAL_ID == nodeVisualID) {
+ if(ConstraintInActivityAsPostcondEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
@@ -250,12 +630,49 @@ public class UMLVisualIDRegistry {
if(FlowFinalNodeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
+ if(OpaqueActionEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(CallBehaviorActionEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(CallOperationActionEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ConstraintAsLocalPrecondEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ConstraintAsLocalPostcondEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ActivityAsSelectionEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ActivityAsTransformationEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
break;
case ActivityDiagramEditPart.VISUAL_ID:
if(ActivityEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
+ case ObjectFlowEditPart.VISUAL_ID:
+ if(ObjectFlowNameEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ObjectFlowWeightEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case ControlFlowEditPart.VISUAL_ID:
+ if(ControlFlowNameEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(ControlFlowWeightEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
}
return false;
}
@@ -267,6 +684,20 @@ public class UMLVisualIDRegistry {
if(domainElement == null) {
return -1;
}
+ if(UMLPackage.eINSTANCE.getObjectFlow().isSuperTypeOf(domainElement.eClass())
+
+
+
+ ) {
+ return ObjectFlowEditPart.VISUAL_ID;
+ }
+ if(UMLPackage.eINSTANCE.getControlFlow().isSuperTypeOf(domainElement.eClass())
+
+
+
+ ) {
+ return ControlFlowEditPart.VISUAL_ID;
+ }
return -1;
}
@@ -283,6 +714,28 @@ public class UMLVisualIDRegistry {
/**
* @generated
*/
+ private static boolean isConstraint_3011(Constraint domainElement) {
+ if(Constraint_3011_Constraint == null) { // lazy initialization
+ Constraint_3011_Constraint = UMLOCLFactory.getExpression("if self.owner.oclIsKindOf(Action)\r\nthen self.owner.oclAsType(Action).localPrecondition->includes(self)\r\nelse false endif", UMLPackage.eINSTANCE.getConstraint()); //$NON-NLS-1$
+ }
+ Object result = Constraint_3011_Constraint.evaluate(domainElement);
+ return result instanceof Boolean && ((Boolean)result).booleanValue();
+ }
+
+ /**
+ * @generated
+ */
+ private static boolean isConstraint_3012(Constraint domainElement) {
+ if(Constraint_3012_Constraint == null) { // lazy initialization
+ Constraint_3012_Constraint = UMLOCLFactory.getExpression("if self.owner.oclIsKindOf(Action)\r\nthen self.owner.oclAsType(Action).localPostcondition->includes(self)\r\nelse false endif", UMLPackage.eINSTANCE.getConstraint()); //$NON-NLS-1$
+ }
+ Object result = Constraint_3012_Constraint.evaluate(domainElement);
+ return result instanceof Boolean && ((Boolean)result).booleanValue();
+ }
+
+ /**
+ * @generated
+ */
private static ViewInfo diagramViewInfo = null;
/**
@@ -306,6 +759,46 @@ public class UMLVisualIDRegistry {
viewInfo = new BaseViewInfo(2001, ViewInfo.Node, "Activity");
root.addNode(1000, viewInfo);
+ viewInfo = new BaseViewInfo(4001, ViewInfo.Edge, "");
+ root.addNode(1000, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(4002, ViewInfo.Edge, "");
+ root.addNode(1000, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(4005, ViewInfo.Edge, "");
+ root.addNode(1000, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(4006, ViewInfo.Edge, "");
+ root.addNode(1000, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(4003, ViewInfo.Edge, "");
+ root.addNode(1000, viewInfo);
+
+
+ labelInfo = new BaseViewInfo(6001, ViewInfo.Label, "", null, viewInfo);
+ viewInfo.getChildren().add(labelInfo);
+
+
+ labelInfo = new BaseViewInfo(6002, ViewInfo.Label, "", null, viewInfo);
+ viewInfo.getChildren().add(labelInfo);
+
+
+ viewInfo = new BaseViewInfo(4004, ViewInfo.Edge, "");
+ root.addNode(1000, viewInfo);
+
+
+ labelInfo = new BaseViewInfo(6003, ViewInfo.Label, "", null, viewInfo);
+ viewInfo.getChildren().add(labelInfo);
+
+
+ labelInfo = new BaseViewInfo(6004, ViewInfo.Label, "", null, viewInfo);
+ viewInfo.getChildren().add(labelInfo);
+
+
viewInfo = new BaseViewInfo(3001, ViewInfo.Node, "Parameter");
root.addNode(7001, viewInfo);
@@ -335,6 +828,116 @@ public class UMLVisualIDRegistry {
root.addNode(7004, viewInfo);
+
+ viewInfo = new BaseViewInfo(3007, ViewInfo.Node, "OpaqueAction");
+
+ root.addNode(7004, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3015, ViewInfo.Node, "ValuePin");
+
+ root.addNode(3007, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3016, ViewInfo.Node, "ActionInputPin");
+
+ root.addNode(3007, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3013, ViewInfo.Node, "InputPin");
+
+ root.addNode(3007, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3014, ViewInfo.Node, "OutputPin");
+
+ root.addNode(3007, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3008, ViewInfo.Node, "CallBehaviorAction");
+
+ root.addNode(7004, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3017, ViewInfo.Node, "ValuePin");
+
+ root.addNode(3008, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3018, ViewInfo.Node, "ActionInputPin");
+
+ root.addNode(3008, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3019, ViewInfo.Node, "InputPin");
+
+ root.addNode(3008, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3020, ViewInfo.Node, "OutputPin");
+
+ root.addNode(3008, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3010, ViewInfo.Node, "CallOperationAction");
+
+ root.addNode(7004, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3021, ViewInfo.Node, "ActionInputPin");
+
+ root.addNode(3010, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3022, ViewInfo.Node, "ValuePin");
+
+ root.addNode(3010, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3023, ViewInfo.Node, "InputPin");
+
+ root.addNode(3010, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3024, ViewInfo.Node, "OutputPin");
+
+ root.addNode(3010, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3025, ViewInfo.Node, "ValuePin");
+
+ root.addNode(3010, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3026, ViewInfo.Node, "ActionInputPin");
+
+ root.addNode(3010, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3027, ViewInfo.Node, "InputPin");
+
+ root.addNode(3010, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3011, ViewInfo.Node, "Constraint");
+
+ root.addNode(7004, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3012, ViewInfo.Node, "Constraint");
+
+ root.addNode(7004, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3028, ViewInfo.Node, "Activity");
+
+ root.addNode(7004, viewInfo);
+
+
+ viewInfo = new BaseViewInfo(3029, ViewInfo.Node, "Activity");
+
+ root.addNode(7004, viewInfo);
+
return root;
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ActionInputPinPreferencePage.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ActionInputPinPreferencePage.java
new file mode 100644
index 00000000000..9af29d08cc3
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ActionInputPinPreferencePage.java
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * 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.diagram.activity.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+
+/**
+ * @generated
+ */
+public class ActionInputPinPreferencePage extends AbstractPapyrusNodePreferencePage {
+
+ /**
+ * @generated
+ */
+ @Override
+ protected String getBundleId() {
+ return UMLDiagramEditorPlugin.getInstance().ID;
+ }
+
+ /**
+ * @generated
+ */
+ public static void initDefaults(IPreferenceStore store) {
+
+ String elementName = "ActionInputPin";
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+
+ // Set the default for the gradient
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.GRADIENT_POLICY), false);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(new org.eclipse.swt.graphics.RGB(255, 255, 255), new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/CallBehaviorActionPreferencePage.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/CallBehaviorActionPreferencePage.java
new file mode 100644
index 00000000000..5a5e4a2e090
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/CallBehaviorActionPreferencePage.java
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * 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.diagram.activity.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+
+/**
+ * @generated
+ */
+public class CallBehaviorActionPreferencePage extends AbstractPapyrusNodePreferencePage {
+
+ /**
+ * @generated
+ */
+ @Override
+ protected String getBundleId() {
+ return UMLDiagramEditorPlugin.getInstance().ID;
+ }
+
+ /**
+ * @generated
+ */
+ public static void initDefaults(IPreferenceStore store) {
+
+ String elementName = "CallBehaviorAction";
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+
+ // Set the default for the gradient
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.GRADIENT_POLICY), false);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(new org.eclipse.swt.graphics.RGB(255, 255, 255), new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/CallOperationActionPreferencePage.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/CallOperationActionPreferencePage.java
new file mode 100644
index 00000000000..60d54e91f0b
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/CallOperationActionPreferencePage.java
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * 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.diagram.activity.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+
+/**
+ * @generated
+ */
+public class CallOperationActionPreferencePage extends AbstractPapyrusNodePreferencePage {
+
+ /**
+ * @generated
+ */
+ @Override
+ protected String getBundleId() {
+ return UMLDiagramEditorPlugin.getInstance().ID;
+ }
+
+ /**
+ * @generated
+ */
+ public static void initDefaults(IPreferenceStore store) {
+
+ String elementName = "CallOperationAction";
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+
+ // Set the default for the gradient
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.GRADIENT_POLICY), false);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(new org.eclipse.swt.graphics.RGB(255, 255, 255), new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ControlFlowPreferencePage.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ControlFlowPreferencePage.java
new file mode 100644
index 00000000000..8b04460be81
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ControlFlowPreferencePage.java
@@ -0,0 +1,40 @@
+/*****************************************************************************
+ * 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.diagram.activity.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
+
+/**
+ * @generated
+ */
+public class ControlFlowPreferencePage extends AbstractPapyrusLinkPreferencePage {
+
+ /**
+ * @generated
+ */
+ @Override
+ protected String getBundleId() {
+ return UMLDiagramEditorPlugin.getInstance().ID;
+ }
+
+ /**
+ * @generated
+ */
+ public static void initDefaults(IPreferenceStore store) {
+
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/DiagramPreferenceInitializer.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/DiagramPreferenceInitializer.java
index 1549262ddbd..6d9c1edef8d 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/DiagramPreferenceInitializer.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/DiagramPreferenceInitializer.java
@@ -28,12 +28,18 @@ public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer
public void initializeDefaultPreferences() {
IPreferenceStore store = getPreferenceStore();
- ActivityPreferencePage.initDefaults(store);
+ OpaqueActionPreferencePage.initDefaults(store);
InitialNodePreferencePage.initDefaults(store);
+ CallBehaviorActionPreferencePage.initDefaults(store);
+
+
+ OutputPinPreferencePage.initDefaults(store);
+
+
FlowFinalNodePreferencePage.initDefaults(store);
@@ -43,11 +49,33 @@ public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer
ActivityFinalNodePreferencePage.initDefaults(store);
+ ActivityPreferencePage.initDefaults(store);
+
+
+ InputPinPreferencePage.initDefaults(store);
+
+
+ ValuePinPreferencePage.initDefaults(store);
+
+
+ CallOperationActionPreferencePage.initDefaults(store);
+
+
+ ActionInputPinPreferencePage.initDefaults(store);
+
+
ParameterPreferencePage.initDefaults(store);
+ ObjectFlowPreferencePage.initDefaults(store);
+
+
+
+ ControlFlowPreferencePage.initDefaults(store);
+
+
}
/**
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/InputPinPreferencePage.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/InputPinPreferencePage.java
new file mode 100644
index 00000000000..b34b10f72e7
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/InputPinPreferencePage.java
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * 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.diagram.activity.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+
+/**
+ * @generated
+ */
+public class InputPinPreferencePage extends AbstractPapyrusNodePreferencePage {
+
+ /**
+ * @generated
+ */
+ @Override
+ protected String getBundleId() {
+ return UMLDiagramEditorPlugin.getInstance().ID;
+ }
+
+ /**
+ * @generated
+ */
+ public static void initDefaults(IPreferenceStore store) {
+
+ String elementName = "InputPin";
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+
+ // Set the default for the gradient
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.GRADIENT_POLICY), false);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(new org.eclipse.swt.graphics.RGB(255, 255, 255), new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ObjectFlowPreferencePage.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ObjectFlowPreferencePage.java
new file mode 100644
index 00000000000..ca9088b1b5f
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ObjectFlowPreferencePage.java
@@ -0,0 +1,40 @@
+/*****************************************************************************
+ * 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.diagram.activity.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.preferences.pages.AbstractPapyrusLinkPreferencePage;
+
+/**
+ * @generated
+ */
+public class ObjectFlowPreferencePage extends AbstractPapyrusLinkPreferencePage {
+
+ /**
+ * @generated
+ */
+ @Override
+ protected String getBundleId() {
+ return UMLDiagramEditorPlugin.getInstance().ID;
+ }
+
+ /**
+ * @generated
+ */
+ public static void initDefaults(IPreferenceStore store) {
+
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/OpaqueActionPreferencePage.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/OpaqueActionPreferencePage.java
new file mode 100644
index 00000000000..71ac2bfd195
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/OpaqueActionPreferencePage.java
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * 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.diagram.activity.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+
+/**
+ * @generated
+ */
+public class OpaqueActionPreferencePage extends AbstractPapyrusNodePreferencePage {
+
+ /**
+ * @generated
+ */
+ @Override
+ protected String getBundleId() {
+ return UMLDiagramEditorPlugin.getInstance().ID;
+ }
+
+ /**
+ * @generated
+ */
+ public static void initDefaults(IPreferenceStore store) {
+
+ String elementName = "OpaqueAction";
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+
+ // Set the default for the gradient
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.GRADIENT_POLICY), false);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(new org.eclipse.swt.graphics.RGB(255, 255, 255), new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/OutputPinPreferencePage.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/OutputPinPreferencePage.java
new file mode 100644
index 00000000000..04026a13488
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/OutputPinPreferencePage.java
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * 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.diagram.activity.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+
+/**
+ * @generated
+ */
+public class OutputPinPreferencePage extends AbstractPapyrusNodePreferencePage {
+
+ /**
+ * @generated
+ */
+ @Override
+ protected String getBundleId() {
+ return UMLDiagramEditorPlugin.getInstance().ID;
+ }
+
+ /**
+ * @generated
+ */
+ public static void initDefaults(IPreferenceStore store) {
+
+ String elementName = "OutputPin";
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+
+ // Set the default for the gradient
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.GRADIENT_POLICY), false);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(new org.eclipse.swt.graphics.RGB(255, 255, 255), new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ValuePinPreferencePage.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ValuePinPreferencePage.java
new file mode 100644
index 00000000000..92672398ea4
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/preferences/ValuePinPreferencePage.java
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * 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.diagram.activity.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+
+/**
+ * @generated
+ */
+public class ValuePinPreferencePage extends AbstractPapyrusNodePreferencePage {
+
+ /**
+ * @generated
+ */
+ @Override
+ protected String getBundleId() {
+ return UMLDiagramEditorPlugin.getInstance().ID;
+ }
+
+ /**
+ * @generated
+ */
+ public static void initDefaults(IPreferenceStore store) {
+
+ String elementName = "ValuePin";
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+
+ // Set the default for the gradient
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.GRADIENT_POLICY), false);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(new org.eclipse.swt.graphics.RGB(255, 255, 255), new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/ElementInitializers.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/ElementInitializers.java
index 55db5533faf..38d99ffe2af 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/ElementInitializers.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/ElementInitializers.java
@@ -13,10 +13,23 @@
*****************************************************************************/
package org.eclipse.papyrus.diagram.activity.providers;
-import org.eclipse.papyrus.diagram.activity.expressions.UMLOCLFactory;
import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.diagram.common.actions.LabelHelper;
+import org.eclipse.uml2.uml.ActionInputPin;
import org.eclipse.uml2.uml.Activity;
-import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.ActivityFinalNode;
+import org.eclipse.uml2.uml.CallBehaviorAction;
+import org.eclipse.uml2.uml.CallOperationAction;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.ControlFlow;
+import org.eclipse.uml2.uml.FlowFinalNode;
+import org.eclipse.uml2.uml.InitialNode;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.ObjectFlow;
+import org.eclipse.uml2.uml.OpaqueAction;
+import org.eclipse.uml2.uml.OutputPin;
+import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.ValuePin;
/**
* @generated
@@ -28,11 +41,588 @@ public class ElementInitializers {
*/
public static void init_Activity_2001(Activity instance) {
try {
- Object value_0 = UMLOCLFactory.getExpression("let base : String = \'Activity\' in\r\nlet suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in \r\nlet space : Namespace = self.namespace in\r\nlet allMissed : Sequence(String) = suffixes->\r\n select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))\r\n ) in\r\nlet firstMissed : String = allMissed->first() in \r\nlet noMisses : Boolean = firstMissed.oclIsUndefined() in\r\nlet allNames : Set(String) = \r\n if noMisses \r\n then \r\n space.member->collect(e : NamedElement | \r\n if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base\r\n then \'\' \r\n else e.name \r\n endif)->asSet()->excluding(\'\') else Set{\'not in use\'} \r\n endif in \r\nlet longestName : String = \r\n if noMisses\r\n then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() \r\n else \'not in use\' \r\n endif in \r\nif noMisses then \r\n if longestName.oclIsUndefined() \r\n then base \r\n else longestName.concat(\'1\') \r\n endif \r\nelse \r\n base.concat(firstMissed) \r\nendif ", UMLPackage.eINSTANCE.getActivity()).evaluate(instance);
+ Object value_0 = name_Activity_2001(instance);
instance.setName((String)value_0);
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
+ /**
+ * @generated
+ */
+ public static void init_Parameter_3001(Parameter instance) {
+ try {
+ Object value_0 = name_Parameter_3001(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_Constraint_3002(Constraint instance) {
+ try {
+ Object value_0 = name_Constraint_3002(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_Constraint_3003(Constraint instance) {
+ try {
+ Object value_0 = name_Constraint_3003(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_InitialNode_3004(InitialNode instance) {
+ try {
+ Object value_0 = name_InitialNode_3004(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_ActivityFinalNode_3005(ActivityFinalNode instance) {
+ try {
+ Object value_0 = name_ActivityFinalNode_3005(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_FlowFinalNode_3006(FlowFinalNode instance) {
+ try {
+ Object value_0 = name_FlowFinalNode_3006(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_OpaqueAction_3007(OpaqueAction instance) {
+ try {
+ Object value_0 = name_OpaqueAction_3007(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_ValuePin_3015(ValuePin instance) {
+ try {
+ Object value_0 = name_ValuePin_3015(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_ActionInputPin_3016(ActionInputPin instance) {
+ try {
+ Object value_0 = name_ActionInputPin_3016(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_InputPin_3013(InputPin instance) {
+ try {
+ Object value_0 = name_InputPin_3013(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_OutputPin_3014(OutputPin instance) {
+ try {
+ Object value_0 = name_OutputPin_3014(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_CallBehaviorAction_3008(CallBehaviorAction instance) {
+ try {
+ Object value_0 = name_CallBehaviorAction_3008(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_ValuePin_3017(ValuePin instance) {
+ try {
+ Object value_0 = name_ValuePin_3017(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_ActionInputPin_3018(ActionInputPin instance) {
+ try {
+ Object value_0 = name_ActionInputPin_3018(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_InputPin_3019(InputPin instance) {
+ try {
+ Object value_0 = name_InputPin_3019(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_OutputPin_3020(OutputPin instance) {
+ try {
+ Object value_0 = name_OutputPin_3020(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_CallOperationAction_3010(CallOperationAction instance) {
+ try {
+ Object value_0 = name_CallOperationAction_3010(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_ActionInputPin_3021(ActionInputPin instance) {
+ try {
+ Object value_0 = name_ActionInputPin_3021(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_ValuePin_3022(ValuePin instance) {
+ try {
+ Object value_0 = name_ValuePin_3022(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_InputPin_3023(InputPin instance) {
+ try {
+ Object value_0 = name_InputPin_3023(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_OutputPin_3024(OutputPin instance) {
+ try {
+ Object value_0 = name_OutputPin_3024(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_ValuePin_3025(ValuePin instance) {
+ try {
+ Object value_0 = name_ValuePin_3025(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_ActionInputPin_3026(ActionInputPin instance) {
+ try {
+ Object value_0 = name_ActionInputPin_3026(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_InputPin_3027(InputPin instance) {
+ try {
+ Object value_0 = name_InputPin_3027(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_Constraint_3011(Constraint instance) {
+ try {
+ Object value_0 = name_Constraint_3011(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_Constraint_3012(Constraint instance) {
+ try {
+ Object value_0 = name_Constraint_3012(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_Activity_3028(Activity instance) {
+ try {
+ Object value_0 = name_Activity_3028(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_Activity_3029(Activity instance) {
+ try {
+ Object value_0 = name_Activity_3029(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_ObjectFlow_4003(ObjectFlow instance) {
+ try {
+ Object value_0 = name_ObjectFlow_4003(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static void init_ControlFlow_4004(ControlFlow instance) {
+ try {
+ Object value_0 = name_ControlFlow_4004(instance);
+ instance.setName((String)value_0);
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_Activity_2001(Activity self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_Parameter_3001(Parameter self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_Constraint_3002(Constraint self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_Constraint_3003(Constraint self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_InitialNode_3004(InitialNode self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_ActivityFinalNode_3005(ActivityFinalNode self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_FlowFinalNode_3006(FlowFinalNode self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_OpaqueAction_3007(OpaqueAction self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_ValuePin_3015(ValuePin self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_ActionInputPin_3016(ActionInputPin self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_InputPin_3013(InputPin self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_OutputPin_3014(OutputPin self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_CallBehaviorAction_3008(CallBehaviorAction self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_ValuePin_3017(ValuePin self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_ActionInputPin_3018(ActionInputPin self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_InputPin_3019(InputPin self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_OutputPin_3020(OutputPin self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_CallOperationAction_3010(CallOperationAction self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_ActionInputPin_3021(ActionInputPin self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_ValuePin_3022(ValuePin self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_InputPin_3023(InputPin self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_OutputPin_3024(OutputPin self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_ValuePin_3025(ValuePin self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_ActionInputPin_3026(ActionInputPin self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_InputPin_3027(InputPin self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_Constraint_3011(Constraint self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_Constraint_3012(Constraint self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_Activity_3028(Activity self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_Activity_3029(Activity self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_ObjectFlow_4003(ObjectFlow self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
+ /**
+ * @generated
+ */
+ private static String name_ControlFlow_4004(ControlFlow self) {
+ return LabelHelper.INSTANCE.findName(self.eContainer(), self);
+ }
+
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLElementTypes.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLElementTypes.java
index 6b1c563b108..e3becdb3db0 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLElementTypes.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLElementTypes.java
@@ -27,14 +27,42 @@ import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPostconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPreconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsTransformationEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityDiagramEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityFinalNodeEditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.Constraint2EditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.FlowFinalNodeEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.InitialNodeEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowTransformationEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOpaqueActEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ParameterEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOpaqueActEditPart;
import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
import org.eclipse.swt.graphics.Image;
import org.eclipse.uml2.uml.UMLPackage;
@@ -108,6 +136,146 @@ public class UMLElementTypes extends ElementInitializers {
/**
* @generated
*/
+ public static final IElementType OpaqueAction_3007 = getElementType("org.eclipse.papyrus.diagram.activity.OpaqueAction_3007"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType ValuePin_3015 = getElementType("org.eclipse.papyrus.diagram.activity.ValuePin_3015"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType ActionInputPin_3016 = getElementType("org.eclipse.papyrus.diagram.activity.ActionInputPin_3016"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType InputPin_3013 = getElementType("org.eclipse.papyrus.diagram.activity.InputPin_3013"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType OutputPin_3014 = getElementType("org.eclipse.papyrus.diagram.activity.OutputPin_3014"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType CallBehaviorAction_3008 = getElementType("org.eclipse.papyrus.diagram.activity.CallBehaviorAction_3008"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType ValuePin_3017 = getElementType("org.eclipse.papyrus.diagram.activity.ValuePin_3017"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType ActionInputPin_3018 = getElementType("org.eclipse.papyrus.diagram.activity.ActionInputPin_3018"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType InputPin_3019 = getElementType("org.eclipse.papyrus.diagram.activity.InputPin_3019"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType OutputPin_3020 = getElementType("org.eclipse.papyrus.diagram.activity.OutputPin_3020"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType CallOperationAction_3010 = getElementType("org.eclipse.papyrus.diagram.activity.CallOperationAction_3010"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType ActionInputPin_3021 = getElementType("org.eclipse.papyrus.diagram.activity.ActionInputPin_3021"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType ValuePin_3022 = getElementType("org.eclipse.papyrus.diagram.activity.ValuePin_3022"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType InputPin_3023 = getElementType("org.eclipse.papyrus.diagram.activity.InputPin_3023"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType OutputPin_3024 = getElementType("org.eclipse.papyrus.diagram.activity.OutputPin_3024"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType ValuePin_3025 = getElementType("org.eclipse.papyrus.diagram.activity.ValuePin_3025"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType ActionInputPin_3026 = getElementType("org.eclipse.papyrus.diagram.activity.ActionInputPin_3026"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType InputPin_3027 = getElementType("org.eclipse.papyrus.diagram.activity.InputPin_3027"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType Constraint_3011 = getElementType("org.eclipse.papyrus.diagram.activity.Constraint_3011"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType Constraint_3012 = getElementType("org.eclipse.papyrus.diagram.activity.Constraint_3012"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType Activity_3028 = getElementType("org.eclipse.papyrus.diagram.activity.Activity_3028"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType Activity_3029 = getElementType("org.eclipse.papyrus.diagram.activity.Activity_3029"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType ActionLocalPrecondition_4001 = getElementType("org.eclipse.papyrus.diagram.activity.ActionLocalPrecondition_4001"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType ActionLocalPostcondition_4002 = getElementType("org.eclipse.papyrus.diagram.activity.ActionLocalPostcondition_4002"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType ObjectFlowSelection_4005 = getElementType("org.eclipse.papyrus.diagram.activity.ObjectFlowSelection_4005"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType ObjectFlowTransformation_4006 = getElementType("org.eclipse.papyrus.diagram.activity.ObjectFlowTransformation_4006"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType ObjectFlow_4003 = getElementType("org.eclipse.papyrus.diagram.activity.ObjectFlow_4003"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final IElementType ControlFlow_4004 = getElementType("org.eclipse.papyrus.diagram.activity.ControlFlow_4004"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
private static ImageRegistry getImageRegistry() {
if(imageRegistry == null) {
imageRegistry = new ImageRegistry();
@@ -233,6 +401,86 @@ public class UMLElementTypes extends ElementInitializers {
elements.put(FlowFinalNode_3006, UMLPackage.eINSTANCE.getFlowFinalNode());
+
+
+ elements.put(OpaqueAction_3007, UMLPackage.eINSTANCE.getOpaqueAction());
+
+
+ elements.put(ValuePin_3015, UMLPackage.eINSTANCE.getValuePin());
+
+
+ elements.put(ActionInputPin_3016, UMLPackage.eINSTANCE.getActionInputPin());
+
+
+ elements.put(InputPin_3013, UMLPackage.eINSTANCE.getInputPin());
+
+
+ elements.put(OutputPin_3014, UMLPackage.eINSTANCE.getOutputPin());
+
+
+ elements.put(CallBehaviorAction_3008, UMLPackage.eINSTANCE.getCallBehaviorAction());
+
+
+ elements.put(ValuePin_3017, UMLPackage.eINSTANCE.getValuePin());
+
+
+ elements.put(ActionInputPin_3018, UMLPackage.eINSTANCE.getActionInputPin());
+
+
+ elements.put(InputPin_3019, UMLPackage.eINSTANCE.getInputPin());
+
+
+ elements.put(OutputPin_3020, UMLPackage.eINSTANCE.getOutputPin());
+
+
+ elements.put(CallOperationAction_3010, UMLPackage.eINSTANCE.getCallOperationAction());
+
+
+ elements.put(ActionInputPin_3021, UMLPackage.eINSTANCE.getActionInputPin());
+
+
+ elements.put(ValuePin_3022, UMLPackage.eINSTANCE.getValuePin());
+
+
+ elements.put(InputPin_3023, UMLPackage.eINSTANCE.getInputPin());
+
+
+ elements.put(OutputPin_3024, UMLPackage.eINSTANCE.getOutputPin());
+
+
+ elements.put(ValuePin_3025, UMLPackage.eINSTANCE.getValuePin());
+
+
+ elements.put(ActionInputPin_3026, UMLPackage.eINSTANCE.getActionInputPin());
+
+
+ elements.put(InputPin_3027, UMLPackage.eINSTANCE.getInputPin());
+
+
+ elements.put(Constraint_3011, UMLPackage.eINSTANCE.getConstraint());
+
+
+ elements.put(Constraint_3012, UMLPackage.eINSTANCE.getConstraint());
+
+
+ elements.put(Activity_3028, UMLPackage.eINSTANCE.getActivity());
+
+
+ elements.put(Activity_3029, UMLPackage.eINSTANCE.getActivity());
+
+ elements.put(ActionLocalPrecondition_4001, UMLPackage.eINSTANCE.getAction_LocalPrecondition());
+
+ elements.put(ActionLocalPostcondition_4002, UMLPackage.eINSTANCE.getAction_LocalPostcondition());
+
+ elements.put(ObjectFlowSelection_4005, UMLPackage.eINSTANCE.getObjectFlow_Selection());
+
+ elements.put(ObjectFlowTransformation_4006, UMLPackage.eINSTANCE.getObjectFlow_Transformation());
+
+
+ elements.put(ObjectFlow_4003, UMLPackage.eINSTANCE.getObjectFlow());
+
+
+ elements.put(ControlFlow_4004, UMLPackage.eINSTANCE.getControlFlow());
}
return (ENamedElement)elements.get(type);
}
@@ -258,6 +506,34 @@ public class UMLElementTypes extends ElementInitializers {
KNOWN_ELEMENT_TYPES.add(InitialNode_3004);
KNOWN_ELEMENT_TYPES.add(ActivityFinalNode_3005);
KNOWN_ELEMENT_TYPES.add(FlowFinalNode_3006);
+ KNOWN_ELEMENT_TYPES.add(OpaqueAction_3007);
+ KNOWN_ELEMENT_TYPES.add(ValuePin_3015);
+ KNOWN_ELEMENT_TYPES.add(ActionInputPin_3016);
+ KNOWN_ELEMENT_TYPES.add(InputPin_3013);
+ KNOWN_ELEMENT_TYPES.add(OutputPin_3014);
+ KNOWN_ELEMENT_TYPES.add(CallBehaviorAction_3008);
+ KNOWN_ELEMENT_TYPES.add(ValuePin_3017);
+ KNOWN_ELEMENT_TYPES.add(ActionInputPin_3018);
+ KNOWN_ELEMENT_TYPES.add(InputPin_3019);
+ KNOWN_ELEMENT_TYPES.add(OutputPin_3020);
+ KNOWN_ELEMENT_TYPES.add(CallOperationAction_3010);
+ KNOWN_ELEMENT_TYPES.add(ActionInputPin_3021);
+ KNOWN_ELEMENT_TYPES.add(ValuePin_3022);
+ KNOWN_ELEMENT_TYPES.add(InputPin_3023);
+ KNOWN_ELEMENT_TYPES.add(OutputPin_3024);
+ KNOWN_ELEMENT_TYPES.add(ValuePin_3025);
+ KNOWN_ELEMENT_TYPES.add(ActionInputPin_3026);
+ KNOWN_ELEMENT_TYPES.add(InputPin_3027);
+ KNOWN_ELEMENT_TYPES.add(Constraint_3011);
+ KNOWN_ELEMENT_TYPES.add(Constraint_3012);
+ KNOWN_ELEMENT_TYPES.add(Activity_3028);
+ KNOWN_ELEMENT_TYPES.add(Activity_3029);
+ KNOWN_ELEMENT_TYPES.add(ActionLocalPrecondition_4001);
+ KNOWN_ELEMENT_TYPES.add(ActionLocalPostcondition_4002);
+ KNOWN_ELEMENT_TYPES.add(ObjectFlowSelection_4005);
+ KNOWN_ELEMENT_TYPES.add(ObjectFlowTransformation_4006);
+ KNOWN_ELEMENT_TYPES.add(ObjectFlow_4003);
+ KNOWN_ELEMENT_TYPES.add(ControlFlow_4004);
}
return KNOWN_ELEMENT_TYPES.contains(elementType);
}
@@ -273,9 +549,9 @@ public class UMLElementTypes extends ElementInitializers {
return Activity_2001;
case ParameterEditPart.VISUAL_ID:
return Parameter_3001;
- case ConstraintEditPart.VISUAL_ID:
+ case ConstraintInActivityAsPrecondEditPart.VISUAL_ID:
return Constraint_3002;
- case Constraint2EditPart.VISUAL_ID:
+ case ConstraintInActivityAsPostcondEditPart.VISUAL_ID:
return Constraint_3003;
case InitialNodeEditPart.VISUAL_ID:
return InitialNode_3004;
@@ -283,6 +559,62 @@ public class UMLElementTypes extends ElementInitializers {
return ActivityFinalNode_3005;
case FlowFinalNodeEditPart.VISUAL_ID:
return FlowFinalNode_3006;
+ case OpaqueActionEditPart.VISUAL_ID:
+ return OpaqueAction_3007;
+ case ValuePinInOpaqueActEditPart.VISUAL_ID:
+ return ValuePin_3015;
+ case ActionInputPinInOpaqueActEditPart.VISUAL_ID:
+ return ActionInputPin_3016;
+ case InputPinInOpaqueActEditPart.VISUAL_ID:
+ return InputPin_3013;
+ case OutputPinInOpaqueActEditPart.VISUAL_ID:
+ return OutputPin_3014;
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ return CallBehaviorAction_3008;
+ case ValuePinInCallBeActEditPart.VISUAL_ID:
+ return ValuePin_3017;
+ case ActionInputPinInCallBeActEditPart.VISUAL_ID:
+ return ActionInputPin_3018;
+ case InputPinInCallBeActEditPart.VISUAL_ID:
+ return InputPin_3019;
+ case OutputPinInCallBeActEditPart.VISUAL_ID:
+ return OutputPin_3020;
+ case CallOperationActionEditPart.VISUAL_ID:
+ return CallOperationAction_3010;
+ case ActionInputPinInCallOpActEditPart.VISUAL_ID:
+ return ActionInputPin_3021;
+ case ValuePinInCallOpActEditPart.VISUAL_ID:
+ return ValuePin_3022;
+ case InputPinInCallOpActEditPart.VISUAL_ID:
+ return InputPin_3023;
+ case OutputPinInCallOpActEditPart.VISUAL_ID:
+ return OutputPin_3024;
+ case ValuePinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return ValuePin_3025;
+ case ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return ActionInputPin_3026;
+ case InputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return InputPin_3027;
+ case ConstraintAsLocalPrecondEditPart.VISUAL_ID:
+ return Constraint_3011;
+ case ConstraintAsLocalPostcondEditPart.VISUAL_ID:
+ return Constraint_3012;
+ case ActivityAsSelectionEditPart.VISUAL_ID:
+ return Activity_3028;
+ case ActivityAsTransformationEditPart.VISUAL_ID:
+ return Activity_3029;
+ case ActionLocalPreconditionEditPart.VISUAL_ID:
+ return ActionLocalPrecondition_4001;
+ case ActionLocalPostconditionEditPart.VISUAL_ID:
+ return ActionLocalPostcondition_4002;
+ case ObjectFlowSelectionEditPart.VISUAL_ID:
+ return ObjectFlowSelection_4005;
+ case ObjectFlowTransformationEditPart.VISUAL_ID:
+ return ObjectFlowTransformation_4006;
+ case ObjectFlowEditPart.VISUAL_ID:
+ return ObjectFlow_4003;
+ case ControlFlowEditPart.VISUAL_ID:
+ return ControlFlow_4004;
}
return null;
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLModelingAssistantProvider.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLModelingAssistantProvider.java
index cf6c95673ec..2c99769d755 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLModelingAssistantProvider.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLModelingAssistantProvider.java
@@ -30,9 +30,32 @@ import org.eclipse.gmf.runtime.emf.ui.services.modelingassistant.ModelingAssista
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOpaqueActEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityContentCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityDiagramEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityFinalNodeEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.FlowFinalNodeEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InitialNodeEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOpaqueActEditPart;
import org.eclipse.papyrus.diagram.activity.part.Messages;
import org.eclipse.papyrus.diagram.activity.part.UMLDiagramEditorPlugin;
import org.eclipse.swt.widgets.Display;
@@ -56,11 +79,45 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
types.add(UMLElementTypes.Constraint_3003);
return types;
}
+ if(editPart instanceof OpaqueActionEditPart) {
+ ArrayList types = new ArrayList(4);
+ types.add(UMLElementTypes.ValuePin_3015);
+ types.add(UMLElementTypes.ActionInputPin_3016);
+ types.add(UMLElementTypes.InputPin_3013);
+ types.add(UMLElementTypes.OutputPin_3014);
+ return types;
+ }
+ if(editPart instanceof CallBehaviorActionEditPart) {
+ ArrayList types = new ArrayList(4);
+ types.add(UMLElementTypes.ValuePin_3017);
+ types.add(UMLElementTypes.ActionInputPin_3018);
+ types.add(UMLElementTypes.InputPin_3019);
+ types.add(UMLElementTypes.OutputPin_3020);
+ return types;
+ }
+ if(editPart instanceof CallOperationActionEditPart) {
+ ArrayList types = new ArrayList(7);
+ types.add(UMLElementTypes.ActionInputPin_3021);
+ types.add(UMLElementTypes.ValuePin_3022);
+ types.add(UMLElementTypes.InputPin_3023);
+ types.add(UMLElementTypes.OutputPin_3024);
+ types.add(UMLElementTypes.ValuePin_3025);
+ types.add(UMLElementTypes.ActionInputPin_3026);
+ types.add(UMLElementTypes.InputPin_3027);
+ return types;
+ }
if(editPart instanceof ActivityActivityContentCompartmentEditPart) {
- ArrayList types = new ArrayList(3);
+ ArrayList types = new ArrayList(10);
types.add(UMLElementTypes.InitialNode_3004);
types.add(UMLElementTypes.ActivityFinalNode_3005);
types.add(UMLElementTypes.FlowFinalNode_3006);
+ types.add(UMLElementTypes.OpaqueAction_3007);
+ types.add(UMLElementTypes.CallBehaviorAction_3008);
+ types.add(UMLElementTypes.CallOperationAction_3010);
+ types.add(UMLElementTypes.Constraint_3011);
+ types.add(UMLElementTypes.Constraint_3012);
+ types.add(UMLElementTypes.Activity_3028);
+ types.add(UMLElementTypes.Activity_3029);
return types;
}
if(editPart instanceof ActivityDiagramEditPart) {
@@ -76,6 +133,69 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
*/
public List getRelTypesOnSource(IAdaptable source) {
IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
+ if(sourceEditPart instanceof InitialNodeEditPart) {
+ return ((InitialNodeEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof ActivityFinalNodeEditPart) {
+ return ((ActivityFinalNodeEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof FlowFinalNodeEditPart) {
+ return ((FlowFinalNodeEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof OpaqueActionEditPart) {
+ return ((OpaqueActionEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof ValuePinInOpaqueActEditPart) {
+ return ((ValuePinInOpaqueActEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ return ((ActionInputPinInOpaqueActEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof InputPinInOpaqueActEditPart) {
+ return ((InputPinInOpaqueActEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof OutputPinInOpaqueActEditPart) {
+ return ((OutputPinInOpaqueActEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof CallBehaviorActionEditPart) {
+ return ((CallBehaviorActionEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof ValuePinInCallBeActEditPart) {
+ return ((ValuePinInCallBeActEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ return ((ActionInputPinInCallBeActEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof InputPinInCallBeActEditPart) {
+ return ((InputPinInCallBeActEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof OutputPinInCallBeActEditPart) {
+ return ((OutputPinInCallBeActEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof CallOperationActionEditPart) {
+ return ((CallOperationActionEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ return ((ActionInputPinInCallOpActEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof ValuePinInCallOpActEditPart) {
+ return ((ValuePinInCallOpActEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof InputPinInCallOpActEditPart) {
+ return ((InputPinInCallOpActEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof OutputPinInCallOpActEditPart) {
+ return ((OutputPinInCallOpActEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ return ((ValuePinInCallOpActAsTargetEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ return ((ActionInputPinInCallOpActAsTargetEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
+ if(sourceEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ return ((InputPinInCallOpActAsTargetEditPart)sourceEditPart).getMARelTypesOnSource();
+ }
return Collections.EMPTY_LIST;
}
@@ -84,6 +204,75 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
*/
public List getRelTypesOnTarget(IAdaptable target) {
IGraphicalEditPart targetEditPart = (IGraphicalEditPart)target.getAdapter(IGraphicalEditPart.class);
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ return ((InitialNodeEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ return ((ActivityFinalNodeEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ return ((FlowFinalNodeEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ return ((OpaqueActionEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ return ((ValuePinInOpaqueActEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ return ((ActionInputPinInOpaqueActEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ return ((InputPinInOpaqueActEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ return ((OutputPinInOpaqueActEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ return ((CallBehaviorActionEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ return ((ValuePinInCallBeActEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ return ((ActionInputPinInCallBeActEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ return ((InputPinInCallBeActEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ return ((OutputPinInCallBeActEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ return ((CallOperationActionEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ return ((ActionInputPinInCallOpActEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ return ((ValuePinInCallOpActEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ return ((InputPinInCallOpActEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ return ((OutputPinInCallOpActEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ return ((ValuePinInCallOpActAsTargetEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ return ((ActionInputPinInCallOpActAsTargetEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ return ((InputPinInCallOpActAsTargetEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof ConstraintAsLocalPrecondEditPart) {
+ return ((ConstraintAsLocalPrecondEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
+ if(targetEditPart instanceof ConstraintAsLocalPostcondEditPart) {
+ return ((ConstraintAsLocalPostcondEditPart)targetEditPart).getMARelTypesOnTarget();
+ }
return Collections.EMPTY_LIST;
}
@@ -93,6 +282,69 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
public List getRelTypesOnSourceAndTarget(IAdaptable source, IAdaptable target) {
IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
IGraphicalEditPart targetEditPart = (IGraphicalEditPart)target.getAdapter(IGraphicalEditPart.class);
+ if(sourceEditPart instanceof InitialNodeEditPart) {
+ return ((InitialNodeEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof ActivityFinalNodeEditPart) {
+ return ((ActivityFinalNodeEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof FlowFinalNodeEditPart) {
+ return ((FlowFinalNodeEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof OpaqueActionEditPart) {
+ return ((OpaqueActionEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof ValuePinInOpaqueActEditPart) {
+ return ((ValuePinInOpaqueActEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ return ((ActionInputPinInOpaqueActEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof InputPinInOpaqueActEditPart) {
+ return ((InputPinInOpaqueActEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof OutputPinInOpaqueActEditPart) {
+ return ((OutputPinInOpaqueActEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof CallBehaviorActionEditPart) {
+ return ((CallBehaviorActionEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof ValuePinInCallBeActEditPart) {
+ return ((ValuePinInCallBeActEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ return ((ActionInputPinInCallBeActEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof InputPinInCallBeActEditPart) {
+ return ((InputPinInCallBeActEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof OutputPinInCallBeActEditPart) {
+ return ((OutputPinInCallBeActEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof CallOperationActionEditPart) {
+ return ((CallOperationActionEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ return ((ActionInputPinInCallOpActEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof ValuePinInCallOpActEditPart) {
+ return ((ValuePinInCallOpActEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof InputPinInCallOpActEditPart) {
+ return ((InputPinInCallOpActEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof OutputPinInCallOpActEditPart) {
+ return ((OutputPinInCallOpActEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ return ((ValuePinInCallOpActAsTargetEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ return ((ActionInputPinInCallOpActAsTargetEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
+ if(sourceEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ return ((InputPinInCallOpActAsTargetEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ }
return Collections.EMPTY_LIST;
}
@@ -101,6 +353,75 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
*/
public List getTypesForSource(IAdaptable target, IElementType relationshipType) {
IGraphicalEditPart targetEditPart = (IGraphicalEditPart)target.getAdapter(IGraphicalEditPart.class);
+ if(targetEditPart instanceof InitialNodeEditPart) {
+ return ((InitialNodeEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof ActivityFinalNodeEditPart) {
+ return ((ActivityFinalNodeEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof FlowFinalNodeEditPart) {
+ return ((FlowFinalNodeEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof OpaqueActionEditPart) {
+ return ((OpaqueActionEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof ValuePinInOpaqueActEditPart) {
+ return ((ValuePinInOpaqueActEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ return ((ActionInputPinInOpaqueActEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof InputPinInOpaqueActEditPart) {
+ return ((InputPinInOpaqueActEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof OutputPinInOpaqueActEditPart) {
+ return ((OutputPinInOpaqueActEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof CallBehaviorActionEditPart) {
+ return ((CallBehaviorActionEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof ValuePinInCallBeActEditPart) {
+ return ((ValuePinInCallBeActEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ return ((ActionInputPinInCallBeActEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof InputPinInCallBeActEditPart) {
+ return ((InputPinInCallBeActEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof OutputPinInCallBeActEditPart) {
+ return ((OutputPinInCallBeActEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof CallOperationActionEditPart) {
+ return ((CallOperationActionEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ return ((ActionInputPinInCallOpActEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActEditPart) {
+ return ((ValuePinInCallOpActEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActEditPart) {
+ return ((InputPinInCallOpActEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof OutputPinInCallOpActEditPart) {
+ return ((OutputPinInCallOpActEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ return ((ValuePinInCallOpActAsTargetEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ return ((ActionInputPinInCallOpActAsTargetEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ return ((InputPinInCallOpActAsTargetEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof ConstraintAsLocalPrecondEditPart) {
+ return ((ConstraintAsLocalPrecondEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
+ if(targetEditPart instanceof ConstraintAsLocalPostcondEditPart) {
+ return ((ConstraintAsLocalPostcondEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ }
return Collections.EMPTY_LIST;
}
@@ -109,6 +430,69 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
*/
public List getTypesForTarget(IAdaptable source, IElementType relationshipType) {
IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
+ if(sourceEditPart instanceof InitialNodeEditPart) {
+ return ((InitialNodeEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof ActivityFinalNodeEditPart) {
+ return ((ActivityFinalNodeEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof FlowFinalNodeEditPart) {
+ return ((FlowFinalNodeEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof OpaqueActionEditPart) {
+ return ((OpaqueActionEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof ValuePinInOpaqueActEditPart) {
+ return ((ValuePinInOpaqueActEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof ActionInputPinInOpaqueActEditPart) {
+ return ((ActionInputPinInOpaqueActEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof InputPinInOpaqueActEditPart) {
+ return ((InputPinInOpaqueActEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof OutputPinInOpaqueActEditPart) {
+ return ((OutputPinInOpaqueActEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof CallBehaviorActionEditPart) {
+ return ((CallBehaviorActionEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof ValuePinInCallBeActEditPart) {
+ return ((ValuePinInCallBeActEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof ActionInputPinInCallBeActEditPart) {
+ return ((ActionInputPinInCallBeActEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof InputPinInCallBeActEditPart) {
+ return ((InputPinInCallBeActEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof OutputPinInCallBeActEditPart) {
+ return ((OutputPinInCallBeActEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof CallOperationActionEditPart) {
+ return ((CallOperationActionEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof ActionInputPinInCallOpActEditPart) {
+ return ((ActionInputPinInCallOpActEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof ValuePinInCallOpActEditPart) {
+ return ((ValuePinInCallOpActEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof InputPinInCallOpActEditPart) {
+ return ((InputPinInCallOpActEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof OutputPinInCallOpActEditPart) {
+ return ((OutputPinInCallOpActEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof ValuePinInCallOpActAsTargetEditPart) {
+ return ((ValuePinInCallOpActAsTargetEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof ActionInputPinInCallOpActAsTargetEditPart) {
+ return ((ActionInputPinInCallOpActAsTargetEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
+ if(sourceEditPart instanceof InputPinInCallOpActAsTargetEditPart) {
+ return ((InputPinInCallOpActAsTargetEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ }
return Collections.EMPTY_LIST;
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLParserProvider.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLParserProvider.java
index d8f10dcc452..1a0ea473fe6 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLParserProvider.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLParserProvider.java
@@ -25,13 +25,52 @@ import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.emf.ui.services.parser.ParserHintAdapter;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCBActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActAsTargetLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActAsTargetValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsSelectionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsTransformationNameEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityIsSingleExecutionEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityNameEditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.Constraint2EditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowWeightEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCOActAsTargetLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowWeightEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOActLabelEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ParameterEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCBActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActAsTargetLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActAsTargetValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.parser.custom.ActivityEdgeWeightParser;
import org.eclipse.papyrus.diagram.activity.parser.custom.ActivitySingleExecutionParser;
+import org.eclipse.papyrus.diagram.activity.parser.custom.CallBehaviorActionParser;
+import org.eclipse.papyrus.diagram.activity.parser.custom.CallOperationActionParser;
import org.eclipse.papyrus.diagram.activity.parser.custom.ParameterParser;
+import org.eclipse.papyrus.diagram.activity.parser.custom.PinParser;
+import org.eclipse.papyrus.diagram.activity.parser.custom.PinValueParser;
import org.eclipse.papyrus.diagram.activity.parsers.MessageFormatParser;
import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
import org.eclipse.uml2.uml.UMLPackage;
@@ -131,6 +170,542 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
/**
* @generated
*/
+ private IParser opaqueActionName_5003Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getOpaqueActionName_5003Parser() {
+ if(opaqueActionName_5003Parser == null) {
+ EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ MessageFormatParser parser = new MessageFormatParser(features);
+ opaqueActionName_5003Parser = parser;
+ }
+ return opaqueActionName_5003Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinParser valuePinLabel_5011Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getValuePinLabel_5011Parser() {
+ if(valuePinLabel_5011Parser == null) {
+ valuePinLabel_5011Parser = new PinParser();
+ }
+ return valuePinLabel_5011Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinValueParser valuePinLabel_5024Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getValuePinLabel_5024Parser() {
+ if(valuePinLabel_5024Parser == null) {
+ valuePinLabel_5024Parser = new PinValueParser();
+ }
+ return valuePinLabel_5024Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinParser actionInputPinLabel_5012Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getActionInputPinLabel_5012Parser() {
+ if(actionInputPinLabel_5012Parser == null) {
+ actionInputPinLabel_5012Parser = new PinParser();
+ }
+ return actionInputPinLabel_5012Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinValueParser actionInputPinLabel_5025Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getActionInputPinLabel_5025Parser() {
+ if(actionInputPinLabel_5025Parser == null) {
+ actionInputPinLabel_5025Parser = new PinValueParser();
+ }
+ return actionInputPinLabel_5025Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinParser inputPinLabel_5009Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getInputPinLabel_5009Parser() {
+ if(inputPinLabel_5009Parser == null) {
+ inputPinLabel_5009Parser = new PinParser();
+ }
+ return inputPinLabel_5009Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinParser outputPinLabel_5010Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getOutputPinLabel_5010Parser() {
+ if(outputPinLabel_5010Parser == null) {
+ outputPinLabel_5010Parser = new PinParser();
+ }
+ return outputPinLabel_5010Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private CallBehaviorActionParser callBehaviorActionLabel_5004Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getCallBehaviorActionLabel_5004Parser() {
+ if(callBehaviorActionLabel_5004Parser == null) {
+ callBehaviorActionLabel_5004Parser = new CallBehaviorActionParser();
+ }
+ return callBehaviorActionLabel_5004Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinParser valuePinLabel_5013Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getValuePinLabel_5013Parser() {
+ if(valuePinLabel_5013Parser == null) {
+ valuePinLabel_5013Parser = new PinParser();
+ }
+ return valuePinLabel_5013Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinValueParser valuePinLabel_5026Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getValuePinLabel_5026Parser() {
+ if(valuePinLabel_5026Parser == null) {
+ valuePinLabel_5026Parser = new PinValueParser();
+ }
+ return valuePinLabel_5026Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinParser actionInputPinLabel_5014Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getActionInputPinLabel_5014Parser() {
+ if(actionInputPinLabel_5014Parser == null) {
+ actionInputPinLabel_5014Parser = new PinParser();
+ }
+ return actionInputPinLabel_5014Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinValueParser actionInputPinLabel_5027Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getActionInputPinLabel_5027Parser() {
+ if(actionInputPinLabel_5027Parser == null) {
+ actionInputPinLabel_5027Parser = new PinValueParser();
+ }
+ return actionInputPinLabel_5027Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinParser inputPinLabel_5015Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getInputPinLabel_5015Parser() {
+ if(inputPinLabel_5015Parser == null) {
+ inputPinLabel_5015Parser = new PinParser();
+ }
+ return inputPinLabel_5015Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinParser outputPinLabel_5016Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getOutputPinLabel_5016Parser() {
+ if(outputPinLabel_5016Parser == null) {
+ outputPinLabel_5016Parser = new PinParser();
+ }
+ return outputPinLabel_5016Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private CallOperationActionParser callOperationActionLabel_5006Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getCallOperationActionLabel_5006Parser() {
+ if(callOperationActionLabel_5006Parser == null) {
+ callOperationActionLabel_5006Parser = new CallOperationActionParser();
+ }
+ return callOperationActionLabel_5006Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinParser actionInputPinLabel_5017Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getActionInputPinLabel_5017Parser() {
+ if(actionInputPinLabel_5017Parser == null) {
+ actionInputPinLabel_5017Parser = new PinParser();
+ }
+ return actionInputPinLabel_5017Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinValueParser actionInputPinLabel_5028Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getActionInputPinLabel_5028Parser() {
+ if(actionInputPinLabel_5028Parser == null) {
+ actionInputPinLabel_5028Parser = new PinValueParser();
+ }
+ return actionInputPinLabel_5028Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinParser valuePinLabel_5018Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getValuePinLabel_5018Parser() {
+ if(valuePinLabel_5018Parser == null) {
+ valuePinLabel_5018Parser = new PinParser();
+ }
+ return valuePinLabel_5018Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinValueParser valuePinLabel_5029Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getValuePinLabel_5029Parser() {
+ if(valuePinLabel_5029Parser == null) {
+ valuePinLabel_5029Parser = new PinValueParser();
+ }
+ return valuePinLabel_5029Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinParser inputPinLabel_5019Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getInputPinLabel_5019Parser() {
+ if(inputPinLabel_5019Parser == null) {
+ inputPinLabel_5019Parser = new PinParser();
+ }
+ return inputPinLabel_5019Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinParser outputPinLabel_5020Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getOutputPinLabel_5020Parser() {
+ if(outputPinLabel_5020Parser == null) {
+ outputPinLabel_5020Parser = new PinParser();
+ }
+ return outputPinLabel_5020Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinParser valuePinLabel_5021Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getValuePinLabel_5021Parser() {
+ if(valuePinLabel_5021Parser == null) {
+ valuePinLabel_5021Parser = new PinParser();
+ }
+ return valuePinLabel_5021Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinValueParser valuePinLabel_5030Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getValuePinLabel_5030Parser() {
+ if(valuePinLabel_5030Parser == null) {
+ valuePinLabel_5030Parser = new PinValueParser();
+ }
+ return valuePinLabel_5030Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinParser actionInputPinLabel_5022Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getActionInputPinLabel_5022Parser() {
+ if(actionInputPinLabel_5022Parser == null) {
+ actionInputPinLabel_5022Parser = new PinParser();
+ }
+ return actionInputPinLabel_5022Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinValueParser actionInputPinLabel_5031Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getActionInputPinLabel_5031Parser() {
+ if(actionInputPinLabel_5031Parser == null) {
+ actionInputPinLabel_5031Parser = new PinValueParser();
+ }
+ return actionInputPinLabel_5031Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private PinParser inputPinLabel_5023Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getInputPinLabel_5023Parser() {
+ if(inputPinLabel_5023Parser == null) {
+ inputPinLabel_5023Parser = new PinParser();
+ }
+ return inputPinLabel_5023Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private IParser constraintName_5007Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getConstraintName_5007Parser() {
+ if(constraintName_5007Parser == null) {
+ EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ MessageFormatParser parser = new MessageFormatParser(features);
+ parser.setViewPattern("<<localPrecondition>>\n{0}"); //$NON-NLS-1$
+ parser.setEditorPattern("{0}"); //$NON-NLS-1$
+ parser.setEditPattern("{0}"); //$NON-NLS-1$
+ constraintName_5007Parser = parser;
+ }
+ return constraintName_5007Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private IParser constraintName_5008Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getConstraintName_5008Parser() {
+ if(constraintName_5008Parser == null) {
+ EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ MessageFormatParser parser = new MessageFormatParser(features);
+ parser.setViewPattern("<<localPostcondition>>\n{0}"); //$NON-NLS-1$
+ parser.setEditorPattern("{0}"); //$NON-NLS-1$
+ parser.setEditPattern("{0}"); //$NON-NLS-1$
+ constraintName_5008Parser = parser;
+ }
+ return constraintName_5008Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private IParser activityName_5032Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getActivityName_5032Parser() {
+ if(activityName_5032Parser == null) {
+ EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ MessageFormatParser parser = new MessageFormatParser(features);
+ parser.setViewPattern("<<selection>>\n{0}"); //$NON-NLS-1$
+ parser.setEditorPattern("{0}"); //$NON-NLS-1$
+ parser.setEditPattern("{0}"); //$NON-NLS-1$
+ activityName_5032Parser = parser;
+ }
+ return activityName_5032Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private IParser activityName_5033Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getActivityName_5033Parser() {
+ if(activityName_5033Parser == null) {
+ EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ MessageFormatParser parser = new MessageFormatParser(features);
+ parser.setViewPattern("<<transformation>>\n{0}"); //$NON-NLS-1$
+ parser.setEditorPattern("{0}"); //$NON-NLS-1$
+ parser.setEditPattern("{0}"); //$NON-NLS-1$
+ activityName_5033Parser = parser;
+ }
+ return activityName_5033Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private IParser objectFlowName_6001Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getObjectFlowName_6001Parser() {
+ if(objectFlowName_6001Parser == null) {
+ EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ MessageFormatParser parser = new MessageFormatParser(features);
+ objectFlowName_6001Parser = parser;
+ }
+ return objectFlowName_6001Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private ActivityEdgeWeightParser objectFlowLabel_6002Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getObjectFlowLabel_6002Parser() {
+ if(objectFlowLabel_6002Parser == null) {
+ objectFlowLabel_6002Parser = new ActivityEdgeWeightParser();
+ }
+ return objectFlowLabel_6002Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private IParser controlFlowName_6003Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getControlFlowName_6003Parser() {
+ if(controlFlowName_6003Parser == null) {
+ EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ MessageFormatParser parser = new MessageFormatParser(features);
+ controlFlowName_6003Parser = parser;
+ }
+ return controlFlowName_6003Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private ActivityEdgeWeightParser controlFlowLabel_6004Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getControlFlowLabel_6004Parser() {
+ if(controlFlowLabel_6004Parser == null) {
+ controlFlowLabel_6004Parser = new ActivityEdgeWeightParser();
+ }
+ return controlFlowLabel_6004Parser;
+ }
+
+ /**
+ * @generated
+ */
protected IParser getParser(int visualID) {
switch(visualID) {
case ActivityNameEditPart.VISUAL_ID:
@@ -139,10 +714,78 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
return getActivityIsSingleExecution_5002Parser();
case ParameterEditPart.VISUAL_ID:
return getParameter_3001Parser();
- case ConstraintEditPart.VISUAL_ID:
+ case ConstraintInActivityAsPrecondEditPart.VISUAL_ID:
return getConstraint_3002Parser();
- case Constraint2EditPart.VISUAL_ID:
+ case ConstraintInActivityAsPostcondEditPart.VISUAL_ID:
return getConstraint_3003Parser();
+ case OpaqueActionNameEditPart.VISUAL_ID:
+ return getOpaqueActionName_5003Parser();
+ case ValuePinInOActLabelEditPart.VISUAL_ID:
+ return getValuePinLabel_5011Parser();
+ case ValuePinInOActValueEditPart.VISUAL_ID:
+ return getValuePinLabel_5024Parser();
+ case ActionInputPinInOActLabelEditPart.VISUAL_ID:
+ return getActionInputPinLabel_5012Parser();
+ case ActionInputPinInOActValueEditPart.VISUAL_ID:
+ return getActionInputPinLabel_5025Parser();
+ case InputPinInOActLabelEditPart.VISUAL_ID:
+ return getInputPinLabel_5009Parser();
+ case OutputPinInOActLabelEditPart.VISUAL_ID:
+ return getOutputPinLabel_5010Parser();
+ case CallBehaviorActionNameEditPart.VISUAL_ID:
+ return getCallBehaviorActionLabel_5004Parser();
+ case ValuePinInCBActLabelEditPart.VISUAL_ID:
+ return getValuePinLabel_5013Parser();
+ case ValuePinInCBActValueEditPart.VISUAL_ID:
+ return getValuePinLabel_5026Parser();
+ case ActionInputPinInCBActLabelEditPart.VISUAL_ID:
+ return getActionInputPinLabel_5014Parser();
+ case ActionInputPinInCBActValueEditPart.VISUAL_ID:
+ return getActionInputPinLabel_5027Parser();
+ case InputPinInCBActLabelEditPart.VISUAL_ID:
+ return getInputPinLabel_5015Parser();
+ case OutputPinInCBActLabelEditPart.VISUAL_ID:
+ return getOutputPinLabel_5016Parser();
+ case CallOperationActionNameEditPart.VISUAL_ID:
+ return getCallOperationActionLabel_5006Parser();
+ case ActionInputPinInCOActLabelEditPart.VISUAL_ID:
+ return getActionInputPinLabel_5017Parser();
+ case ActionInputPinInCOActValueEditPart.VISUAL_ID:
+ return getActionInputPinLabel_5028Parser();
+ case ValuePinInCOActLabelEditPart.VISUAL_ID:
+ return getValuePinLabel_5018Parser();
+ case ValuePinInCOActValueEditPart.VISUAL_ID:
+ return getValuePinLabel_5029Parser();
+ case InputPinInCOActLabelEditPart.VISUAL_ID:
+ return getInputPinLabel_5019Parser();
+ case OutputPinInCOActLabelEditPart.VISUAL_ID:
+ return getOutputPinLabel_5020Parser();
+ case ValuePinInCOActAsTargetLabelEditPart.VISUAL_ID:
+ return getValuePinLabel_5021Parser();
+ case ValuePinInCOActAsTargetValueEditPart.VISUAL_ID:
+ return getValuePinLabel_5030Parser();
+ case ActionInputPinInCOActAsTargetLabelEditPart.VISUAL_ID:
+ return getActionInputPinLabel_5022Parser();
+ case ActionInputPinInCOActAsTargetValueEditPart.VISUAL_ID:
+ return getActionInputPinLabel_5031Parser();
+ case InputPinInCOActAsTargetLabelEditPart.VISUAL_ID:
+ return getInputPinLabel_5023Parser();
+ case ConstraintAsLocalPrecondNameEditPart.VISUAL_ID:
+ return getConstraintName_5007Parser();
+ case ConstraintAsLocalPostcondNameEditPart.VISUAL_ID:
+ return getConstraintName_5008Parser();
+ case ActivityAsSelectionNameEditPart.VISUAL_ID:
+ return getActivityName_5032Parser();
+ case ActivityAsTransformationNameEditPart.VISUAL_ID:
+ return getActivityName_5033Parser();
+ case ObjectFlowNameEditPart.VISUAL_ID:
+ return getObjectFlowName_6001Parser();
+ case ObjectFlowWeightEditPart.VISUAL_ID:
+ return getObjectFlowLabel_6002Parser();
+ case ControlFlowNameEditPart.VISUAL_ID:
+ return getControlFlowName_6003Parser();
+ case ControlFlowWeightEditPart.VISUAL_ID:
+ return getControlFlowLabel_6004Parser();
}
return null;
}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLViewProvider.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLViewProvider.java
index 78c6941b621..2e68abd1d7d 100644
--- a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLViewProvider.java
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/providers/UMLViewProvider.java
@@ -13,6 +13,8 @@
*****************************************************************************/
package org.eclipse.papyrus.diagram.activity.providers;
+import java.util.ArrayList;
+
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EObject;
@@ -28,38 +30,106 @@ import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperatio
import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation;
import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewOperation;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.notation.Connector;
import org.eclipse.gmf.runtime.notation.DecorationNode;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.FillStyle;
import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.Location;
import org.eclipse.gmf.runtime.notation.MeasurementUnit;
import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.gmf.runtime.notation.NotationFactory;
import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.RelativeBendpoints;
+import org.eclipse.gmf.runtime.notation.Routing;
import org.eclipse.gmf.runtime.notation.Shape;
import org.eclipse.gmf.runtime.notation.TitleStyle;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCBActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActAsTargetLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActAsTargetValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCOActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionInputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPostconditionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActionLocalPreconditionEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityContentCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityParametersCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityPostConditionsCompartmentEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityActivityPreConditionsCompartmentEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsSelectionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsTransformationEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityAsTransformationNameEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityDiagramEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityFinalNodeEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityIsSingleExecutionEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ActivityNameEditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.Constraint2EditPart;
-import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallBehaviorActionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.CallOperationActionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPostcondNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintAsLocalPrecondNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPostcondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ConstraintInActivityAsPrecondEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ControlFlowWeightEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.FlowFinalNodeEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.InitialNodeEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCOActAsTargetLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.InputPinInOpaqueActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowSelectionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowTransformationEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ObjectFlowWeightEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OpaqueActionNameEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.OutputPinInOpaqueActEditPart;
import org.eclipse.papyrus.diagram.activity.edit.parts.ParameterEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCBActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCBActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActAsTargetLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActAsTargetValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCOActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallBeActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActAsTargetEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInCallOpActEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOActLabelEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOActValueEditPart;
+import org.eclipse.papyrus.diagram.activity.edit.parts.ValuePinInOpaqueActEditPart;
import org.eclipse.papyrus.diagram.activity.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
@@ -74,7 +144,7 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
/**
* @generated
*/
- public final boolean provides(IOperation operation) {
+ public boolean provides(IOperation operation) {
if(operation instanceof CreateViewForKindOperation) {
return provides((CreateViewForKindOperation)operation);
}
@@ -110,7 +180,7 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
}
/**
- * @generated
+ * @generated NOT case ActivityAsTransformationEditPart
*/
protected boolean provides(CreateNodeViewOperation op) {
if(op.getContainerView() == null) {
@@ -147,21 +217,52 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
switch(visualID) {
case ActivityEditPart.VISUAL_ID:
case ParameterEditPart.VISUAL_ID:
- case ConstraintEditPart.VISUAL_ID:
+ case ConstraintInActivityAsPrecondEditPart.VISUAL_ID:
case InitialNodeEditPart.VISUAL_ID:
case ActivityFinalNodeEditPart.VISUAL_ID:
case FlowFinalNodeEditPart.VISUAL_ID:
- case Constraint2EditPart.VISUAL_ID:
+ case OpaqueActionEditPart.VISUAL_ID:
+ case ValuePinInOpaqueActEditPart.VISUAL_ID:
+ case ActionInputPinInOpaqueActEditPart.VISUAL_ID:
+ case InputPinInOpaqueActEditPart.VISUAL_ID:
+ case OutputPinInOpaqueActEditPart.VISUAL_ID:
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ case CallOperationActionEditPart.VISUAL_ID:
+ case ConstraintInActivityAsPostcondEditPart.VISUAL_ID:
+ case ValuePinInCallBeActEditPart.VISUAL_ID:
+ case ActionInputPinInCallBeActEditPart.VISUAL_ID:
+ case InputPinInCallBeActEditPart.VISUAL_ID:
+ case OutputPinInCallBeActEditPart.VISUAL_ID:
+ case ActionInputPinInCallOpActEditPart.VISUAL_ID:
+ case ValuePinInCallOpActEditPart.VISUAL_ID:
+ case InputPinInCallOpActEditPart.VISUAL_ID:
+ case OutputPinInCallOpActEditPart.VISUAL_ID:
+ case ValuePinInCallOpActAsTargetEditPart.VISUAL_ID:
+ case ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ case InputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ case ConstraintAsLocalPrecondEditPart.VISUAL_ID:
+ case ConstraintAsLocalPostcondEditPart.VISUAL_ID:
+ case ActivityAsSelectionEditPart.VISUAL_ID:
if(domainElement == null || visualID != UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
return false; // visual id in semantic hint should match visual id for domain element
}
break;
+ /*
+ * ActivityAsTransformationEditPart can not be distinguished from ActivityAsSelectionEditPart, since it can sometime be both at the
+ * same time.
+ * This leads to getting ActivityAsSelectionEditPart.VISUAL_ID as result instead of ActivityAsTransformationEditPart.VISUAL_ID
+ */
+ case ActivityAsTransformationEditPart.VISUAL_ID:
+ if(domainElement == null || ActivityAsSelectionEditPart.VISUAL_ID != UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
+ return false; // visual id in semantic hint should match visual id for domain element
+ }
+ break;
default:
return false;
}
}
}
- return ActivityEditPart.VISUAL_ID == visualID || ParameterEditPart.VISUAL_ID == visualID || ConstraintEditPart.VISUAL_ID == visualID || Constraint2EditPart.VISUAL_ID == visualID || InitialNodeEditPart.VISUAL_ID == visualID || ActivityFinalNodeEditPart.VISUAL_ID == visualID || FlowFinalNodeEditPart.VISUAL_ID == visualID;
+ return ActivityEditPart.VISUAL_ID == visualID || ParameterEditPart.VISUAL_ID == visualID || ConstraintInActivityAsPrecondEditPart.VISUAL_ID == visualID || ConstraintInActivityAsPostcondEditPart.VISUAL_ID == visualID || InitialNodeEditPart.VISUAL_ID == visualID || ActivityFinalNodeEditPart.VISUAL_ID == visualID || FlowFinalNodeEditPart.VISUAL_ID == visualID || OpaqueActionEditPart.VISUAL_ID == visualID || ValuePinInOpaqueActEditPart.VISUAL_ID == visualID || ActionInputPinInOpaqueActEditPart.VISUAL_ID == visualID || InputPinInOpaqueActEditPart.VISUAL_ID == visualID || OutputPinInOpaqueActEditPart.VISUAL_ID == visualID || CallBehaviorActionEditPart.VISUAL_ID == visualID || ValuePinInCallBeActEditPart.VISUAL_ID == visualID || ActionInputPinInCallBeActEditPart.VISUAL_ID == visualID || InputPinInCallBeActEditPart.VISUAL_ID == visualID || OutputPinInCallBeActEditPart.VISUAL_ID == visualID || CallOperationActionEditPart.VISUAL_ID == visualID || ActionInputPinInCallOpActEditPart.VISUAL_ID == visualID || ValuePinInCallOpActEditPart.VISUAL_ID == visualID || InputPinInCallOpActEditPart.VISUAL_ID == visualID || OutputPinInCallOpActEditPart.VISUAL_ID == visualID || ValuePinInCallOpActAsTargetEditPart.VISUAL_ID == visualID || ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID == visualID || InputPinInCallOpActAsTargetEditPart.VISUAL_ID == visualID || ConstraintAsLocalPrecondEditPart.VISUAL_ID == visualID || ConstraintAsLocalPostcondEditPart.VISUAL_ID == visualID || ActivityAsSelectionEditPart.VISUAL_ID == visualID || ActivityAsTransformationEditPart.VISUAL_ID == visualID;
}
/**
@@ -212,9 +313,9 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
return createActivity_2001(domainElement, containerView, index, persisted, preferencesHint);
case ParameterEditPart.VISUAL_ID:
return createParameter_3001(domainElement, containerView, index, persisted, preferencesHint);
- case ConstraintEditPart.VISUAL_ID:
+ case ConstraintInActivityAsPrecondEditPart.VISUAL_ID:
return createConstraint_3002(domainElement, containerView, index, persisted, preferencesHint);
- case Constraint2EditPart.VISUAL_ID:
+ case ConstraintInActivityAsPostcondEditPart.VISUAL_ID:
return createConstraint_3003(domainElement, containerView, index, persisted, preferencesHint);
case InitialNodeEditPart.VISUAL_ID:
return createInitialNode_3004(domainElement, containerView, index, persisted, preferencesHint);
@@ -222,6 +323,50 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
return createActivityFinalNode_3005(domainElement, containerView, index, persisted, preferencesHint);
case FlowFinalNodeEditPart.VISUAL_ID:
return createFlowFinalNode_3006(domainElement, containerView, index, persisted, preferencesHint);
+ case OpaqueActionEditPart.VISUAL_ID:
+ return createOpaqueAction_3007(domainElement, containerView, index, persisted, preferencesHint);
+ case ValuePinInOpaqueActEditPart.VISUAL_ID:
+ return createValuePin_3015(domainElement, containerView, index, persisted, preferencesHint);
+ case ActionInputPinInOpaqueActEditPart.VISUAL_ID:
+ return createActionInputPin_3016(domainElement, containerView, index, persisted, preferencesHint);
+ case InputPinInOpaqueActEditPart.VISUAL_ID:
+ return createInputPin_3013(domainElement, containerView, index, persisted, preferencesHint);
+ case OutputPinInOpaqueActEditPart.VISUAL_ID:
+ return createOutputPin_3014(domainElement, containerView, index, persisted, preferencesHint);
+ case CallBehaviorActionEditPart.VISUAL_ID:
+ return createCallBehaviorAction_3008(domainElement, containerView, index, persisted, preferencesHint);
+ case ValuePinInCallBeActEditPart.VISUAL_ID:
+ return createValuePin_3017(domainElement, containerView, index, persisted, preferencesHint);
+ case ActionInputPinInCallBeActEditPart.VISUAL_ID:
+ return createActionInputPin_3018(domainElement, containerView, index, persisted, preferencesHint);
+ case InputPinInCallBeActEditPart.VISUAL_ID:
+ return createInputPin_3019(domainElement, containerView, index, persisted, preferencesHint);
+ case OutputPinInCallBeActEditPart.VISUAL_ID:
+ return createOutputPin_3020(domainElement, containerView, index, persisted, preferencesHint);
+ case CallOperationActionEditPart.VISUAL_ID:
+ return createCallOperationAction_3010(domainElement, containerView, index, persisted, preferencesHint);
+ case ActionInputPinInCallOpActEditPart.VISUAL_ID:
+ return createActionInputPin_3021(domainElement, containerView, index, persisted, preferencesHint);
+ case ValuePinInCallOpActEditPart.VISUAL_ID:
+ return createValuePin_3022(domainElement, containerView, index, persisted, preferencesHint);
+ case InputPinInCallOpActEditPart.VISUAL_ID:
+ return createInputPin_3023(domainElement, containerView, index, persisted, preferencesHint);
+ case OutputPinInCallOpActEditPart.VISUAL_ID:
+ return createOutputPin_3024(domainElement, containerView, index, persisted, preferencesHint);
+ case ValuePinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return createValuePin_3025(domainElement, containerView, index, persisted, preferencesHint);
+ case ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return createActionInputPin_3026(domainElement, containerView, index, persisted, preferencesHint);
+ case InputPinInCallOpActAsTargetEditPart.VISUAL_ID:
+ return createInputPin_3027(domainElement, containerView, index, persisted, preferencesHint);
+ case ConstraintAsLocalPrecondEditPart.VISUAL_ID:
+ return createConstraint_3011(domainElement, containerView, index, persisted, preferencesHint);
+ case ConstraintAsLocalPostcondEditPart.VISUAL_ID:
+ return createConstraint_3012(domainElement, containerView, index, persisted, preferencesHint);
+ case ActivityAsSelectionEditPart.VISUAL_ID:
+ return createActivity_3028(domainElement, containerView, index, persisted, preferencesHint);
+ case ActivityAsTransformationEditPart.VISUAL_ID:
+ return createActivity_3029(domainElement, containerView, index, persisted, preferencesHint);
}
// can't happen, provided #provides(CreateNodeViewOperation) is correct
return null;
@@ -234,6 +379,18 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
IElementType elementType = getSemanticElementType(semanticAdapter);
String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
switch(UMLVisualIDRegistry.getVisualID(elementTypeHint)) {
+ case ActionLocalPreconditionEditPart.VISUAL_ID:
+ return createActionLocalPrecondition_4001(containerView, index, persisted, preferencesHint);
+ case ActionLocalPostconditionEditPart.VISUAL_ID:
+ return createActionLocalPostcondition_4002(containerView, index, persisted, preferencesHint);
+ case ObjectFlowSelectionEditPart.VISUAL_ID:
+ return createObjectFlowSelection_4005(containerView, index, persisted, preferencesHint);
+ case ObjectFlowTransformationEditPart.VISUAL_ID:
+ return createObjectFlowTransformation_4006(containerView, index, persisted, preferencesHint);
+ case ObjectFlowEditPart.VISUAL_ID:
+ return createObjectFlow_4003(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
+ case ControlFlowEditPart.VISUAL_ID:
+ return createControlFlow_4004(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
}
// can never happen, provided #provides(CreateEdgeViewOperation) is correct
return null;
@@ -289,7 +446,7 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
public Node createConstraint_3002(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Node node = NotationFactory.eINSTANCE.createNode();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- node.setType(UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID));
+ node.setType(UMLVisualIDRegistry.getType(ConstraintInActivityAsPrecondEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
return node;
@@ -301,7 +458,7 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
public Node createConstraint_3003(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Node node = NotationFactory.eINSTANCE.createNode();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- node.setType(UMLVisualIDRegistry.getType(Constraint2EditPart.VISUAL_ID));
+ node.setType(UMLVisualIDRegistry.getType(ConstraintInActivityAsPostcondEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
return node;
@@ -377,6 +534,818 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
/**
* @generated
*/
+ public Node createOpaqueAction_3007(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(OpaqueActionEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "OpaqueAction");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "OpaqueAction");
+
+ Node label5003 = createLabel(node, UMLVisualIDRegistry.getType(OpaqueActionNameEditPart.VISUAL_ID));
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createValuePin_3015(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(ValuePinInOpaqueActEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "ValuePin");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "ValuePin");
+
+ Node label5011 = createLabel(node, UMLVisualIDRegistry.getType(ValuePinInOActLabelEditPart.VISUAL_ID));
+ label5011.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5011 = (Location)label5011.getLayoutConstraint();
+ location5011.setX(0);
+ location5011.setY(5);
+ Node label5024 = createLabel(node, UMLVisualIDRegistry.getType(ValuePinInOActValueEditPart.VISUAL_ID));
+ label5024.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5024 = (Location)label5024.getLayoutConstraint();
+ location5024.setX(0);
+ location5024.setY(5);
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createActionInputPin_3016(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(ActionInputPinInOpaqueActEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "ActionInputPin");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "ActionInputPin");
+
+ Node label5012 = createLabel(node, UMLVisualIDRegistry.getType(ActionInputPinInOActLabelEditPart.VISUAL_ID));
+ label5012.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5012 = (Location)label5012.getLayoutConstraint();
+ location5012.setX(0);
+ location5012.setY(5);
+ Node label5025 = createLabel(node, UMLVisualIDRegistry.getType(ActionInputPinInOActValueEditPart.VISUAL_ID));
+ label5025.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5025 = (Location)label5025.getLayoutConstraint();
+ location5025.setX(0);
+ location5025.setY(5);
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createInputPin_3013(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(InputPinInOpaqueActEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "InputPin");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "InputPin");
+
+ Node label5009 = createLabel(node, UMLVisualIDRegistry.getType(InputPinInOActLabelEditPart.VISUAL_ID));
+ label5009.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5009 = (Location)label5009.getLayoutConstraint();
+ location5009.setX(0);
+ location5009.setY(5);
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createOutputPin_3014(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(OutputPinInOpaqueActEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "OutputPin");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "OutputPin");
+
+ Node label5010 = createLabel(node, UMLVisualIDRegistry.getType(OutputPinInOActLabelEditPart.VISUAL_ID));
+ label5010.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5010 = (Location)label5010.getLayoutConstraint();
+ location5010.setX(0);
+ location5010.setY(5);
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createCallBehaviorAction_3008(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(CallBehaviorActionEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "CallBehaviorAction");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "CallBehaviorAction");
+
+ Node label5004 = createLabel(node, UMLVisualIDRegistry.getType(CallBehaviorActionNameEditPart.VISUAL_ID));
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createValuePin_3017(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(ValuePinInCallBeActEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "ValuePin");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "ValuePin");
+
+ Node label5013 = createLabel(node, UMLVisualIDRegistry.getType(ValuePinInCBActLabelEditPart.VISUAL_ID));
+ label5013.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5013 = (Location)label5013.getLayoutConstraint();
+ location5013.setX(0);
+ location5013.setY(5);
+ Node label5026 = createLabel(node, UMLVisualIDRegistry.getType(ValuePinInCBActValueEditPart.VISUAL_ID));
+ label5026.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5026 = (Location)label5026.getLayoutConstraint();
+ location5026.setX(0);
+ location5026.setY(5);
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createActionInputPin_3018(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(ActionInputPinInCallBeActEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "ActionInputPin");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "ActionInputPin");
+
+ Node label5014 = createLabel(node, UMLVisualIDRegistry.getType(ActionInputPinInCBActLabelEditPart.VISUAL_ID));
+ label5014.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5014 = (Location)label5014.getLayoutConstraint();
+ location5014.setX(0);
+ location5014.setY(5);
+ Node label5027 = createLabel(node, UMLVisualIDRegistry.getType(ActionInputPinInCBActValueEditPart.VISUAL_ID));
+ label5027.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5027 = (Location)label5027.getLayoutConstraint();
+ location5027.setX(0);
+ location5027.setY(5);
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createInputPin_3019(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(InputPinInCallBeActEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "InputPin");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "InputPin");
+
+ Node label5015 = createLabel(node, UMLVisualIDRegistry.getType(InputPinInCBActLabelEditPart.VISUAL_ID));
+ label5015.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5015 = (Location)label5015.getLayoutConstraint();
+ location5015.setX(0);
+ location5015.setY(5);
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createOutputPin_3020(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(OutputPinInCallBeActEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "OutputPin");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "OutputPin");
+
+ Node label5016 = createLabel(node, UMLVisualIDRegistry.getType(OutputPinInCBActLabelEditPart.VISUAL_ID));
+ label5016.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5016 = (Location)label5016.getLayoutConstraint();
+ location5016.setX(0);
+ location5016.setY(5);
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createCallOperationAction_3010(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(CallOperationActionEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "CallOperationAction");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "CallOperationAction");
+
+ Node label5006 = createLabel(node, UMLVisualIDRegistry.getType(CallOperationActionNameEditPart.VISUAL_ID));
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createActionInputPin_3021(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(ActionInputPinInCallOpActEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "ActionInputPin");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "ActionInputPin");
+
+ Node label5017 = createLabel(node, UMLVisualIDRegistry.getType(ActionInputPinInCOActLabelEditPart.VISUAL_ID));
+ label5017.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5017 = (Location)label5017.getLayoutConstraint();
+ location5017.setX(0);
+ location5017.setY(5);
+ Node label5028 = createLabel(node, UMLVisualIDRegistry.getType(ActionInputPinInCOActValueEditPart.VISUAL_ID));
+ label5028.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5028 = (Location)label5028.getLayoutConstraint();
+ location5028.setX(0);
+ location5028.setY(5);
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createValuePin_3022(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(ValuePinInCallOpActEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "ValuePin");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "ValuePin");
+
+ Node label5018 = createLabel(node, UMLVisualIDRegistry.getType(ValuePinInCOActLabelEditPart.VISUAL_ID));
+ label5018.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5018 = (Location)label5018.getLayoutConstraint();
+ location5018.setX(0);
+ location5018.setY(5);
+ Node label5029 = createLabel(node, UMLVisualIDRegistry.getType(ValuePinInCOActValueEditPart.VISUAL_ID));
+ label5029.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5029 = (Location)label5029.getLayoutConstraint();
+ location5029.setX(0);
+ location5029.setY(5);
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createInputPin_3023(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(InputPinInCallOpActEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "InputPin");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "InputPin");
+
+ Node label5019 = createLabel(node, UMLVisualIDRegistry.getType(InputPinInCOActLabelEditPart.VISUAL_ID));
+ label5019.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5019 = (Location)label5019.getLayoutConstraint();
+ location5019.setX(0);
+ location5019.setY(5);
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createOutputPin_3024(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(OutputPinInCallOpActEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "OutputPin");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "OutputPin");
+
+ Node label5020 = createLabel(node, UMLVisualIDRegistry.getType(OutputPinInCOActLabelEditPart.VISUAL_ID));
+ label5020.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5020 = (Location)label5020.getLayoutConstraint();
+ location5020.setX(0);
+ location5020.setY(5);
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createValuePin_3025(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(ValuePinInCallOpActAsTargetEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "ValuePin");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "ValuePin");
+
+ Node label5021 = createLabel(node, UMLVisualIDRegistry.getType(ValuePinInCOActAsTargetLabelEditPart.VISUAL_ID));
+ label5021.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5021 = (Location)label5021.getLayoutConstraint();
+ location5021.setX(0);
+ location5021.setY(5);
+ Node label5030 = createLabel(node, UMLVisualIDRegistry.getType(ValuePinInCOActAsTargetValueEditPart.VISUAL_ID));
+ label5030.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5030 = (Location)label5030.getLayoutConstraint();
+ location5030.setX(0);
+ location5030.setY(5);
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createActionInputPin_3026(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "ActionInputPin");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "ActionInputPin");
+
+ Node label5022 = createLabel(node, UMLVisualIDRegistry.getType(ActionInputPinInCOActAsTargetLabelEditPart.VISUAL_ID));
+ label5022.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5022 = (Location)label5022.getLayoutConstraint();
+ location5022.setX(0);
+ location5022.setY(5);
+ Node label5031 = createLabel(node, UMLVisualIDRegistry.getType(ActionInputPinInCOActAsTargetValueEditPart.VISUAL_ID));
+ label5031.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5031 = (Location)label5031.getLayoutConstraint();
+ location5031.setX(0);
+ location5031.setY(5);
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createInputPin_3027(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Shape node = NotationFactory.eINSTANCE.createShape();
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(InputPinInCallOpActAsTargetEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "InputPin");
+
+
+
+ initBackgroundFromPrefs(node, prefStore, "InputPin");
+
+ Node label5023 = createLabel(node, UMLVisualIDRegistry.getType(InputPinInCOActAsTargetLabelEditPart.VISUAL_ID));
+ label5023.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location5023 = (Location)label5023.getLayoutConstraint();
+ location5023.setX(0);
+ location5023.setY(5);
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createConstraint_3011(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Node node = NotationFactory.eINSTANCE.createNode();
+ node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
+ node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
+ node.getStyles().add(NotationFactory.eINSTANCE.createLineStyle());
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(ConstraintAsLocalPrecondEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "Constraint");
+
+ Node label5007 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintAsLocalPrecondNameEditPart.VISUAL_ID));
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createConstraint_3012(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Node node = NotationFactory.eINSTANCE.createNode();
+ node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
+ node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
+ node.getStyles().add(NotationFactory.eINSTANCE.createLineStyle());
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(ConstraintAsLocalPostcondEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "Constraint");
+
+ Node label5008 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintAsLocalPostcondNameEditPart.VISUAL_ID));
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createActivity_3028(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Node node = NotationFactory.eINSTANCE.createNode();
+ node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
+ node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
+ node.getStyles().add(NotationFactory.eINSTANCE.createLineStyle());
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(ActivityAsSelectionEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "Activity");
+
+ Node label5032 = createLabel(node, UMLVisualIDRegistry.getType(ActivityAsSelectionNameEditPart.VISUAL_ID));
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Node createActivity_3029(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Node node = NotationFactory.eINSTANCE.createNode();
+ node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
+ node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
+ node.getStyles().add(NotationFactory.eINSTANCE.createLineStyle());
+ node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
+ node.setType(UMLVisualIDRegistry.getType(ActivityAsTransformationEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(node, prefStore, "Activity");
+
+ Node label5033 = createLabel(node, UMLVisualIDRegistry.getType(ActivityAsTransformationNameEditPart.VISUAL_ID));
+ return node;
+ }
+
+ /**
+ * @generated
+ */
+ public Edge createActionLocalPrecondition_4001(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Edge edge = NotationFactory.eINSTANCE.createEdge();
+ edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle());
+ edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
+ RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
+ ArrayList points = new ArrayList(2);
+ points.add(new RelativeBendpoint());
+ points.add(new RelativeBendpoint());
+ bendpoints.setPoints(points);
+ edge.setBendpoints(bendpoints);
+ ViewUtil.insertChildView(containerView, edge, index, persisted);
+ edge.setType(UMLVisualIDRegistry.getType(ActionLocalPreconditionEditPart.VISUAL_ID));
+ edge.setElement(null);
+ // initializePreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+ Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
+ if(routing != null) {
+ ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ }
+ return edge;
+ }
+
+ /**
+ * @generated
+ */
+ public Edge createActionLocalPostcondition_4002(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Edge edge = NotationFactory.eINSTANCE.createEdge();
+ edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle());
+ edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
+ RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
+ ArrayList points = new ArrayList(2);
+ points.add(new RelativeBendpoint());
+ points.add(new RelativeBendpoint());
+ bendpoints.setPoints(points);
+ edge.setBendpoints(bendpoints);
+ ViewUtil.insertChildView(containerView, edge, index, persisted);
+ edge.setType(UMLVisualIDRegistry.getType(ActionLocalPostconditionEditPart.VISUAL_ID));
+ edge.setElement(null);
+ // initializePreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+ Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
+ if(routing != null) {
+ ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ }
+ return edge;
+ }
+
+ /**
+ * @generated
+ */
+ public Edge createObjectFlowSelection_4005(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Connector edge = NotationFactory.eINSTANCE.createConnector();
+ edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
+ RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
+ ArrayList points = new ArrayList(2);
+ points.add(new RelativeBendpoint());
+ points.add(new RelativeBendpoint());
+ bendpoints.setPoints(points);
+ edge.setBendpoints(bendpoints);
+ ViewUtil.insertChildView(containerView, edge, index, persisted);
+ edge.setType(UMLVisualIDRegistry.getType(ObjectFlowSelectionEditPart.VISUAL_ID));
+ edge.setElement(null);
+ // initializePreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+
+ Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
+ if(routing != null) {
+ ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ }
+ return edge;
+ }
+
+ /**
+ * @generated
+ */
+ public Edge createObjectFlowTransformation_4006(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Connector edge = NotationFactory.eINSTANCE.createConnector();
+ edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
+ RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
+ ArrayList points = new ArrayList(2);
+ points.add(new RelativeBendpoint());
+ points.add(new RelativeBendpoint());
+ bendpoints.setPoints(points);
+ edge.setBendpoints(bendpoints);
+ ViewUtil.insertChildView(containerView, edge, index, persisted);
+ edge.setType(UMLVisualIDRegistry.getType(ObjectFlowTransformationEditPart.VISUAL_ID));
+ edge.setElement(null);
+ // initializePreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+
+ Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
+ if(routing != null) {
+ ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ }
+ return edge;
+ }
+
+ /**
+ * @generated
+ */
+ public Edge createObjectFlow_4003(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Connector edge = NotationFactory.eINSTANCE.createConnector();
+ edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
+ RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
+ ArrayList points = new ArrayList(2);
+ points.add(new RelativeBendpoint());
+ points.add(new RelativeBendpoint());
+ bendpoints.setPoints(points);
+ edge.setBendpoints(bendpoints);
+ ViewUtil.insertChildView(containerView, edge, index, persisted);
+ edge.setType(UMLVisualIDRegistry.getType(ObjectFlowEditPart.VISUAL_ID));
+ edge.setElement(domainElement);
+ // initializePreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(edge, prefStore, "ObjectFlow");
+
+
+ initFontStyleFromPrefs(edge, prefStore, "ObjectFlow");
+
+ Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
+ if(routing != null) {
+ ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ }
+ Node label6001 = createLabel(edge, UMLVisualIDRegistry.getType(ObjectFlowNameEditPart.VISUAL_ID));
+ label6001.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location6001 = (Location)label6001.getLayoutConstraint();
+ location6001.setX(0);
+ location6001.setY(40);
+ Node label6002 = createLabel(edge, UMLVisualIDRegistry.getType(ObjectFlowWeightEditPart.VISUAL_ID));
+ label6002.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location6002 = (Location)label6002.getLayoutConstraint();
+ location6002.setX(0);
+ location6002.setY(60);
+ return edge;
+ }
+
+ /**
+ * @generated
+ */
+ public Edge createControlFlow_4004(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Connector edge = NotationFactory.eINSTANCE.createConnector();
+ edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
+ RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
+ ArrayList points = new ArrayList(2);
+ points.add(new RelativeBendpoint());
+ points.add(new RelativeBendpoint());
+ bendpoints.setPoints(points);
+ edge.setBendpoints(bendpoints);
+ ViewUtil.insertChildView(containerView, edge, index, persisted);
+ edge.setType(UMLVisualIDRegistry.getType(ControlFlowEditPart.VISUAL_ID));
+ edge.setElement(domainElement);
+ // initializePreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+
+ initForegroundFromPrefs(edge, prefStore, "ControlFlow");
+
+
+ initFontStyleFromPrefs(edge, prefStore, "ControlFlow");
+
+ Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
+ if(routing != null) {
+ ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ }
+ Node label6003 = createLabel(edge, UMLVisualIDRegistry.getType(ControlFlowNameEditPart.VISUAL_ID));
+ label6003.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location6003 = (Location)label6003.getLayoutConstraint();
+ location6003.setX(0);
+ location6003.setY(40);
+ Node label6004 = createLabel(edge, UMLVisualIDRegistry.getType(ControlFlowWeightEditPart.VISUAL_ID));
+ label6004.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location6004 = (Location)label6004.getLayoutConstraint();
+ location6004.setX(0);
+ location6004.setY(60);
+ return edge;
+ }
+
+ /**
+ * @generated
+ */
private void stampShortcut(View containerView, Node target) {
if(!ActivityDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();

Back to the top